l-min-components 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +38 -0
- package/src/assets/Icon.svg +3 -0
- package/src/assets/friendrequest.png +0 -0
- package/src/assets/images/User-avatar.svg.png +0 -0
- package/src/assets/images/Vector19.png +0 -0
- package/src/assets/images/android.png +0 -0
- package/src/assets/images/avatar.png +0 -0
- package/src/assets/images/banner.png +0 -0
- package/src/assets/images/dashboardImage.png +0 -0
- package/src/assets/images/figma.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/logo.png +0 -0
- package/src/assets/images/onboarding.png +0 -0
- package/src/assets/images/sign_up.png +0 -0
- package/src/assets/react.svg +1 -0
- package/src/assets/svg/Frame 4534413.svg +7 -0
- package/src/assets/svg/Property 44.svg +5 -0
- package/src/assets/svg/Property 55.svg +10 -0
- package/src/assets/svg/add.jsx +14 -0
- package/src/assets/svg/arrow-down.jsx +14 -0
- package/src/assets/svg/arrow-right.svg +4 -0
- package/src/assets/svg/book.jsx +34 -0
- package/src/assets/svg/calendar.jsx +64 -0
- package/src/assets/svg/close.jsx +15 -0
- package/src/assets/svg/coolicon.svg +3 -0
- package/src/assets/svg/download.jsx +32 -0
- package/src/assets/svg/eos-icons_machine-learning-outlined.svg +6 -0
- package/src/assets/svg/learning.jsx +21 -0
- package/src/assets/svg/logout.svg +5 -0
- package/src/assets/svg/material-symbols_spatial-audio-outline-rounded.svg +3 -0
- package/src/assets/svg/message.jsx +39 -0
- package/src/assets/svg/notification.jsx +32 -0
- package/src/assets/svg/people.jsx +17 -0
- package/src/assets/svg/search.jsx +24 -0
- package/src/assets/svg/setting.jsx +14 -0
- package/src/components/ApiProgress/ApiConsumption/assets/Vector.jsx +8 -0
- package/src/components/ApiProgress/ApiConsumption/index.jsx +60 -0
- package/src/components/ApiProgress/ApiConsumption/styles/index.jsx +61 -0
- package/src/components/ApiProgress/ApiProgressBar/index.jsx +99 -0
- package/src/components/ApiProgress/ApiProgressBar/styles/index.jsx +122 -0
- package/src/components/ApiProgress/toggle/index.jsx +34 -0
- package/src/components/ApiProgress/toggle/styles/index.jsx +72 -0
- package/src/components/AppMainLayout/index.jsx +50 -0
- package/src/components/AppMainLayout/index.styled.js +37 -0
- package/src/components/Arrow.jsx +24 -0
- package/src/components/apiBar/bar.jsx +46 -0
- package/src/components/apiBar/index.jsx +55 -0
- package/src/components/authentication/assets/images/sign_up.png +0 -0
- package/src/components/authentication/index.styled.js +32 -0
- package/src/components/authentication/mainLayout.jsx +14 -0
- package/src/components/banner/assets/Vector19.png +0 -0
- package/src/components/banner/assets/banner.png +0 -0
- package/src/components/banner/index.jsx +41 -0
- package/src/components/banner/styles/index.jsx +81 -0
- package/src/components/bar/styles.css +19 -0
- package/src/components/button/index.jsx +329 -0
- package/src/components/button/socialBtn.jsx +38 -0
- package/src/components/calender/input.jsx +202 -0
- package/src/components/calender/styles/input.jsx +127 -0
- package/src/components/checkBoxes/checkbox/doc.md +36 -0
- package/src/components/checkBoxes/checkbox/index.jsx +53 -0
- package/src/components/checkBoxes/checkbox/styles/index.jsx +64 -0
- package/src/components/checkBoxes/checkboxGroup/doc.md +55 -0
- package/src/components/checkBoxes/checkboxGroup/index.jsx +47 -0
- package/src/components/checkBoxes/checkboxGroup/styles/index.jsx +7 -0
- package/src/components/course/courseList/index.jsx +32 -0
- package/src/components/course/courseList/styles/index.jsx +10 -0
- package/src/components/course/coursecard/index.jsx +56 -0
- package/src/components/course/coursecard/styles/index.jsx +70 -0
- package/src/components/developerAPIdocs/assets/icons.jsx +46 -0
- package/src/components/developerAPIdocs/assets/learngual_developer_api_doc.png +0 -0
- package/src/components/developerAPIdocs/index.jsx +154 -0
- package/src/components/developerAPIdocs/index.styled.js +137 -0
- package/src/components/dropdown component/index.jsx +139 -0
- package/src/components/dropdown component/styles.js +82 -0
- package/src/components/friendRequest/friendRequestCard/doc.md +49 -0
- package/src/components/friendRequest/friendRequestCard/index.jsx +82 -0
- package/src/components/friendRequest/friendRequestCard/styles/index.jsx +109 -0
- package/src/components/friendRequest/friendRequestList/doc.md +61 -0
- package/src/components/friendRequest/friendRequestList/index.jsx +58 -0
- package/src/components/friendRequest/friendRequestList/styles/index.jsx +34 -0
- package/src/components/graph/graphData.jsx +119 -0
- package/src/components/graph/index.jsx +111 -0
- package/src/components/graph/index.styled.js +261 -0
- package/src/components/header/account-dropdown.jsx +86 -0
- package/src/components/header/assets/images/User-avatar.svg.png +0 -0
- package/src/components/header/assets/images/android.png +0 -0
- package/src/components/header/assets/images/avatar.png +0 -0
- package/src/components/header/assets/images/figma.png +0 -0
- package/src/components/header/assets/images/linkedin.png +0 -0
- package/src/components/header/assets/images/logo.png +0 -0
- package/src/components/header/assets/images/sign_up.png +0 -0
- package/src/components/header/assets/svg/add.jsx +14 -0
- package/src/components/header/assets/svg/arrow-down.jsx +14 -0
- package/src/components/header/assets/svg/book.jsx +34 -0
- package/src/components/header/assets/svg/close.jsx +15 -0
- package/src/components/header/assets/svg/coolicon.svg +3 -0
- package/src/components/header/assets/svg/message.jsx +39 -0
- package/src/components/header/assets/svg/notification.jsx +32 -0
- package/src/components/header/assets/svg/people.jsx +17 -0
- package/src/components/header/assets/svg/search.jsx +24 -0
- package/src/components/header/assets/svg/setting.jsx +14 -0
- package/src/components/header/index.jsx +134 -0
- package/src/components/header/index.styled.js +486 -0
- package/src/components/header/login-header.jsx +71 -0
- package/src/components/input/index.jsx +68 -0
- package/src/components/input/index.styled.js +45 -0
- package/src/components/loader/index.jsx +70 -0
- package/src/components/notificationProgressBar/index.jsx +187 -0
- package/src/components/notificationProgressBar/styles/index.jsx +122 -0
- package/src/components/notificationThreshold/index.jsx +111 -0
- package/src/components/notificationThreshold/index.styled.js +129 -0
- package/src/components/notificationThreshold/slider.jsx +46 -0
- package/src/components/progressBar/index.jsx +32 -0
- package/src/components/progressBar/styles/index.jsx +44 -0
- package/src/components/radio/doc.md +41 -0
- package/src/components/radio/index.jsx +70 -0
- package/src/components/radio/styles/index.jsx +56 -0
- package/src/components/searchBar/doc.md +68 -0
- package/src/components/searchBar/index.jsx +108 -0
- package/src/components/searchBar/styles/index.jsx +89 -0
- package/src/components/select/doc.md +0 -0
- package/src/components/select/index.jsx +122 -0
- package/src/components/select/styles/index.jsx +98 -0
- package/src/components/sideBar/sideMenu/index.jsx +95 -0
- package/src/components/sideBar/sideMenu/styles/index.jsx +135 -0
- package/src/components/sideBar/userCard/index.jsx +32 -0
- package/src/components/sideBar/userCard/styles/index.jsx +37 -0
- package/src/components/sideNav/index.jsx +28 -0
- package/src/components/sideNav/styles/index.jsx +159 -0
- package/src/components/subscriptionPreview/index.jsx +55 -0
- package/src/components/subscriptionPreview/style/style.js +85 -0
- package/src/components/successCard/assets/PartyingFace.png +0 -0
- package/src/components/successCard/index.jsx +29 -0
- package/src/components/successCard/index.styled.js +33 -0
- package/src/components/toggle button/index.jsx +43 -0
- package/src/components/toggle button/styles.js +26 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import {
|
|
4
|
+
SelectWrapper,
|
|
5
|
+
Dropdown,
|
|
6
|
+
DropdownItem,
|
|
7
|
+
SearchInput,
|
|
8
|
+
Label,
|
|
9
|
+
Icon,
|
|
10
|
+
} from "./styles";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {{
|
|
14
|
+
* dropdownData: Array,
|
|
15
|
+
* header: string,
|
|
16
|
+
* searchable: boolean,
|
|
17
|
+
* className: string,
|
|
18
|
+
* onSelect: Function,
|
|
19
|
+
* inputPlaceHolder: string,
|
|
20
|
+
* size: string,
|
|
21
|
+
* }} props - properties of the dropdown component
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
const Select = ({
|
|
25
|
+
onSelect,
|
|
26
|
+
dropdownData,
|
|
27
|
+
searchable,
|
|
28
|
+
inputPlaceholder,
|
|
29
|
+
borderRadius,
|
|
30
|
+
size,
|
|
31
|
+
label,
|
|
32
|
+
color,
|
|
33
|
+
animate,
|
|
34
|
+
bordered,
|
|
35
|
+
}) => {
|
|
36
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
37
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
38
|
+
const [filteredData, setFilteredData] = useState(dropdownData);
|
|
39
|
+
|
|
40
|
+
const handleSelect = (selectedValue) => {
|
|
41
|
+
onSelect(selectedValue);
|
|
42
|
+
setIsOpen(false);
|
|
43
|
+
setSearchTerm(
|
|
44
|
+
dropdownData.find((item) => item.value === selectedValue).name
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const handleSearch = (searchValue) => {
|
|
49
|
+
setSearchTerm(searchValue);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const handleClickIcon = () => {
|
|
53
|
+
setIsOpen(!isOpen);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<SelectWrapper>
|
|
58
|
+
<Label size={size} color={color}>
|
|
59
|
+
{label}
|
|
60
|
+
</Label>
|
|
61
|
+
<SearchInput
|
|
62
|
+
bordered={bordered}
|
|
63
|
+
searchable={searchable}
|
|
64
|
+
size={size}
|
|
65
|
+
color={color}
|
|
66
|
+
borderRadius={borderRadius}
|
|
67
|
+
type="text"
|
|
68
|
+
placeholder={inputPlaceholder}
|
|
69
|
+
value={searchTerm}
|
|
70
|
+
onChange={(e) => handleSearch(e.target.value)}
|
|
71
|
+
onFocus={() => setIsOpen(true)}
|
|
72
|
+
/>
|
|
73
|
+
<Icon size={size} color={color} onClick={handleClickIcon} />
|
|
74
|
+
{isOpen && (
|
|
75
|
+
<Dropdown borderRadius={borderRadius} animate={animate}>
|
|
76
|
+
{filteredData.map(({ value, name }, index) => (
|
|
77
|
+
<DropdownItem
|
|
78
|
+
key={value}
|
|
79
|
+
size={size}
|
|
80
|
+
color={color}
|
|
81
|
+
onClick={() => handleSelect(value)}
|
|
82
|
+
active={name?.toLowerCase() === searchTerm.toLowerCase()}
|
|
83
|
+
>
|
|
84
|
+
{name}
|
|
85
|
+
</DropdownItem>
|
|
86
|
+
))}
|
|
87
|
+
</Dropdown>
|
|
88
|
+
)}
|
|
89
|
+
</SelectWrapper>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
Select.propTypes = {
|
|
94
|
+
onSelect: PropTypes.func.isRequired,
|
|
95
|
+
dropdownData: PropTypes.arrayOf(
|
|
96
|
+
PropTypes.shape({
|
|
97
|
+
value: PropTypes.string.isRequired,
|
|
98
|
+
name: PropTypes.string.isRequired,
|
|
99
|
+
})
|
|
100
|
+
).isRequired,
|
|
101
|
+
searchable: PropTypes.bool,
|
|
102
|
+
inputPlaceholder: PropTypes.string,
|
|
103
|
+
borderRadius: PropTypes.string,
|
|
104
|
+
size: PropTypes.number,
|
|
105
|
+
label: PropTypes.string,
|
|
106
|
+
color: PropTypes.string,
|
|
107
|
+
animate: PropTypes.bool,
|
|
108
|
+
bordered: PropTypes.bool,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
Select.defaultProps = {
|
|
112
|
+
searchable: false,
|
|
113
|
+
inputPlaceholder: "",
|
|
114
|
+
borderRadius: "3px",
|
|
115
|
+
size: 16,
|
|
116
|
+
label: "",
|
|
117
|
+
color: "",
|
|
118
|
+
animate: false,
|
|
119
|
+
bordered: false,
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export default Select;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import styled, { css, keyframes } from "styled-components";
|
|
2
|
+
import { FaAngleDown } from "react-icons/fa";
|
|
3
|
+
|
|
4
|
+
const fadeIn = keyframes`
|
|
5
|
+
from {
|
|
6
|
+
opacity: 0;
|
|
7
|
+
transform: translateY(-10px);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
to {
|
|
11
|
+
opacity: 1;
|
|
12
|
+
transform: translateY(0);
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
export const SelectWrapper = styled.div`
|
|
17
|
+
position: relative;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
|
|
21
|
+
`;
|
|
22
|
+
export const Dropdown = styled.div`
|
|
23
|
+
position: absolute;
|
|
24
|
+
top: 100%;
|
|
25
|
+
left: 0;
|
|
26
|
+
z-index: 1;
|
|
27
|
+
width: 100%;
|
|
28
|
+
max-height: 200px;
|
|
29
|
+
overflow-y: auto;
|
|
30
|
+
background-color: #ffffff;
|
|
31
|
+
border-radius: ${({ borderRadius }) => borderRadius}px;
|
|
32
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
33
|
+
animation: ${({ animate }) => (animate ? fadeIn : "none")} 0.2s ease-in-out;
|
|
34
|
+
|
|
35
|
+
&::-webkit-scrollbar {
|
|
36
|
+
width: 4px;
|
|
37
|
+
background-color: #f5f5f5;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* color of scrollbar handle */
|
|
41
|
+
&::-webkit-scrollbar-thumb {
|
|
42
|
+
background-color: ${({ color }) => color};
|
|
43
|
+
border-radius: 5px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* hover effect on scrollbar handle */
|
|
47
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
48
|
+
background-color: #a6a6a6;
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
export const DropdownItem = styled.div`
|
|
53
|
+
padding: 8px 16px;
|
|
54
|
+
font-size: ${({ size }) => size}px;
|
|
55
|
+
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
|
|
58
|
+
color: ${({ active, color }) => active ? "#ffffff" : color };
|
|
59
|
+
background: ${({ active, color }) => active ? "#ffbf36" : "rgba(255, 255, 255, 0.507)" };
|
|
60
|
+
|
|
61
|
+
&:hover {
|
|
62
|
+
background-color: #f7f7f7;
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
export const SearchInput = styled.input`
|
|
67
|
+
display: ${({ searchable }) => (searchable ? "block" : "none")};
|
|
68
|
+
width: 100%;
|
|
69
|
+
padding: 8px 16px;
|
|
70
|
+
border: none;
|
|
71
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
72
|
+
font-size: ${({ size }) => size}px;
|
|
73
|
+
border-radius: ${({ borderRadius }) => borderRadius}px;
|
|
74
|
+
color: ${({ color }) => color};
|
|
75
|
+
outline: none;
|
|
76
|
+
${({ bordered, color }) =>
|
|
77
|
+
bordered &&
|
|
78
|
+
css`
|
|
79
|
+
border: 2px solid ${color};
|
|
80
|
+
`}
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
export const Label = styled.label`
|
|
84
|
+
display: block;
|
|
85
|
+
font-size: ${({ size }) => size}px;
|
|
86
|
+
margin-bottom: 8px;
|
|
87
|
+
color: ${({ color }) => color};
|
|
88
|
+
`;
|
|
89
|
+
|
|
90
|
+
export const Icon = styled(FaAngleDown)`
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 70%;
|
|
93
|
+
right: 10px;
|
|
94
|
+
transform: translateY(-50%);
|
|
95
|
+
font-size: ${({ size }) => size}px;
|
|
96
|
+
color: ${({ color }) => color};
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
`;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import {
|
|
4
|
+
SideMenuContainer,
|
|
5
|
+
NavigationItemContainer,
|
|
6
|
+
IconContainer,
|
|
7
|
+
TextContainer,
|
|
8
|
+
NotificationCount,
|
|
9
|
+
LogoutButtonContainer,
|
|
10
|
+
NavigationContainer,
|
|
11
|
+
} from "./styles";
|
|
12
|
+
import { IoIosArrowBack, IoIosArrowForward } from "react-icons/io";
|
|
13
|
+
import { CiLogout } from "react-icons/ci";
|
|
14
|
+
import UserCard from "../userCard";
|
|
15
|
+
import cx from "classnames";
|
|
16
|
+
|
|
17
|
+
const SideMenu = ({ user, routes, userType, onLogout, isOpen, setIsOpen }) => {
|
|
18
|
+
// const [isOpen, setIsOpen] = useState(false);
|
|
19
|
+
const onToggle = () => {
|
|
20
|
+
setIsOpen(!isOpen);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const filteredRoutes = routes.find(
|
|
24
|
+
(route) => route.userType === userType
|
|
25
|
+
)?.routes;
|
|
26
|
+
|
|
27
|
+
const renderNavigationItem = (route, index) => {
|
|
28
|
+
const { icon, text, notifications, path } = route;
|
|
29
|
+
const active = window.location.pathname === route.path;
|
|
30
|
+
console.log(active);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<NavigationItemContainer
|
|
34
|
+
to={route.path}
|
|
35
|
+
key={index}
|
|
36
|
+
className={cx(`${route.text}`, ({ isActive, isPending }) => {
|
|
37
|
+
isActive ? "active" : "";
|
|
38
|
+
})}
|
|
39
|
+
minimal={isOpen}
|
|
40
|
+
>
|
|
41
|
+
<IconContainer active={active}>{icon}</IconContainer>
|
|
42
|
+
|
|
43
|
+
<TextContainer minimal={isOpen}>{text}</TextContainer>
|
|
44
|
+
|
|
45
|
+
{notifications && (
|
|
46
|
+
<NotificationCount minimal={isOpen}>
|
|
47
|
+
<div className="text">{notifications}</div>
|
|
48
|
+
</NotificationCount>
|
|
49
|
+
)}
|
|
50
|
+
</NavigationItemContainer>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<SideMenuContainer isOpen={isOpen}>
|
|
56
|
+
<UserCard user={user} isOpen={isOpen} />
|
|
57
|
+
|
|
58
|
+
<NavigationContainer>
|
|
59
|
+
{filteredRoutes && filteredRoutes.map(renderNavigationItem)}
|
|
60
|
+
</NavigationContainer>
|
|
61
|
+
|
|
62
|
+
<LogoutButtonContainer onClick={onLogout}>
|
|
63
|
+
<IconContainer>{/* <CiLogout /> */}</IconContainer>
|
|
64
|
+
{/* <TextContainer minimal={isOpen}>Log out</TextContainer> */}
|
|
65
|
+
</LogoutButtonContainer>
|
|
66
|
+
<div className="toggle" onClick={onToggle}>
|
|
67
|
+
{isOpen ? <IoIosArrowBack /> : <IoIosArrowForward />}
|
|
68
|
+
</div>
|
|
69
|
+
</SideMenuContainer>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
SideMenu.propTypes = {
|
|
74
|
+
user: PropTypes.shape({
|
|
75
|
+
name: PropTypes.string.isRequired,
|
|
76
|
+
handle: PropTypes.string.isRequired,
|
|
77
|
+
avatar: PropTypes.string.isRequired,
|
|
78
|
+
}).isRequired,
|
|
79
|
+
routes: PropTypes.arrayOf(
|
|
80
|
+
PropTypes.shape({
|
|
81
|
+
userType: PropTypes.string.isRequired,
|
|
82
|
+
routes: PropTypes.arrayOf(
|
|
83
|
+
PropTypes.shape({
|
|
84
|
+
path: PropTypes.string.isRequired,
|
|
85
|
+
icon: PropTypes.element.isRequired,
|
|
86
|
+
text: PropTypes.string.isRequired,
|
|
87
|
+
notifications: PropTypes.number,
|
|
88
|
+
})
|
|
89
|
+
).isRequired,
|
|
90
|
+
})
|
|
91
|
+
).isRequired,
|
|
92
|
+
onLogout: PropTypes.func.isRequired,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export default SideMenu;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { NavLink } from "react-router-dom";
|
|
3
|
+
|
|
4
|
+
export const SideMenuContainer = styled.div`
|
|
5
|
+
position: relative;
|
|
6
|
+
|
|
7
|
+
width: ${({ isOpen }) => (isOpen ? "239px" : "48px")};
|
|
8
|
+
height: 80vh;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
|
|
12
|
+
background-color: #00c2c2;
|
|
13
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
|
|
14
|
+
padding: 30px 0;
|
|
15
|
+
transition: width 0.2s ease-in-out;
|
|
16
|
+
z-index: 100;
|
|
17
|
+
border-radius: 30px;
|
|
18
|
+
margin-left: 77px;
|
|
19
|
+
|
|
20
|
+
.toggle {
|
|
21
|
+
width: 20px;
|
|
22
|
+
height: 20px;
|
|
23
|
+
display: flex;
|
|
24
|
+
border-radius: 4px;
|
|
25
|
+
background: #fff;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
align-items: center;
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 115px;
|
|
30
|
+
right: -13px;
|
|
31
|
+
color: #fdcf04;
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
export const NavigationContainer = styled.div`
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
margin-top: 20px;
|
|
40
|
+
`;
|
|
41
|
+
export const NavigationItemContainer = styled(NavLink)`
|
|
42
|
+
text-decoration: none;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 10px;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
position: relative;
|
|
48
|
+
padding: ${({ minimal }) => (minimal ? "12px 16px" : "12px 12px")};
|
|
49
|
+
color: ${({ active }) =>
|
|
50
|
+
active ? "rgb(255, 255, 255)" : "rgba(255, 255, 255, 0.625)"};
|
|
51
|
+
&:hover {
|
|
52
|
+
color: #ffffff;
|
|
53
|
+
background-color: #31cdcd;
|
|
54
|
+
}
|
|
55
|
+
&.active {
|
|
56
|
+
background-color: rgba(0, 153, 153, 0.5);
|
|
57
|
+
// border-left: 5px solid #febf10;
|
|
58
|
+
border-radius: 10px 0 0px 10px;
|
|
59
|
+
color: #ffffff;
|
|
60
|
+
&::before {
|
|
61
|
+
content: "";
|
|
62
|
+
height: 110%;
|
|
63
|
+
width: 5px;
|
|
64
|
+
border-radius: 0 10px 10px 0;
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: -5%;
|
|
67
|
+
left: 0;
|
|
68
|
+
display: block;
|
|
69
|
+
background: #febf10;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
|
|
74
|
+
export const IconContainer = styled.div`
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
font-size: 25px;
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
export const TextContainer = styled.div`
|
|
82
|
+
display: ${({ minimal }) => (minimal ? "flex" : "none")};
|
|
83
|
+
align-items: center;
|
|
84
|
+
font-size: 16px;
|
|
85
|
+
`;
|
|
86
|
+
|
|
87
|
+
export const NotificationCount = styled.div`
|
|
88
|
+
background-color: #009999;
|
|
89
|
+
color: #fff;
|
|
90
|
+
font-size: 12px;
|
|
91
|
+
font-weight: 500;
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
border-radius: 50%;
|
|
96
|
+
width: 20px;
|
|
97
|
+
height: 20px;
|
|
98
|
+
margin-left: 2px;
|
|
99
|
+
|
|
100
|
+
${({ minimal }) =>
|
|
101
|
+
minimal
|
|
102
|
+
? null
|
|
103
|
+
: `
|
|
104
|
+
position: absolute;
|
|
105
|
+
bottom: 11px;
|
|
106
|
+
right: 14px;
|
|
107
|
+
width: 12px;
|
|
108
|
+
height: 12px;
|
|
109
|
+
font-size: 12px;
|
|
110
|
+
.text {
|
|
111
|
+
display: none;
|
|
112
|
+
}
|
|
113
|
+
`};
|
|
114
|
+
`;
|
|
115
|
+
|
|
116
|
+
export const LogoutButtonContainer = styled.div`
|
|
117
|
+
margin-top: auto;
|
|
118
|
+
display: flex;
|
|
119
|
+
gap: 10px;
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
color: rgba(253, 253, 253, 0.595);
|
|
122
|
+
&:hover {
|
|
123
|
+
color: #ffffff;
|
|
124
|
+
}
|
|
125
|
+
`;
|
|
126
|
+
|
|
127
|
+
export const LogoutIcon = styled.img`
|
|
128
|
+
width: 20px;
|
|
129
|
+
height: 20px;
|
|
130
|
+
margin-right: 5px;
|
|
131
|
+
`;
|
|
132
|
+
|
|
133
|
+
export const LogoutText = styled.div`
|
|
134
|
+
font-weight: bold;
|
|
135
|
+
`;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import {
|
|
4
|
+
UserCardContainer,
|
|
5
|
+
Avatar,
|
|
6
|
+
UserName,
|
|
7
|
+
Handle,
|
|
8
|
+
UserDetail,
|
|
9
|
+
} from "./styles";
|
|
10
|
+
|
|
11
|
+
const UserCard = ({ user, isOpen }) => {
|
|
12
|
+
return (
|
|
13
|
+
<UserCardContainer isOpen={isOpen}>
|
|
14
|
+
<Avatar src={user.avatar} isOpen={isOpen} />
|
|
15
|
+
<UserDetail isOpen={isOpen}>
|
|
16
|
+
<UserName>{user.name}</UserName>
|
|
17
|
+
<Handle>{user.handle}</Handle>
|
|
18
|
+
</UserDetail>
|
|
19
|
+
</UserCardContainer>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
UserCard.propTypes = {
|
|
24
|
+
user: PropTypes.shape({
|
|
25
|
+
avatar: PropTypes.string.isRequired,
|
|
26
|
+
name: PropTypes.string.isRequired,
|
|
27
|
+
handle: PropTypes.string.isRequired,
|
|
28
|
+
}).isRequired,
|
|
29
|
+
isOpen: PropTypes.bool.isRequired,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default UserCard;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const UserCardContainer = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
gap: 10px;
|
|
9
|
+
align-items: center;
|
|
10
|
+
margin-bottom: ${({ isOpen }) => (isOpen ? "25px" : "80px")};
|
|
11
|
+
`;
|
|
12
|
+
export const UserDetail = styled.div`
|
|
13
|
+
display: ${({ isOpen }) => (isOpen ? "flex" : "none")};
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: 5px;
|
|
16
|
+
align-items: center;
|
|
17
|
+
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export const Avatar = styled.img`
|
|
21
|
+
width: 50px;
|
|
22
|
+
width: ${({ isOpen }) => (isOpen ? "47px" : "28px")};
|
|
23
|
+
height: ${({ isOpen }) => (isOpen ? "47px" : "28px")};
|
|
24
|
+
border-radius: 50%;
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const UserName = styled.div`
|
|
28
|
+
font-weight: 400;
|
|
29
|
+
color: rgba(255, 255, 255, 0.881);
|
|
30
|
+
font-size: 12px ;
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
export const Handle = styled.div`
|
|
34
|
+
color: rgba(255, 255, 255, 0.69);
|
|
35
|
+
font-size: 15px;
|
|
36
|
+
`;
|
|
37
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Icon, NavItem, NavItems, NavLinkStyled, NavWrapper, IconContainer } from "./styles";
|
|
3
|
+
import { CiLogout } from "react-icons/ci";
|
|
4
|
+
import { HiOutlineLogout } from "react-icons/hi"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const SideBar = ({ routes }) => {
|
|
8
|
+
return (
|
|
9
|
+
<NavWrapper>
|
|
10
|
+
<NavItems>
|
|
11
|
+
{routes.map((route) => (
|
|
12
|
+
<NavItem key={route.path}>
|
|
13
|
+
<NavLinkStyled to={route.path} activeClassName="active">
|
|
14
|
+
<Icon>{route.icon}</Icon>
|
|
15
|
+
<span className="text">{route.label}</span>
|
|
16
|
+
</NavLinkStyled>
|
|
17
|
+
</NavItem>
|
|
18
|
+
))}
|
|
19
|
+
</NavItems>
|
|
20
|
+
<IconContainer>
|
|
21
|
+
<HiOutlineLogout/>
|
|
22
|
+
<p>Sign Out</p>
|
|
23
|
+
</IconContainer>
|
|
24
|
+
</NavWrapper>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default SideBar;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { NavLink } from "react-router-dom";
|
|
3
|
+
|
|
4
|
+
export const NavWrapper = styled.nav`
|
|
5
|
+
background-color: #ffffff;
|
|
6
|
+
width: 57px;
|
|
7
|
+
position: fixed;
|
|
8
|
+
/* top: 10%; */
|
|
9
|
+
left: 0;
|
|
10
|
+
overflow-x: hidden;
|
|
11
|
+
padding: 35px 0;
|
|
12
|
+
border-radius: 0 30px 30px 0;
|
|
13
|
+
z-index: 1;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
|
|
16
|
+
@media screen and (max-width: 768px) {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export const NavItems = styled.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const NavItem = styled.div`
|
|
28
|
+
text-align: center;
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
export const NavLinkStyled = styled(NavLink)`
|
|
32
|
+
color: rgba(95, 95, 95, 0.479);
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
align-items: center;
|
|
37
|
+
padding: 10px;
|
|
38
|
+
text-align: center;
|
|
39
|
+
transition: all 0.3s ease;
|
|
40
|
+
|
|
41
|
+
.text {
|
|
42
|
+
font-size: 9px;
|
|
43
|
+
color: #adb3b3;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
// background-color: rgba(22, 254, 165, 0.266);
|
|
48
|
+
color: rgba(22, 254, 165, 0.956);
|
|
49
|
+
background: rgba(0, 194, 194, 0.1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.active {
|
|
53
|
+
background-color: rgba(0, 194, 194, 0.1);
|
|
54
|
+
color: #00c2c2;
|
|
55
|
+
position: relative;
|
|
56
|
+
|
|
57
|
+
&::before {
|
|
58
|
+
content: "";
|
|
59
|
+
height: 110%;
|
|
60
|
+
width: 5px;
|
|
61
|
+
border-radius: 0 10px 10px 0;
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: -5%;
|
|
64
|
+
left: 0;
|
|
65
|
+
display: block;
|
|
66
|
+
background: rgba(58, 194, 194, 1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
span {
|
|
70
|
+
color: #00c2c2;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
svg {
|
|
74
|
+
path {
|
|
75
|
+
stroke: #00c2c2;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
export const Icon = styled.span`
|
|
82
|
+
margin: 0;
|
|
83
|
+
color: #adb3b3;
|
|
84
|
+
margin-bottom: 0px;
|
|
85
|
+
font-size: 16px;
|
|
86
|
+
|
|
87
|
+
// &:hover {
|
|
88
|
+
// // background-color: rgba(22, 254, 165, 0.266);
|
|
89
|
+
// color: #00C2C2;
|
|
90
|
+
// background: rgba(0, 194, 194, 0.1);
|
|
91
|
+
|
|
92
|
+
// }
|
|
93
|
+
|
|
94
|
+
// &.active {
|
|
95
|
+
// background-color: rgba(0, 194, 194, 0.1);
|
|
96
|
+
// color: #3AC2C2;
|
|
97
|
+
// position: relative;
|
|
98
|
+
|
|
99
|
+
// &::before {
|
|
100
|
+
// content: "";
|
|
101
|
+
// height: 110%;
|
|
102
|
+
// width: 5px;
|
|
103
|
+
// border-radius: 0 10px 10px 0;
|
|
104
|
+
// position: absolute;
|
|
105
|
+
// top: -5%;
|
|
106
|
+
// left: 0;
|
|
107
|
+
// display: block;
|
|
108
|
+
// background: rgba(22, 254, 165, 0.956);
|
|
109
|
+
// }
|
|
110
|
+
// }
|
|
111
|
+
`;
|
|
112
|
+
|
|
113
|
+
export const IconContainer = styled.div`
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
margin-top: 100px;
|
|
119
|
+
font-size: 20px;
|
|
120
|
+
padding: 10px;
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
|
|
123
|
+
svg {
|
|
124
|
+
color: #adb3b3;
|
|
125
|
+
transform: rotate(180deg);
|
|
126
|
+
font-size: 18px;
|
|
127
|
+
margin-bottom: -8px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
p {
|
|
131
|
+
font-size: 9px;
|
|
132
|
+
color: #adb3b3;
|
|
133
|
+
margin-top: 10px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&:hover {
|
|
137
|
+
// background-color: rgba(22, 254, 165, 0.266);
|
|
138
|
+
color: rgba(22, 254, 165, 0.956);
|
|
139
|
+
background: rgba(0, 194, 194, 0.1);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&.active {
|
|
143
|
+
background-color: rgba(0, 194, 194, 0.1);
|
|
144
|
+
color: #3ac2c2;
|
|
145
|
+
position: relative;
|
|
146
|
+
|
|
147
|
+
&::before {
|
|
148
|
+
content: "";
|
|
149
|
+
height: 110%;
|
|
150
|
+
width: 5px;
|
|
151
|
+
border-radius: 0 10px 10px 0;
|
|
152
|
+
position: absolute;
|
|
153
|
+
top: -5%;
|
|
154
|
+
left: 0;
|
|
155
|
+
display: block;
|
|
156
|
+
background: rgba(22, 254, 165, 0.956);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
`;
|