Skip to content

Commit

Permalink
add calculator to top nav
Browse files Browse the repository at this point in the history
  • Loading branch information
saml33 committed Aug 19, 2024
1 parent c5873c1 commit a7df4f3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
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
6 changes: 5 additions & 1 deletion 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
2 changes: 1 addition & 1 deletion pages/yield-calculator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from 'next/link'

const YieldCalc: NextPage = () => {
return (
<div className="mx-auto w-full max-w-5xl py-12">
<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
Expand Down

0 comments on commit a7df4f3

Please sign in to comment.