Skip to content

Commit 39ee88e

Browse files
restyled navbar
1 parent bb95f80 commit 39ee88e

File tree

8 files changed

+54
-556
lines changed

8 files changed

+54
-556
lines changed

client/src/components/layout components/Trending/Trending.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Flex } from "@chakra-ui/react";
12
import React, { useState, useEffect, Fragment } from "react";
23
import { connect } from "react-redux";
34
import { getTrendingPosts } from "../../../actions/trendingAction";
@@ -34,7 +35,7 @@ const Trending = ({
3435
}, [trendingPosts.length, post.uploadedStatus]);
3536

3637
return (
37-
<div className="container trending d-flex justify-content-around">
38+
<Flex>
3839
{posts.length > 0 ? (
3940
posts.map((post) => (
4041
<TrendingItem
@@ -53,7 +54,7 @@ const Trending = ({
5354
<TrendingItem />
5455
</Fragment>
5556
)}
56-
</div>
57+
</Flex>
5758
);
5859
};
5960

client/src/components/navbar/Navbar.js

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,17 @@ import { cleanProfile } from "../../actions/profileAction";
77
import { logout } from "../../actions/authAction";
88
import { loadProfile } from "../../actions/profileAction";
99
import isEmpty from "../../utils/isEmpty";
10-
import { motion } from "framer-motion";
1110
import { initDropAnim, resetDropAnim } from "../../actions/framerAction";
11+
import {
12+
Box,
13+
Button,
14+
Flex,
15+
HStack,
16+
Image,
17+
ListItem,
18+
Text,
19+
UnorderedList,
20+
} from "@chakra-ui/react";
1221

1322
const Navbar = ({
1423
navbar,
@@ -53,57 +62,55 @@ const Navbar = ({
5362
};
5463

5564
return navbar ? (
56-
<div className="container nav-container">
57-
<div ref={dropCloser} className="drop-closer" onClick={closeDrop}></div>
58-
<nav className="navbar navbar-expand-lg navbar-light bg-light bd-navbar d-flex justify-content-between">
59-
<Link className="navbar-brand" to="/">
60-
DevHelp
65+
<Flex height="80px" alignItems="center" px="50px">
66+
<Box ref={dropCloser} onClick={closeDrop}></Box>
67+
<Flex w="100vw" justifyContent="space-between" alignItems="center">
68+
<Link to="/">
69+
<Text fontSize="18px">DevHelp</Text>
6170
</Link>
62-
<div className="utils d-flex align-items-center">
63-
<div className="icons">
64-
<span>
71+
<Flex justifyContent="center" alignItems="center">
72+
<Flex justifyContent="center" alignItems="center">
73+
<Box ml="20px">
6574
<i className="fas fa-search"></i>
66-
</span>
67-
<span>
75+
</Box>
76+
<Box ml="20px">
6877
<i className="far fa-bookmark"></i>
69-
</span>
70-
</div>
71-
<div className="upgrade">
72-
<button className="btn btn-outline-secondary">Upgrade</button>
73-
</div>
74-
<div className="user-icon" onClick={openDropDown}>
75-
<div className="img">
78+
</Box>
79+
</Flex>
80+
<Box ml="20px">
81+
<Button variant="outline" h="30px">
82+
Upgrade
83+
</Button>
84+
</Box>
85+
<Box onClick={openDropDown} ml="20px">
86+
<Box>
7687
{profile.profile.image && (
77-
<img
88+
<Image
89+
boxSize="40px"
90+
borderRadius="100%"
7891
src={profile.profile.image ? profile.profile.image : ""}
7992
alt="User profile image"
8093
/>
8194
)}
82-
</div>
83-
<motion.ul
84-
animate={{ scale: framerAnim.dropDown.scale }}
85-
transition={{
86-
duration: framerAnim.dropDown.duration,
87-
ease: "easeIn",
88-
}}
89-
ref={dropDown}
90-
className="drop-down-container flex-column text-center"
91-
>
92-
<li>{!isAuthenticated && <Link to="/login">Login</Link>}</li>
93-
<li>
95+
</Box>
96+
<UnorderedList ref={dropDown} listStyleType="none" display="none">
97+
<ListItem>
98+
{!isAuthenticated && <Link to="/login">Login</Link>}
99+
</ListItem>
100+
<ListItem>
94101
<Link to="/dashboard/home">Dashboard</Link>
95-
</li>
96-
<li>
102+
</ListItem>
103+
<ListItem>
97104
<Link to="/compose-post">Compose Post</Link>
98-
</li>
99-
<li onClick={logMeOut}>
105+
</ListItem>
106+
<ListItem onClick={logMeOut}>
100107
<Link to="/">Logout</Link>
101-
</li>
102-
</motion.ul>
103-
</div>
104-
</div>
105-
</nav>
106-
</div>
108+
</ListItem>
109+
</UnorderedList>
110+
</Box>
111+
</Flex>
112+
</Flex>
113+
</Flex>
107114
) : (
108115
<div></div>
109116
);

client/src/components/navbar/_navbar.scss

Lines changed: 0 additions & 110 deletions
This file was deleted.

client/src/components/pages/Home.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ import { showNav } from "../../actions/navAction";
44
import { clearPost } from "../../actions/getPostAction";
55
import Trending from "../layout components/Trending/Trending";
66
import PopularPosts from "../layout components/General posts/PopularPosts";
7+
import { Box, Flex } from "@chakra-ui/react";
78

89
const Home = ({ showNav, clearPost, history }) => {
910
useEffect(() => {
1011
showNav();
1112
clearPost();
12-
console.log("Hey I load everytime");
1313
// eslint-disable-next-line
1414
}, []);
1515
return (
16-
<div className="home d-flex flex-column">
16+
<Flex w="100vw" flexDirection="column">
1717
<Trending routing={history} />
1818
<PopularPosts />
19-
</div>
19+
</Flex>
2020
);
2121
};
2222

client/src/components/pages/_activitylist.scss

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)