Skip to content

Commit

Permalink
fix(components/Footer): add condition to render link to doubts page
Browse files Browse the repository at this point in the history
  • Loading branch information
jonataspinto committed Mar 8, 2024
1 parent cd0d845 commit 7c4fdce
Showing 1 changed file with 38 additions and 31 deletions.
69 changes: 38 additions & 31 deletions src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,45 @@
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { Logo } from '../Logo';
import { Typography } from '../Typography';
import { SocialShareButtons } from './SocialShareButtons';
import * as S from './styles';

export const Footer = () => (
<S.FooterWrapper>
<S.FooterContainer>
<Link href="/">
<Logo width={65} height={94} />
</Link>
<S.FooterContent>
<Typography variant="body1" weight="700">
Estartando Devs
export const Footer = () => {
const pathName = usePathname();

return (
<S.FooterWrapper>
<S.FooterContainer>
<Link href="/">
<Logo width={65} height={94} />
</Link>
<S.FooterContent>
<Typography variant="body1" weight="700">
Estartando Devs
</Typography>
<SocialShareButtons />
</S.FooterContent>
</S.FooterContainer>
{!pathName.includes('/perguntas-frequentes') && (
<S.DoubtsLinkWrapper>
<Typography variant="body3">{`Dúvidas? Veja as`}</Typography>
<S.DoubtsLink>
<Link
href="/perguntas-frequentes"
legacyBehavior
>{`perguntas mais frequentes`}</Link>
</S.DoubtsLink>
</S.DoubtsLinkWrapper>
)}
<S.CopyContainer>
<Typography variant="body3" weight="400">
{`© Estartando Devs ${new Date().getFullYear()}`}
</Typography>
<SocialShareButtons />
</S.FooterContent>
</S.FooterContainer>
<S.DoubtsLinkWrapper>
<Typography variant="body3">{`Dúvidas? Veja as`}</Typography>
<S.DoubtsLink>
<Link
href="/perguntas-frequentes"
legacyBehavior
>{`perguntas mais frequentes`}</Link>
</S.DoubtsLink>
</S.DoubtsLinkWrapper>
<S.CopyContainer>
<Typography variant="body3" weight="400">
{`© Estartando Devs ${new Date().getFullYear()}`}
</Typography>
<S.CopyText variant="body3" weight="400">
Todos os direitos reservados.
</S.CopyText>
</S.CopyContainer>
</S.FooterWrapper>
);
<S.CopyText variant="body3" weight="400">
Todos os direitos reservados.
</S.CopyText>
</S.CopyContainer>
</S.FooterWrapper>
);
};

0 comments on commit 7c4fdce

Please sign in to comment.