2022-07-13 13:56:36 +00:00
|
|
|
import clsx from 'clsx'
|
|
|
|
import { Anchor } from 'components/Anchor'
|
|
|
|
import { useWallet } from 'contexts/wallet'
|
|
|
|
import { useRouter } from 'next/router'
|
2022-07-19 07:53:03 +00:00
|
|
|
// import BrandText from 'public/brand/brand-text.svg'
|
2022-07-25 08:29:52 +00:00
|
|
|
import { footerLinks, socialsLinks } from 'utils/links'
|
2022-07-13 13:56:36 +00:00
|
|
|
|
|
|
|
import { SidebarLayout } from './SidebarLayout'
|
|
|
|
import { WalletLoader } from './WalletLoader'
|
|
|
|
|
|
|
|
const routes = [
|
2022-07-25 08:29:52 +00:00
|
|
|
{ text: 'Create Collection', href: `/collections/` },
|
|
|
|
{ text: 'Collections', href: `/collections` },
|
2022-07-19 07:53:03 +00:00
|
|
|
{ text: 'Contract Dashboards', href: `/contracts/` },
|
2022-07-13 13:56:36 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
export const Sidebar = () => {
|
|
|
|
const router = useRouter()
|
|
|
|
const wallet = useWallet()
|
|
|
|
|
|
|
|
return (
|
|
|
|
<SidebarLayout>
|
|
|
|
{/* Stargaze brand as home button */}
|
|
|
|
<Anchor href="/" onContextMenu={(e) => [e.preventDefault(), router.push('/brand')]}>
|
2022-07-19 07:53:03 +00:00
|
|
|
<div
|
|
|
|
className={clsx(
|
|
|
|
'flex relative justify-center items-center mx-8 mt-2 space-y-4 w-1/2 h-16',
|
|
|
|
'rounded border-2 border-white/20 border-dashed',
|
|
|
|
)}
|
|
|
|
>
|
|
|
|
Home{/* <BrandText className="text-plumbus hover:text-plumbus-light transition" /> */}
|
|
|
|
</div>
|
2022-07-13 13:56:36 +00:00
|
|
|
</Anchor>
|
|
|
|
|
|
|
|
{/* wallet button */}
|
|
|
|
<WalletLoader />
|
|
|
|
|
|
|
|
{/* main navigation routes */}
|
|
|
|
{routes.map(({ text, href }) => (
|
|
|
|
<Anchor
|
|
|
|
key={href}
|
|
|
|
className={clsx(
|
|
|
|
'py-2 px-4 -mx-4 uppercase', // styling
|
|
|
|
'hover:bg-white/5 transition-colors', // hover styling
|
|
|
|
{ 'font-bold text-plumbus': router.asPath.startsWith(href) }, // active route styling
|
|
|
|
// { 'text-gray-500 pointer-events-none': disabled }, // disabled route styling
|
|
|
|
)}
|
|
|
|
href={href}
|
|
|
|
>
|
|
|
|
{text}
|
|
|
|
</Anchor>
|
|
|
|
))}
|
|
|
|
|
|
|
|
<div className="flex-grow" />
|
|
|
|
|
|
|
|
{/* Stargaze network status */}
|
2022-07-25 08:29:52 +00:00
|
|
|
<div className="text-sm capitalize">Network: {wallet.network}</div>
|
2022-07-13 13:56:36 +00:00
|
|
|
|
|
|
|
{/* footer reference links */}
|
|
|
|
<ul className="text-sm list-disc list-inside">
|
|
|
|
{footerLinks.map(({ href, text }) => (
|
|
|
|
<li key={href}>
|
|
|
|
<Anchor className="hover:text-plumbus hover:underline" href={href}>
|
|
|
|
{text}
|
|
|
|
</Anchor>
|
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
{/* footer attribution */}
|
2022-07-25 08:29:52 +00:00
|
|
|
<div className="text-xs text-white/50">Stargaze Studio {process.env.APP_VERSION}</div>
|
2022-07-13 13:56:36 +00:00
|
|
|
|
|
|
|
{/* footer social links */}
|
|
|
|
<div className="flex gap-x-6 items-center text-white/75">
|
|
|
|
{socialsLinks.map(({ Icon, href, text }) => (
|
|
|
|
<Anchor key={href} className="hover:text-plumbus" href={href}>
|
|
|
|
<Icon aria-label={text} size={20} />
|
|
|
|
</Anchor>
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
</SidebarLayout>
|
|
|
|
)
|
|
|
|
}
|