|
| 1 | +import * as S from "@chakra-ui/react"; |
1 | 2 | import { Box, Flex, Text } from "@chakra-ui/react";
|
2 | 3 | import React from "react";
|
| 4 | +import { Link } from "react-router-dom"; |
| 5 | +import Logo from "../../assets/favicon.svg"; |
3 | 6 | import DashboardSideBar from "./DashboardSideBar";
|
4 | 7 | import Profile from "./profile/Profile";
|
5 | 8 | import UserPost from "./user-post/UserPost";
|
6 | 9 |
|
7 | 10 | const DashboardHome = ({ routing, user }) => {
|
8 | 11 | return (
|
9 |
| - <Flex flexDir="column" pt="2rem" px="6rem" w="100vw"> |
10 |
| - <Flex justifyContent="flex-start" alignItems="center"> |
11 |
| - {user.params.name === "user" && ( |
| 12 | + <Flex justifyContent="center" w="100vw"> |
| 13 | + <Flex w="calc(50vw - 350px)" h="100vh" justifyContent="flex-end"> |
| 14 | + <Flex flexDir="column" w="15rem" pt="1rem"> |
| 15 | + <S.Flex justifyContent="flex-start" alignItems="center"> |
| 16 | + <Link to="/"> |
| 17 | + <div> |
| 18 | + <S.Image src={Logo} alt="devhelp" /> |
| 19 | + </div> |
| 20 | + </Link> |
| 21 | + <S.Text ml="1rem">Devhelp</S.Text> |
| 22 | + </S.Flex> |
| 23 | + <S.Flex flexDirection="column" pt="5"> |
| 24 | + <S.Box mb="1rem" fontSize="20"> |
| 25 | + <Link to="/dashboard/home">Home</Link> |
| 26 | + </S.Box> |
| 27 | + <S.Box mb="1rem" fontSize="20"> |
| 28 | + <Link to="/dashboard/saved">Saved Posts</Link> |
| 29 | + </S.Box> |
| 30 | + <S.Box mb="1rem" fontSize="20"> |
| 31 | + <Link to="!#">Posts</Link> |
| 32 | + </S.Box> |
| 33 | + <S.Box mb="1rem" fontSize="20"> |
| 34 | + <Link to="!#">Stats</Link> |
| 35 | + </S.Box> |
| 36 | + <S.Box mb="1rem" fontSize="20"> |
| 37 | + <Link to="!#">Plans</Link> |
| 38 | + </S.Box> |
| 39 | + <S.Box mb="1rem" fontSize="20"> |
| 40 | + <Link to="!#">Help</Link> |
| 41 | + </S.Box> |
| 42 | + <S.Box mb="1rem" fontSize="20"> |
| 43 | + <Link to="/">Logout</Link> |
| 44 | + </S.Box> |
| 45 | + </S.Flex> |
| 46 | + </Flex> |
| 47 | + </Flex> |
| 48 | + <Flex |
| 49 | + borderX="1px solid #a6a6a680" |
| 50 | + px="0rem" |
| 51 | + h="100vh" |
| 52 | + flexDir="column" |
| 53 | + w="700px" |
| 54 | + pt="1rem" |
| 55 | + > |
| 56 | + <Flex |
| 57 | + justifyContent="flex-start" |
| 58 | + alignItems="center" |
| 59 | + borderBottom="1px solid #a6a6a680" |
| 60 | + > |
| 61 | + {user.params.name === "user" && ( |
| 62 | + <Box> |
| 63 | + <DashboardSideBar /> |
| 64 | + </Box> |
| 65 | + )} |
12 | 66 | <Box>
|
13 |
| - <DashboardSideBar /> |
| 67 | + <Text ml="1rem" fontSize="25px" fontWeight="600" mb="1rem"> |
| 68 | + {user.params.name === "user" |
| 69 | + ? "Dashboard" |
| 70 | + : `${user.params.name}'s Profile`} |
| 71 | + </Text> |
14 | 72 | </Box>
|
15 |
| - )} |
16 |
| - <Box> |
17 |
| - <Text fontSize="25px" fontWeight="600"> |
18 |
| - {user.params.name === "user" |
19 |
| - ? "Dashboard" |
20 |
| - : `${user.params.name}'s Profile`} |
21 |
| - </Text> |
22 |
| - </Box> |
| 73 | + </Flex> |
| 74 | + <Profile user={user.params} /> |
| 75 | + <UserPost routing={routing} /> |
23 | 76 | </Flex>
|
24 |
| - <Profile user={user.params} /> |
25 |
| - <UserPost routing={routing} /> |
| 77 | + <Flex w="calc(50vw - 350px)" h="100vh"></Flex> |
26 | 78 | </Flex>
|
27 | 79 | );
|
28 | 80 | };
|
|
0 commit comments