Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
abrzezinski94 committed Aug 27, 2024
2 parents c7e5faf + a7df4f3 commit 48bc460
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 9 deletions.
2 changes: 1 addition & 1 deletion components/DepositForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ function DespositForm({ token: selectedToken, clientContext }: StakeFormProps) {
})}
</div>
) : ipAllowed ? (
`Boost! ${inputAmount} ${formatTokenSymbol(selectedToken)}`
`Add ${inputAmount} ${formatTokenSymbol(selectedToken)}`
) : (
'Country not allowed'
)}
Expand Down
6 changes: 6 additions & 0 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ const Footer = () => {
>
Stats
</Link>
<Link
className="block text-th-fgd-1 md:hover:text-th-fgd-3"
href="/yield-calculator"
>
Yield calculator
</Link>
</div>
<div className="col-span-4 space-y-3 md:col-span-1">
<h4>Important Info</h4>
Expand Down
12 changes: 10 additions & 2 deletions components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ const Layout = ({ children }: { children: ReactNode }) => {
const { asPath } = useRouter()

const isDashboardLayout = useMemo(() => {
return asPath === '/dashboard' || asPath === '/stats'
return (
asPath === '/dashboard' ||
asPath === '/stats' ||
asPath === '/yield-calculator'
)
}, [asPath])

const [mounted, setMounted] = useState(false)
Expand All @@ -48,7 +52,11 @@ const Layout = ({ children }: { children: ReactNode }) => {
{isDashboardLayout ? (
<>
<TopBar />
<div className="mx-auto max-w-3xl px-6 pb-20 md:pb-12 lg:px-12">
<div
className={`mx-auto ${
asPath !== '/yield-calculator' ? 'max-w-3xl' : ''
} px-6 pb-20 md:pb-12 lg:px-12`}
>
{children}
</div>
</>
Expand Down
2 changes: 1 addition & 1 deletion components/Stake.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const Stake = () => {
>
<div className="mb-4 flex items-center justify-between">
<div className="h-10 w-10" />
<h2>Select token to Boost!</h2>
<h2>Select token to add</h2>
<IconButton
onClick={() => setShowTokenSelect(false)}
hideBg
Expand Down
22 changes: 17 additions & 5 deletions components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ const TopBar = () => {
path="/stats"
text="Stats"
/>
{/* <NavLink active={pathname === '/faqs'} path="/faqs" text="FAQs" /> */}
<NavLink
active={pathname === '/yield-calculator'}
path="/yield-calculator"
text="Calculator"
/>
</>
) : null}
</div>
Expand Down Expand Up @@ -113,7 +117,7 @@ const MenuPanel = ({
return (
<>
<div
className={`fixed right-0 top-0 z-40 h-screen w-[97%] overflow-hidden bg-th-bkg-2 transition duration-300 ease-in-out ${
className={`fixed right-0 top-0 z-40 h-screen w-[97%] overflow-hidden bg-th-primary-1 transition duration-300 ease-in-out ${
showMenu ? 'translate-x-0' : 'translate-x-full'
}`}
>
Expand All @@ -130,7 +134,15 @@ const MenuPanel = ({
onClick={closeOnClick}
shallow
>
Boost!
Home
</Link>
<Link
className="block text-xl font-bold text-th-fgd-1"
href="/dashboard"
onClick={closeOnClick}
shallow
>
Dashboard
</Link>
<Link
className="block text-xl font-bold text-th-fgd-1"
Expand All @@ -142,11 +154,11 @@ const MenuPanel = ({
</Link>
<Link
className="block text-xl font-bold text-th-fgd-1"
href="/faqs"
href="/yield-calculator"
onClick={closeOnClick}
shallow
>
FAQs
Yield calculator
</Link>
</div>
</div>
Expand Down
32 changes: 32 additions & 0 deletions pages/yield-calculator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import YieldCalculator from '@components/home/YieldCalculator'
import { NextPage } from 'next'
import Link from 'next/link'

const YieldCalc: NextPage = () => {
return (
<div className="mx-auto w-full max-w-5xl">
<div className="px-6">
<h2 className="text-shadow mb-2 px-6 text-center text-3xl text-th-button-text md:text-5xl xl:px-0">
Yield calculator
</h2>
<p className="mb-6 text-center text-base text-th-fgd-2">
Compare native liquid staking yields with Yield Fan to see the extra
returns you could earn.
</p>
</div>
<YieldCalculator />
<div className="mx-auto max-w-3xl px-6 pt-6">
<p className="text-center text-sm text-th-fgd-4">
This calculator is for educational purposes only. It assumes rates and
prices remain constant over time. Take the time to understand the{' '}
<Link className="underline md:hover:no-underline" href="/risks">
risks
</Link>{' '}
before depositing any funds.
</p>
</div>
</div>
)
}

export default YieldCalc

0 comments on commit 48bc460

Please sign in to comment.