Skip to content

Commit 95766e0

Browse files
committed
Chore: Update header link components
1 parent b1da462 commit 95766e0

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

src/components/Dropdown/Dropdown.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Wrapper,
77
} from "./Dropdown.styles";
88
import { Icon } from "../Icon/Icon";
9+
import Link from "next/link";
910

1011
export const Dropdown = ({ item }: { item: ISection }) => {
1112
const { name, path, children } = item;
@@ -14,7 +15,7 @@ export const Dropdown = ({ item }: { item: ISection }) => {
1415
return (
1516
<NavItem>
1617
<ItemContent>
17-
<a href={path}>{name}</a>
18+
{path ? <Link href={path}>{name}</Link> : <span>{name}</span>}
1819
</ItemContent>
1920
</NavItem>
2021
);
@@ -23,7 +24,7 @@ export const Dropdown = ({ item }: { item: ISection }) => {
2324
return (
2425
<NavItem>
2526
<ItemContent>
26-
<a href={path}>{name}</a>
27+
{path ? <Link href={path}>{name}</Link> : <span>{name}</span>}
2728
<Icon id="arrow-head" width={11} height={9} />
2829
</ItemContent>
2930
{children && (

src/components/Footer/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Footer = () => {
1616
<LogoImage id="logo-oca-white" width={200} height={150} />
1717
<References>
1818
{Object.entries(sections).map(([key, item]) => (
19-
<Sections key={key} href={item.path}>
19+
<Sections key={key} href={item.path || ""}>
2020
{item.name}
2121
</Sections>
2222
))}

src/components/Header/Header.styles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import styled from "styled-components";
22
import { Icon } from "../Icon/Icon";
3+
import Link from "next/link";
34

45
export const Wrapper = styled.div`
56
display: flex;
@@ -70,7 +71,7 @@ export const SocialMedia = styled.div`
7071
pointer-events: all;
7172
`;
7273

73-
export const MediaWrapper = styled.a`
74+
export const MediaWrapper = styled(Link)`
7475
display: flex;
7576
align-items: center;
7677
color: ${({ theme }) => theme.colors.black}90;

src/utils/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export const sections: ISections = {
4545
},
4646
about: {
4747
name: "Sobre nós",
48-
path: "/about",
4948
children: {
5049
team: {
5150
name: "Nosso time",

src/utils/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface IOCAChannel {
3232

3333
export interface ISection {
3434
name: string;
35-
path: string;
35+
path?: string;
3636
children?: { [key: string]: ISection };
3737
}
3838

0 commit comments

Comments
 (0)