-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbottomNav.jsx
78 lines (67 loc) · 1.66 KB
/
bottomNav.jsx
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
import React, {useContext} from 'react';
import styled from 'styled-components'
import { IoIosHome, IoIosRefresh, IoIosSearch } from "react-icons/io";
import { TiHome } from "react-icons/ti";
import { WeatherContext } from '../lib/weather';
import Link from 'next/link';
const NavContainer= styled.nav`
z-index: 1;
bottom: 0;
position: fixed;
width: 100vw;
background-color: ${props => props.theme.theme.bg.secondary};
display: grid;
grid-template-columns: 1fr 1fr 1fr;
justify-items: center;
align-items: center;
padding: 15px 0;
/* border-top: 2px solid ${props => props.theme.theme.bg.primary}; */
box-shadow: 0 1px 7px 0px rgba(0,0,0,0.1);
`
const NavItem = styled.div`
display: flex;
font-size: 20px;
color: ${props => props.theme.theme.text.quarternary};
&:hover{
cursor: pointer;
}
a{
color: ${props => props.theme.theme.text.quarternary};
display: grid;
grid-template-columns: 1fr;
align-items: center;
justify-items: center;
grid-gap: 3px;
text-decoration: none;
span{
font-size: 0.8rem;
}
}
`
const BottomNav = () => {
const weather = useContext(WeatherContext)
const { updateWeather } = weather
return(
<NavContainer>
<NavItem>
<Link href='/'>
<a>
{/* <IoIosHome /> */}
<TiHome />
</a>
</Link>
</NavItem>
<NavItem onClick={updateWeather}>
<IoIosRefresh />
</NavItem>
<NavItem>
<Link href='/search'>
<a>
<IoIosSearch />
</a>
</Link>
</NavItem>
</NavContainer>
)
}
export default BottomNav