Skip to content

Commit 7c4fdce

Browse files
committed
fix(components/Footer): add condition to render link to doubts page
1 parent cd0d845 commit 7c4fdce

File tree

1 file changed

+38
-31
lines changed

1 file changed

+38
-31
lines changed

src/components/Footer/index.tsx

+38-31
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,45 @@
11
import Link from 'next/link';
2+
import { usePathname } from 'next/navigation';
23
import { Logo } from '../Logo';
34
import { Typography } from '../Typography';
45
import { SocialShareButtons } from './SocialShareButtons';
56
import * as S from './styles';
67

7-
export const Footer = () => (
8-
<S.FooterWrapper>
9-
<S.FooterContainer>
10-
<Link href="/">
11-
<Logo width={65} height={94} />
12-
</Link>
13-
<S.FooterContent>
14-
<Typography variant="body1" weight="700">
15-
Estartando Devs
8+
export const Footer = () => {
9+
const pathName = usePathname();
10+
11+
return (
12+
<S.FooterWrapper>
13+
<S.FooterContainer>
14+
<Link href="/">
15+
<Logo width={65} height={94} />
16+
</Link>
17+
<S.FooterContent>
18+
<Typography variant="body1" weight="700">
19+
Estartando Devs
20+
</Typography>
21+
<SocialShareButtons />
22+
</S.FooterContent>
23+
</S.FooterContainer>
24+
{!pathName.includes('/perguntas-frequentes') && (
25+
<S.DoubtsLinkWrapper>
26+
<Typography variant="body3">{`Dúvidas? Veja as`}</Typography>
27+
<S.DoubtsLink>
28+
<Link
29+
href="/perguntas-frequentes"
30+
legacyBehavior
31+
>{`perguntas mais frequentes`}</Link>
32+
</S.DoubtsLink>
33+
</S.DoubtsLinkWrapper>
34+
)}
35+
<S.CopyContainer>
36+
<Typography variant="body3" weight="400">
37+
{`© Estartando Devs ${new Date().getFullYear()}`}
1638
</Typography>
17-
<SocialShareButtons />
18-
</S.FooterContent>
19-
</S.FooterContainer>
20-
<S.DoubtsLinkWrapper>
21-
<Typography variant="body3">{`Dúvidas? Veja as`}</Typography>
22-
<S.DoubtsLink>
23-
<Link
24-
href="/perguntas-frequentes"
25-
legacyBehavior
26-
>{`perguntas mais frequentes`}</Link>
27-
</S.DoubtsLink>
28-
</S.DoubtsLinkWrapper>
29-
<S.CopyContainer>
30-
<Typography variant="body3" weight="400">
31-
{`© Estartando Devs ${new Date().getFullYear()}`}
32-
</Typography>
33-
<S.CopyText variant="body3" weight="400">
34-
Todos os direitos reservados.
35-
</S.CopyText>
36-
</S.CopyContainer>
37-
</S.FooterWrapper>
38-
);
39+
<S.CopyText variant="body3" weight="400">
40+
Todos os direitos reservados.
41+
</S.CopyText>
42+
</S.CopyContainer>
43+
</S.FooterWrapper>
44+
);
45+
};

0 commit comments

Comments
 (0)