-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(components/Footer): add condition to render link to doubts page
- Loading branch information
1 parent
cd0d845
commit 7c4fdce
Showing
1 changed file
with
38 additions
and
31 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
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> | ||
); | ||
}; |