Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add aditional links #4

Open
wants to merge 1 commit into
base: production
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/components/common/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const footerPages = [
AppRoutes.terms,
AppRoutes.licenses,
]

const FooterLink = ({ children, href }: { children: ReactNode; href: string }): ReactElement => {
return href ? (
<Link href={href} passHref legacyBehavior>
Expand All @@ -27,12 +28,14 @@ const FooterLink = ({ children, href }: { children: ReactNode; href: string }):
<MUILink>{children}</MUILink>
)
}

const Footer = (): ReactElement | null => {
const router = useRouter()

if (!footerPages.some((path) => router.pathname.startsWith(path))) {
return null
}

const getHref = (path: string): string => {
return router.pathname === path ? '' : path
}
Expand All @@ -49,12 +52,24 @@ const Footer = (): ReactElement | null => {
<li>
<FooterLink href={getHref(AppRoutes.settings.index)}>Preferences</FooterLink>
</li>

<li>
<ExternalLink href={HELP_CENTER_URL} noIcon sx={{ span: { textDecoration: 'underline' } }}>
Help
</ExternalLink>
</li>
{/* Additional links */}
<li>
<FooterLink href="https://x.com/chilizx">X</FooterLink>
</li>
<li>
<FooterLink href="https://www.chiliz.com/">Website</FooterLink>
</li>
<li>
<FooterLink href="https://discord.com/invite/chiliz-official-server-841972703651954688">Discord</FooterLink>
</li>
<li>
<FooterLink href="https://docs.chiliz.com/">Docs</FooterLink>
</li>
<li>
<Typography variant="caption">
Supported by{' '}
Expand Down