-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #764 from hemilabs/ad_menustaking
Add base files and menu for staking campaign
- Loading branch information
Showing
15 changed files
with
200 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use client' | ||
|
||
import { featureFlags } from 'app/featureFlags' | ||
import { PageTitle } from 'components/pageTitle' | ||
import { useTranslations } from 'next-intl' | ||
|
||
const Page = function () { | ||
const t = useTranslations('stake-page') | ||
|
||
if (!featureFlags.stakeCampaignEnabled) return null | ||
|
||
return ( | ||
<div className="h-fit-rest-screen"> | ||
<PageTitle | ||
subtitle={t('dashboard.subtitle')} | ||
title={t('dashboard.title')} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { StakeTabs } from 'components/stakeTabs' | ||
|
||
type Props = { | ||
children: React.ReactNode | ||
} | ||
|
||
const Layout = ({ children }: Props) => ( | ||
<> | ||
<div className="mb-4 mt-5 md:hidden"> | ||
<StakeTabs /> | ||
</div> | ||
{children} | ||
</> | ||
) | ||
|
||
export default Layout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use client' | ||
|
||
import { featureFlags } from 'app/featureFlags' | ||
import { PageTitle } from 'components/pageTitle' | ||
import { useTranslations } from 'next-intl' | ||
|
||
const Stake = function () { | ||
const t = useTranslations('stake-page') | ||
|
||
if (!featureFlags.stakeCampaignEnabled) return null | ||
|
||
return ( | ||
<div className="h-fit-rest-screen"> | ||
<PageTitle subtitle={t('stake.subtitle')} title={t('stake.title')} /> | ||
</div> | ||
) | ||
} | ||
|
||
export default function Page() { | ||
return <Stake /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { LocalePageRedirect } from 'components/localePageRedirect' | ||
|
||
const Page = () => <LocalePageRedirect redirectPage="/stake/dashboard" /> | ||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { ComponentProps } from 'react' | ||
|
||
export const StakeIcon = (props: ComponentProps<'svg'>) => ( | ||
<svg | ||
fill="none" | ||
height="14" | ||
width="14" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<path | ||
clipRule="evenodd" | ||
d="m3.674 2.448-.086.002a1.575 1.575 0 0 1 1.486-1.052h3.85A1.576 1.576 0 0 1 10.41 2.45c-.028-.002-.057-.002-.086-.002h-6.65ZM1.161 6.06a1.575 1.575 0 0 0-.462 1.113v3.85a1.575 1.575 0 0 0 1.575 1.575h9.45a1.573 1.573 0 0 0 1.575-1.575v-3.85a1.574 1.574 0 0 0-1.575-1.575h-9.45c-.417 0-.818.166-1.113.462Zm1.027-1.51c.029-.002.058-.002.086-.002h9.45c.029 0 .058 0 .086.002a1.577 1.577 0 0 0-1.486-1.052h-6.65A1.575 1.575 0 0 0 2.188 4.55Zm5.038 2.592a.243.243 0 0 0-.36.11L6.409 8.35l-1.186.095a.243.243 0 0 0-.138.427l.903.773-.275 1.158a.243.243 0 0 0 .362.263l1.015-.62 1.016.62a.243.243 0 0 0 .363-.264l-.276-1.157.903-.774a.243.243 0 0 0-.138-.426L7.77 8.35 7.315 7.25a.243.243 0 0 0-.09-.109Z" | ||
fill="#A3A3A3" | ||
fillRule="evenodd" | ||
/> | ||
</svg> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
'use client' | ||
|
||
import { featureFlags } from 'app/featureFlags' | ||
import { Tab, Tabs } from 'components/tabs' | ||
import { usePathname } from 'next/navigation' | ||
import { useLocale, useTranslations } from 'next-intl' | ||
import { Suspense } from 'react' | ||
|
||
const StakeTabsImpl = function () { | ||
const locale = useLocale() | ||
const pathname = usePathname() | ||
const t = useTranslations('stake-page') | ||
|
||
if ( | ||
!pathname.startsWith(`/${locale}/stake/`) || | ||
!featureFlags.stakeCampaignEnabled | ||
) { | ||
return null | ||
} | ||
|
||
const isInDashboard = pathname === `/${locale}/stake/dashboard/` | ||
const isInStake = pathname === `/${locale}/stake/` | ||
|
||
return ( | ||
<div className="flex items-center justify-center gap-x-4"> | ||
<Tabs> | ||
<Tab href="/stake/dashboard" selected={isInDashboard}> | ||
<div className="flex items-center justify-between gap-x-2"> | ||
<span>{t('dashboard.title')}</span> | ||
</div> | ||
</Tab> | ||
<Tab href="/stake" selected={isInStake}> | ||
<span className="flex h-full min-h-7 items-center"> | ||
{t('stake.title')} | ||
</span> | ||
</Tab> | ||
</Tabs> | ||
</div> | ||
) | ||
} | ||
|
||
export const StakeTabs = () => ( | ||
<Suspense> | ||
<StakeTabsImpl /> | ||
</Suspense> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters