Skip to content

Commit

Permalink
Minor client changes (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
shriyash-shukla authored Jul 3, 2024
1 parent 47b3d92 commit 89236be
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 42 deletions.
4 changes: 2 additions & 2 deletions src/lib/components/Footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
<path stroke-linecap="round" stroke-linejoin="round" d="M9.75 3.104v5.714a2.25 2.25 0 01-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 014.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0112 15a9.065 9.065 0 00-6.23-.693L5 14.5m14.8.8l1.402 1.402c1.232 1.232.65 3.318-1.067 3.611A48.309 48.309 0 0112 21c-2.773 0-5.491-.235-8.135-.687-1.718-.293-2.3-2.379-1.067-3.61L5 14.5" />
</svg>
<p>Copyright © 2023 Banfts <span class="hidden lg:inline-block"> - Licensed under the AGPLv3</span></p>
<p>Copyright © 2024 Banfts <span class="hidden lg:inline-block"> - Licensed under the AGPLv3</span></p>
</aside>
<nav class="grid-flow-col gap-4 md:place-self-center md:justify-self-end">
<a href="https://discord.gg/FDv3wpbyHS" target="_blank" rel="noopener noreferrer"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="fill-current w-5 h-5"><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg></a>
<a href="https://github.com/banfts/banfts-client" target="_blank" rel="noopener noreferrer"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="fill-current w-5 h-5"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a>
<a href="https://github.com/banfts" target="_blank" rel="noopener noreferrer"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="fill-current w-5 h-5"><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg></a>
</nav>
</footer>
9 changes: 4 additions & 5 deletions src/lib/components/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import { ONE_DAY_MS } from '$lib/config/constants.js';
import { FOURTEEN_DAY_MS } from '$lib/config/constants.js';
import { sessionAddress, loginTimestamp } from '$lib/services/stores.js';
async function logoutConfirm() {
Expand Down Expand Up @@ -51,7 +51,7 @@
<a class="btn btn-primary btn-block" href="/market/official_sales">Official Sales</a>
</div>
<div class="card-actions">
<a class="btn btn-primary btn-block" href="/explorer/minters">All Minters</a>
<a class="btn btn-primary btn-block" href="/explorer/minters">Minters</a>
</div>
</div>
</div>
Expand All @@ -65,17 +65,16 @@
</svg>
</label>
<ul tabindex="0" class="menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-52">
{#if $sessionAddress.startsWith("ban_") && $loginTimestamp > Date.now() - ONE_DAY_MS}
{#if $sessionAddress.startsWith("ban_") && $loginTimestamp > Date.now() - FOURTEEN_DAY_MS}
<li aria-current={$page.url.pathname === '/account' ? 'page' : undefined}>
<a class="justify-between" href="/account">
Account
<span class="badge">New</span>
</a>
</li>
<li aria-current={$page.url.pathname === '/settings' ? 'page' : undefined}><a href="/settings">Settings</a></li>
{/if}
<li aria-current={$page.url.pathname === '/minting' ? 'page' : undefined}><a href="/minting">Minting</a></li>
{#if $sessionAddress.startsWith("ban_") && $loginTimestamp > Date.now() - ONE_DAY_MS}
{#if $sessionAddress.startsWith("ban_") && $loginTimestamp > Date.now() - FOURTEEN_DAY_MS}
<li aria-current={$page.url.pathname === '/logout' ? 'page' : undefined}><button on:click={logoutConfirm}>Logout</button></li>
{/if}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ListingCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<h2 class="card-title">{metadata.name}</h2>
<div class="flex flex-col my-2">
<div class="flex justify-between">
<h3 class="text-sm text-gray-400">Ask Price</h3>
<h3 class="text-sm text-gray-400">Ask Price:</h3>
<p class="text-end dark:text-yellow-200 font-bold">{listing.ask_price} BAN</p>
</div>
<div class="flex justify-between">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export const BANANO_PREFIX = 'ban_';

export const PER_PAGE = 8;

export const ONE_DAY_MS = 24*60*60*1000;
export const FOURTEEN_DAY_MS = 24*60*60*1000*14;
4 changes: 2 additions & 2 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { ONE_DAY_MS } from '$lib/config/constants.js';
import { FOURTEEN_DAY_MS } from '$lib/config/constants.js';
import { sessionAddress, loginTimestamp } from '$lib/services/stores.js';
</script>

Expand All @@ -13,7 +13,7 @@
<div class="max-w-md">
<h1 class="text-5xl font-bold">Banfts Marketplace</h1>
<p class="py-6">Buy and sell Banano NFTs securely and effortlessly! No registration required.</p>
{#if $sessionAddress.startsWith("ban_") && $loginTimestamp > Date.now() - ONE_DAY_MS}
{#if $sessionAddress.startsWith("ban_") && $loginTimestamp > Date.now() - FOURTEEN_DAY_MS}
<p class="pb-6 text-green-400">You appear to be already logged in.</p>
{/if}
<a class="btn btn-primary btn-sm" href="/auth/signature">Login with signature</a>
Expand Down
16 changes: 8 additions & 8 deletions src/routes/account/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<div class="mt-4 lg:row-span-1 lg:mt-0">
<h2 class="sr-only">Account Information</h2>
<p class="text-3xl tracking-tight text-gray-400 dark:text-gray-300 mb-4">Account { $sessionAddress === data.account.address ? "(you)" : "" }</p>
<p class="text-3xl tracking-tight text-gray-400 dark:text-gray-300 mb-4">Account { $sessionAddress === data.account.address ? "" : "" }</p>
<div>
<h3 class="sr-only">Description</h3>
Expand All @@ -83,16 +83,16 @@
<a class="btn btn-primary btn-block" href="#owned">Scroll To Owned NFTs</a>
</div>
<div class="mt-8">
<h3 class="font-medium text-gray-400 mb-2">Details</h3>
<h3 class="font-medium text-gray-400 mb-2">Details:</h3>
<!--<span class="text-gray-500 text-xs">Registered</span>
<p class="text-gray-400 dark:text-gray-300 truncate">{data.account.registered ? 'Yes' : 'No'}</p>-->
<span class="text-gray-500 text-xs">Registration Date</span>
<span class="text-gray-500 text-xs">Registration Date:</span>
<p class="text-gray-400 dark:text-gray-300 truncate">{data.account.registered_timestamp ? new Date(Number(data.account.registered_timestamp)) : 'Unregistered'}</p>
<span class="text-gray-500 text-xs">Total Trades</span>
<p class="text-gray-400 dark:text-gray-300 truncate"><!--{data.account.trades.length}-->Coming soon tm</p>
<span class="text-gray-500 text-xs">Total Listings</span>
<p class="text-gray-400 dark:text-gray-300 truncate"><!--{data.account.listings.length}-->Coming soon tm</p>
<span class="text-gray-500 text-xs">Total Assets</span>
<span class="text-gray-500 text-xs">Total Trades:</span>
<p class="text-gray-400 dark:text-gray-300 truncate"><!--{data.account.trades.length}-->Coming Soon™</p>
<span class="text-gray-500 text-xs">Total Listings:</span>
<p class="text-gray-400 dark:text-gray-300 truncate"><!--{data.account.listings.length}-->Coming Soon™</p>
<span class="text-gray-500 text-xs">Total Assets:</span>
<p class="text-gray-400 dark:text-gray-300 truncate">{data.account.assets.length}</p>
</div>
<p>*Please note that it may take some time for the crawler to reflect any recent NFT sends/receives</p>
Expand Down
4 changes: 2 additions & 2 deletions src/routes/explorer/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

<div class="mt-4">
<div class="max-w-7xl sm:px-4 lg:px-8">
<h2 class="text-xl font-bold tracking-tight text-gray-400 mb-4">Featured</h2>
<h2 class="text-xl font-bold tracking-tight text-gray-400 mb-4">Featured:</h2>
</div>
</div>
<div class="max-w-full px-4 pb-4 sm:px-6 lg:px-8">
Expand All @@ -90,7 +90,7 @@
<h2 class="card-title">Asset Name</h2>
<div class="flex flex-col my-2">
<div class="flex justify-between">
<h3 class="text-sm text-gray-400">Ask Price</h3>
<h3 class="text-sm text-gray-400">Ask Price:</h3>
<p class="text-end dark:text-yellow-200 font-bold">199 BAN</p>
</div>
<div class="flex justify-between">
Expand Down
18 changes: 9 additions & 9 deletions src/routes/explorer/assets/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@
</div>
<div class="mt-4 lg:row-span-1 lg:mt-0">
<h2 class="sr-only">Asset information</h2>
<h2 class="sr-only">Asset information:</h2>
<p class="text-3xl tracking-tight text-gray-400 dark:text-gray-300 mb-4">{data.asset_metadata.name}</p>
<div>
<h3 class="sr-only">Description</h3>
<h3 class="sr-only">Description:</h3>
<div class="space-y-6">
<p class="text-base text-gray-400">{data.asset_metadata.description}</p>
</div>
Expand All @@ -86,18 +86,18 @@
<a class="btn btn-primary btn-block" href="/market/listings?mint_hash={data.mint_hash}">Find in the Marketplace</a>
</div>
<div class="mt-8">
<h3 class="font-medium text-gray-400 mb-2">Details</h3>
<span class="text-gray-500 text-xs">Supply Hash</span>
<h3 class="font-medium text-gray-400 mb-2">Details:</h3>
<span class="text-gray-500 text-xs">Supply Hash:</span>
<p class="text-gray-400 dark:text-gray-300 truncate"><a class="link" href="/explorer/supply?supply_hash={data.asset.supply_hash}">{data.asset.supply_hash}</a></p>
<span class="text-gray-500 text-xs">Mint Hash</span>
<span class="text-gray-500 text-xs">Mint Hash:</span>
<p class="text-gray-400 dark:text-gray-300 truncate">{data.asset.mint_hash}</p>
<span class="text-gray-500 text-xs">Owner</span>
<span class="text-gray-500 text-xs">Owner:</span>
<p class="text-gray-400 dark:text-gray-300 truncate"><a class="link" href="/explorer/addresses?address={data.asset.owner}">{data.asset.owner}</a></p>
<span class="text-gray-500 text-xs">Asset Representative</span>
<span class="text-gray-500 text-xs">Asset Representative:</span>
<p class="text-gray-400 dark:text-gray-300 truncate hover:underline hover:decoration-dotted" title="To send this NFT, send a transaction while your rep is set to this">{data.asset_representative}</p>
<span class="text-gray-500 text-xs">Issuer</span>
<span class="text-gray-500 text-xs">Issuer:</span>
<p class="text-gray-400 dark:text-gray-300 truncate"><a class="link" href="/explorer/minters?address={data.asset_metadata.properties.issuer}">{data.asset_metadata.properties.issuer}</a></p>
<span class="text-gray-500 text-xs">Lock status</span>
<span class="text-gray-500 text-xs">Lock status:</span>
<p class="text-gray-400 dark:text-gray-300 truncate hover:underline hover:decoration-dotted" title="NFTs are locked when undergoing an atomic swap">{data.asset.locked ? 'Locked' : 'Unlocked'}</p>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/routes/explorer/minters/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@
<a class="btn btn-primary btn-block" href="#supply">Scroll To Supply NFTs</a>
</div>
<div class="mt-8">
<h3 class="font-medium text-gray-400 mb-2">Details</h3>
<span class="text-gray-500 text-xs">Owned NFTs</span>
<h3 class="font-medium text-gray-400 mb-2">Details:</h3>
<span class="text-gray-500 text-xs">Owned NFTs:</span>
<p class="text-gray-400 dark:text-gray-300 truncate"><a class="link" href="/explorer/addresses?address={data.address}">Click Here</a></p>
<span class="text-gray-500 text-xs">External Link</span>
<span class="text-gray-500 text-xs">External Link:</span>
<p class="text-gray-400 dark:text-gray-300 truncate">
{#if data.info.external_url}
<ExternalLink url={data.info.external_url} content="{data.info.external_url}"/>
{:else}
No external link
{/if}
</p>
<span class="text-gray-500 text-xs">Total Supply NFTs</span>
<span class="text-gray-500 text-xs">Total Supply NFTs:</span>
<p class="text-gray-400 dark:text-gray-300 truncate">{data.supplies.length}</p>
</div>
</div>
Expand Down
14 changes: 7 additions & 7 deletions src/routes/explorer/supply/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,18 @@
<a class="btn btn-primary btn-block" href="/market?supply_hash={data.info.supply_hash}">Find in the Marketplace</a>
</div>
<div class="mt-8">
<h3 class="font-medium text-gray-400 mb-2">Details</h3>
<span class="text-gray-500 text-xs">Metadata Representative</span>
<h3 class="font-medium text-gray-400 mb-2">Details:</h3>
<span class="text-gray-500 text-xs">Metadata Representative:</span>
<p class="text-gray-400 dark:text-gray-300 truncate">{data.info.asset_supply.metadata_representative}</p>
<span class="text-gray-500 text-xs">Issuer</span>
<span class="text-gray-500 text-xs">Issuer:</span>
<p class="text-gray-400 dark:text-gray-300 truncate"><a class="link" href="/explorer/minters?address={data.info.asset_supply.minter_address}">{data.info.asset_supply.minter_address}</a></p>
<span class="text-gray-500 text-xs">Max Supply</span>
<span class="text-gray-500 text-xs">Max Supply:</span>
<p class="text-gray-400 dark:text-gray-300">{ data.info.asset_supply.max_supply === 0 ? "No Limit" : data.info.asset_supply.max_supply }</p>
<span class="text-gray-500 text-xs">Total Minted</span>
<span class="text-gray-500 text-xs">Total Minted:</span>
<p class="text-gray-400 dark:text-gray-300">{data.count}/{ data.info.asset_supply.max_supply === 0 ? "" : data.info.asset_supply.max_supply }</p>
<span class="text-gray-500 text-xs">Protocol Version</span>
<span class="text-gray-500 text-xs">Protocol Version:</span>
<p class="text-gray-400 dark:text-gray-300">{data.info.asset_supply.version.major_version}.{data.info.asset_supply.version.minor_version}.{data.info.asset_supply.version.patch_version}</p>
<span class="text-gray-500 text-xs">External URL</span>
<span class="text-gray-500 text-xs">External URL:</span>
<p class="text-gray-400 dark:text-gray-300">{ data.info.asset_supply.nft_metadata.external_url ? data.info.asset_supply.nft_metadata.external_url : "None" }</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/minting/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
-->

<div class="p-2">
<p class="mb-2">Something not going quite right? Check out our <a class="link" href="/help/minting">hopefully helpful help page</a>. We recommend you run this locally for security reasons. Also, generate a new seed just for Banano NFTs.</p>
<p class="mb-2">Something not going quite right? Check out our hopefully helpful <a class="link" href="/help/minting">help page</a>. We recommend you run this locally for security reasons. Please generate a new, fresh, seed for minting Banano NFTs.</p>
{#if mintSuccess}
<div class="alert alert-success">
<svg xmlns="http://www.w3.org/2000/svg" class="stroke-current shrink-0 h-6 w-6" fill="none" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
Expand Down

0 comments on commit 89236be

Please sign in to comment.