-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTopBar.js
88 lines (75 loc) · 1.99 KB
/
TopBar.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/* eslint-disable no-undef */
import React from "react";
import styled from "styled-components";
import TopButton from "../TopButton";
import Logo from "../Logo";
import Search from "../Search";
import { Link, useLocation } from "react-router-dom";
import ButtonPDF from'../ButtonPdf/ButtonPDF';
import { useEffect } from "react";
const TopBar = () => {
const { pathname } = useLocation();
const currentPath = pathname.substring(1);
return (
<Container>
<Logo />
<LinkStyled
children="Principal"
to="/"
className={currentPath === "" && "active"}
/>
<LinkStyled
children="O instituto"
to="/sobre"
className={currentPath === "sobre" && "active"}
/>
<LinkStyled
children="Atendimento"
to="/atendimento"
className={currentPath === "atendimento" && "active"}
/>
<LinkStyled
children="Como ajudar?"
to="/como-ajudar"
className={currentPath === "como-ajudar" && "active"}
/>
<LinkStyled
children="Fique por dentro"
to="/fique-por-dentro"
className={currentPath === "fique-por-dentro" && "active"}
/>
<LinkStyled
children="Rádio Sonhar"
to="/radio"
className={currentPath === "fique-por-dentro" && "active"}
/>
<TopButton title="Doe" to="/como-ajudar"></TopButton>
<ButtonPDF title="Doações" href="Transparência-ÉPossívelSonhar.pdf" > </ButtonPDF>
</Container>
);
};
const Container = styled.div`
max-width: 100%;
height: 158px;
display: flex;
margin: 0;
align-items: center;
justify-content: center;
overflow-x: overlay;
`;
const LinkStyled = styled(Link)`
text-decoration: none !important;
color: #000000;
margin-right: 12px;
margin-left: 12px;
font-size: 16px;
font-family: Lato, Regular;
vertical-align: middle;
&:hover {
color: #ff0040;
}
&.active {
color: #ff0040;
}
`;
export default TopBar;