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,127 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const DateInputContainer = styled.div`
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
width: ${({ size }) => {
|
|
8
|
+
switch (size) {
|
|
9
|
+
case "sm":
|
|
10
|
+
return "120px";
|
|
11
|
+
case "md":
|
|
12
|
+
return "140px";
|
|
13
|
+
case "lg":
|
|
14
|
+
return "270px";
|
|
15
|
+
default:
|
|
16
|
+
return "120px";
|
|
17
|
+
}
|
|
18
|
+
}};
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export const DateInput = styled.input`
|
|
22
|
+
font-size: ${({ size }) => {
|
|
23
|
+
switch (size) {
|
|
24
|
+
case "sm":
|
|
25
|
+
return "11px";
|
|
26
|
+
case "md":
|
|
27
|
+
return "16px";
|
|
28
|
+
case "lg":
|
|
29
|
+
return "18px";
|
|
30
|
+
default:
|
|
31
|
+
return "11px";
|
|
32
|
+
}
|
|
33
|
+
}};
|
|
34
|
+
color: rgba(202, 201, 201, 0.335);
|
|
35
|
+
padding: 10px;
|
|
36
|
+
border: 3px solid
|
|
37
|
+
${({ active }) =>
|
|
38
|
+
active ? "rgba(59, 59, 59, 0.282)" : "rgba(202, 201, 201, 0.335)"};
|
|
39
|
+
border-radius: 8px;
|
|
40
|
+
background-color: transparent;
|
|
41
|
+
outline: none;
|
|
42
|
+
width: 100%;
|
|
43
|
+
&:focus {
|
|
44
|
+
border: 2px solid rgba(59, 59, 59, 0.282);
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
export const CalendarIcon = styled.span`
|
|
49
|
+
position: absolute;
|
|
50
|
+
right: 10px;
|
|
51
|
+
top: 55%;
|
|
52
|
+
transform: translateY(-50%);
|
|
53
|
+
font-size: 20px;
|
|
54
|
+
color: #000;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
`;
|
|
57
|
+
|
|
58
|
+
export const CalendarContainer = styled.div`
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: 110%;
|
|
61
|
+
left: 0;
|
|
62
|
+
z-index: 1;
|
|
63
|
+
background-color: rgb(255, 255, 255);
|
|
64
|
+
border: 1px solid grey;
|
|
65
|
+
border-radius: 10px;
|
|
66
|
+
padding: 20px;
|
|
67
|
+
|
|
68
|
+
.buttons {
|
|
69
|
+
display: flex;
|
|
70
|
+
gap: 2px;
|
|
71
|
+
button {
|
|
72
|
+
background: rgba(204, 204, 204, 0.342);
|
|
73
|
+
border: 1px solid rgba(204, 204, 204, 0.342);
|
|
74
|
+
outline: none;
|
|
75
|
+
border-radius: 4px;
|
|
76
|
+
width: 20px;
|
|
77
|
+
height: 20px;
|
|
78
|
+
display: flex;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
align-items: center;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
export const CalendarHeader = styled.div`
|
|
86
|
+
display: flex;
|
|
87
|
+
justify-content: space-between;
|
|
88
|
+
align-items: center;
|
|
89
|
+
font-weight: 700;
|
|
90
|
+
font-size: 18px;
|
|
91
|
+
|
|
92
|
+
`;
|
|
93
|
+
|
|
94
|
+
export const CalendarBody = styled.div`
|
|
95
|
+
display: grid;
|
|
96
|
+
grid-template-columns: repeat(7, 1fr);
|
|
97
|
+
grid-auto-rows: 30px;
|
|
98
|
+
padding-top: 10px;
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
export const CalendarDayCell = styled.div`
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
align-items: center;
|
|
105
|
+
font-size: ${({ selected }) => (selected ? '13px' : "12px")};
|
|
106
|
+
font-weight: ${({ selected }) => (selected ? '700' : "500")};
|
|
107
|
+
gap: 3px;
|
|
108
|
+
border-radius: 5px;
|
|
109
|
+
padding: 7px 10px;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
color: ${({ selected }) => (selected ? '#fff' : "black")};
|
|
112
|
+
background-color: ${({ selected, color }) =>
|
|
113
|
+
selected ? "#00C2C2": "white"};
|
|
114
|
+
|
|
115
|
+
&.weekdays {
|
|
116
|
+
font-weight: 700;
|
|
117
|
+
font-size: 13px;
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&:hover {
|
|
122
|
+
color: #0094BA;
|
|
123
|
+
background-color: rgba(0, 148, 186, 0.04);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
`;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
## Checkbox Component
|
|
2
|
+
|
|
3
|
+
A customizable Checkbox component.
|
|
4
|
+
|
|
5
|
+
### Props
|
|
6
|
+
|
|
7
|
+
| Name | Type | Default | Description |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| label | string | | The label to display next to the checkbox |
|
|
10
|
+
| color | string | `#007bff` | The color of the checkbox when checked |
|
|
11
|
+
| defaultValue | boolean | `false` | The default checked state of the checkbox |
|
|
12
|
+
| onChange | function | | A function to be called when the checkbox is checked or unchecked |
|
|
13
|
+
| ...props | any | | Any additional props to be passed to the component |
|
|
14
|
+
|
|
15
|
+
### Example Usage
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
import React, { useState } from "react";
|
|
19
|
+
import Checkbox from "./Checkbox";
|
|
20
|
+
|
|
21
|
+
const MyComponent = () => {
|
|
22
|
+
const [checked, setChecked] = useState(false);
|
|
23
|
+
|
|
24
|
+
const handleChange = (newValue) => {
|
|
25
|
+
setChecked(newValue);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Checkbox
|
|
30
|
+
label="Check me out!"
|
|
31
|
+
color="#ff9900"
|
|
32
|
+
defaultValue={checked}
|
|
33
|
+
onChange={handleChange}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { BsCheck } from "react-icons/bs";
|
|
3
|
+
import { PropTypes } from 'prop-types';
|
|
4
|
+
import { CheckboxControl, CheckboxInput, CheckboxLabel, CheckboxWrapper } from "./styles";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const Checkbox = ({
|
|
8
|
+
label,
|
|
9
|
+
color,
|
|
10
|
+
defaultValue,
|
|
11
|
+
onChange,
|
|
12
|
+
size,
|
|
13
|
+
...props
|
|
14
|
+
}) => {
|
|
15
|
+
const [checked, setChecked] = useState(defaultValue);
|
|
16
|
+
|
|
17
|
+
const handleChange = (event) => {
|
|
18
|
+
const newValue = event.target.checked;
|
|
19
|
+
setChecked(newValue);
|
|
20
|
+
onChange && onChange(newValue);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<CheckboxWrapper {...props}>
|
|
25
|
+
<CheckboxInput checked={checked} onChange={handleChange} />
|
|
26
|
+
<CheckboxControl
|
|
27
|
+
checked={checked}
|
|
28
|
+
color={color}
|
|
29
|
+
size={size}
|
|
30
|
+
>
|
|
31
|
+
<BsCheck />
|
|
32
|
+
</CheckboxControl>
|
|
33
|
+
<CheckboxLabel checked={checked} color={color}>
|
|
34
|
+
{label}
|
|
35
|
+
</CheckboxLabel>
|
|
36
|
+
</CheckboxWrapper>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
Checkbox.propTypes = {
|
|
41
|
+
label: PropTypes.string,
|
|
42
|
+
color: PropTypes.string,
|
|
43
|
+
size: PropTypes.string,
|
|
44
|
+
onChange: PropTypes.func,
|
|
45
|
+
defaultValue: PropTypes.bool,
|
|
46
|
+
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
Checkbox.defaultProps = {
|
|
50
|
+
defaultValue: false,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default Checkbox;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
// export const sizes = {
|
|
4
|
+
// xs: {
|
|
5
|
+
// height: "4px",
|
|
6
|
+
// width: "4px",
|
|
7
|
+
// },
|
|
8
|
+
// sm: {
|
|
9
|
+
// height: "8px",
|
|
10
|
+
// width: "8px",
|
|
11
|
+
// },
|
|
12
|
+
// md: {
|
|
13
|
+
// height: "14px",
|
|
14
|
+
// width: "14px",
|
|
15
|
+
// },
|
|
16
|
+
// lg: {
|
|
17
|
+
// height: "16px",
|
|
18
|
+
// width: "16px",
|
|
19
|
+
// },
|
|
20
|
+
// xl: {
|
|
21
|
+
// height: "20px",
|
|
22
|
+
// width: "20px",
|
|
23
|
+
// },
|
|
24
|
+
// };
|
|
25
|
+
|
|
26
|
+
export const CheckboxWrapper = styled.label`
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
export const CheckboxInput = styled.input.attrs({ type: "checkbox" })`
|
|
33
|
+
position: absolute;
|
|
34
|
+
opacity: 0;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
export const CheckboxControl = styled.span`
|
|
39
|
+
position: relative;
|
|
40
|
+
display: inline-block;
|
|
41
|
+
height: ${(props) => (props.size || "24px")};
|
|
42
|
+
width: ${(props) => (props.size || "24px")};
|
|
43
|
+
border: 2px solid
|
|
44
|
+
${(props) => (props.checked ? props.color : "rgba(159, 159, 159, 0.365)")};
|
|
45
|
+
background-color: ${(props) => (props.checked ? props.color : "transparent")};
|
|
46
|
+
border-radius: 4px;
|
|
47
|
+
transition: all 0.2s ease-in-out;
|
|
48
|
+
|
|
49
|
+
& svg {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 50%;
|
|
52
|
+
left: 50%;
|
|
53
|
+
transform: translate(-50%, -50%);
|
|
54
|
+
color: ${(props) => (props.checked ? "#fff" : "transparent")};
|
|
55
|
+
transition: all 0.2s ease-in-out;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
|
|
59
|
+
export const CheckboxLabel = styled.span`
|
|
60
|
+
margin-left: 8px;
|
|
61
|
+
font-size: 12px;
|
|
62
|
+
font-weight: bold;
|
|
63
|
+
color: ${(props) => (props.checked ? props.color : "initial")};
|
|
64
|
+
`;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Checkbox Group Component
|
|
2
|
+
|
|
3
|
+
The Checkbox Group component is a reusable user interface element that allows users to select one or more options from a list of choices. The component should be clickable and its state should change on click. Additionally, the component should be able to return its values on click, and we should be able to pass in default states for these checkboxes.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Name | Type | Default | Description |
|
|
8
|
+
|---------------|----------|---------|-------------------------------------------------------------------|
|
|
9
|
+
| `options` | `array` | `[]` | An array of objects representing the available options. Each object should have a label and value property. |
|
|
10
|
+
| `selectedValues` | `string` | `"#000"` | An array of strings representing the currently selected values. |
|
|
11
|
+
| `color`| `string` | `#000` | A color string to be passed as a prop to the Checkbox components. |
|
|
12
|
+
| `onChange` | `func` | `null` | A callback function that is called when the selection changes. It receives the new selected values as an argument. |
|
|
13
|
+
|
|
14
|
+
## Options Object
|
|
15
|
+
|
|
16
|
+
The `options` prop should be an array of objects representing each checkbox option. Each object should have the following properties:
|
|
17
|
+
|
|
18
|
+
| Name | Type | Description |
|
|
19
|
+
|-----------|-----------|--------------------------------------|
|
|
20
|
+
| `value` | `string` | The value of the checkbox. |
|
|
21
|
+
| `label` | `string` | The label displayed next to the checkbox. |
|
|
22
|
+
|
|
23
|
+
## Example Usage
|
|
24
|
+
|
|
25
|
+
```jsx
|
|
26
|
+
import React, { useState } from 'react';
|
|
27
|
+
import CheckboxGroup from './CheckboxGroup';
|
|
28
|
+
|
|
29
|
+
const options = [
|
|
30
|
+
{ label: "Option 1", value: "option1" },
|
|
31
|
+
{ label: "Option 2", value: "option2" },
|
|
32
|
+
{ label: "Option 3", value: "option3" },
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const App = () => {
|
|
36
|
+
const [selectedValues, setSelectedValues] = useState([]);
|
|
37
|
+
|
|
38
|
+
const handleCheckboxGroupChange = (newSelectedValues) => {
|
|
39
|
+
setSelectedValues(newSelectedValues);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div>
|
|
44
|
+
<CheckboxGroup
|
|
45
|
+
color="#ffaa33"
|
|
46
|
+
options={options}
|
|
47
|
+
selectedValues={selectedValues}
|
|
48
|
+
onChange={handleCheckboxGroupChange}
|
|
49
|
+
/>
|
|
50
|
+
<div>Selected values: {JSON.stringify(selectedValues)}</div>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default App;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import Checkbox from "../checkbox";
|
|
4
|
+
import { Container } from "./styles";
|
|
5
|
+
|
|
6
|
+
const CheckboxGroup = ({ color, options, selectedValues, onChange, size, }) => {
|
|
7
|
+
const handleChange = (value) => {
|
|
8
|
+
let newSelectedValues = [...selectedValues];
|
|
9
|
+
if (newSelectedValues.includes(value)) {
|
|
10
|
+
newSelectedValues = newSelectedValues.filter((v) => v !== value);
|
|
11
|
+
} else {
|
|
12
|
+
newSelectedValues.push(value);
|
|
13
|
+
}
|
|
14
|
+
onChange(newSelectedValues);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Container>
|
|
19
|
+
{options.map((option) => (
|
|
20
|
+
<Checkbox
|
|
21
|
+
key={option.value}
|
|
22
|
+
label={option.label}
|
|
23
|
+
color={color}
|
|
24
|
+
value={option.value}
|
|
25
|
+
size={size}
|
|
26
|
+
onChange={() => handleChange(option.value)}
|
|
27
|
+
checked={selectedValues.includes(option.value)}
|
|
28
|
+
/>
|
|
29
|
+
))}
|
|
30
|
+
</Container>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
CheckboxGroup.propTypes = {
|
|
35
|
+
options: PropTypes.arrayOf(
|
|
36
|
+
PropTypes.shape({
|
|
37
|
+
label: PropTypes.string.isRequired,
|
|
38
|
+
value: PropTypes.string.isRequired,
|
|
39
|
+
color: PropTypes.string,
|
|
40
|
+
size: PropTypes.string,
|
|
41
|
+
})
|
|
42
|
+
).isRequired,
|
|
43
|
+
selectedValues: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
44
|
+
onChange: PropTypes.func.isRequired,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default CheckboxGroup;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import CourseCard from "../coursecard";
|
|
3
|
+
import { CourseListWrapper } from "./styles";
|
|
4
|
+
|
|
5
|
+
import PropTypes from "prop-types";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const CourseList = ({courses}) => {
|
|
9
|
+
return (
|
|
10
|
+
<CourseListWrapper>
|
|
11
|
+
{courses.map((course) => (
|
|
12
|
+
<CourseCard key={course.id} course={course} />
|
|
13
|
+
))}
|
|
14
|
+
</CourseListWrapper>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
CourseList.propTypes = {
|
|
19
|
+
courses: PropTypes.arrayOf(
|
|
20
|
+
PropTypes.shape({
|
|
21
|
+
id: PropTypes.number.isRequired,
|
|
22
|
+
title: PropTypes.string.isRequired,
|
|
23
|
+
endDate: PropTypes.string.isRequired,
|
|
24
|
+
rating: PropTypes.number.isRequired,
|
|
25
|
+
learnersCount: PropTypes.number.isRequired,
|
|
26
|
+
})
|
|
27
|
+
).isRequired,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default CourseList;
|
|
31
|
+
|
|
32
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import {
|
|
4
|
+
CardWrapper,
|
|
5
|
+
EndDate,
|
|
6
|
+
LearnersCount,
|
|
7
|
+
Rates,
|
|
8
|
+
Rating,
|
|
9
|
+
StarIcon,
|
|
10
|
+
Title,
|
|
11
|
+
} from "./styles";
|
|
12
|
+
|
|
13
|
+
const formatLearnersCount = (count) => {
|
|
14
|
+
if (count >= 1000) {
|
|
15
|
+
return `${Math.floor(count / 1000)}k`;
|
|
16
|
+
} else {
|
|
17
|
+
return count.toString();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
const CourseCard = ({ course }) => {
|
|
23
|
+
const { id, title, endDate, rating, learnersCount } = course;
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<CardWrapper to={`/courses/${id}`}>
|
|
27
|
+
<Title>{title}</Title>
|
|
28
|
+
<EndDate>
|
|
29
|
+
<span>Course Ends: </span>
|
|
30
|
+
{endDate}
|
|
31
|
+
</EndDate>
|
|
32
|
+
|
|
33
|
+
<Rates>
|
|
34
|
+
<Rating>
|
|
35
|
+
<StarIcon />
|
|
36
|
+
{rating}
|
|
37
|
+
</Rating>
|
|
38
|
+
<div className="divider"></div>
|
|
39
|
+
<LearnersCount>
|
|
40
|
+
{formatLearnersCount(learnersCount)} <span>learners</span>{" "}
|
|
41
|
+
</LearnersCount>
|
|
42
|
+
</Rates>
|
|
43
|
+
</CardWrapper>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
CourseCard.propTypes = {
|
|
48
|
+
course: PropTypes.shape({
|
|
49
|
+
title: PropTypes.string.isRequired,
|
|
50
|
+
endDate: PropTypes.string.isRequired,
|
|
51
|
+
rating: PropTypes.number.isRequired,
|
|
52
|
+
learnersCount: PropTypes.number.isRequired,
|
|
53
|
+
}).isRequired,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default CourseCard;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { BsStarFill } from "react-icons/bs";
|
|
3
|
+
import { NavLink } from "react-router-dom";
|
|
4
|
+
|
|
5
|
+
export const CardWrapper = styled(NavLink)`
|
|
6
|
+
text-decoration: none;
|
|
7
|
+
color: #333;
|
|
8
|
+
width: 280px;
|
|
9
|
+
height: auto;
|
|
10
|
+
gap: 20px;
|
|
11
|
+
|
|
12
|
+
border: 5px solid #ffffff;
|
|
13
|
+
background: #fff;
|
|
14
|
+
border-radius: 25px;
|
|
15
|
+
padding: 30px;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
transition: 0.3s ease-in-out;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
border: 5px solid #f5d508;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const Title = styled.h3`
|
|
28
|
+
font-size: 16px;
|
|
29
|
+
font-weight: 800;
|
|
30
|
+
letter-spacing: 1px;
|
|
31
|
+
margin: 0;
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
export const EndDate = styled.p`
|
|
35
|
+
font-size: 13px;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
margin: 0;
|
|
38
|
+
|
|
39
|
+
span {
|
|
40
|
+
color: hsla(0, 0%, 45.09803921568628%, 0.52);
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
export const Rating = styled.div`
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
`;
|
|
48
|
+
export const Rates = styled.div`
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: 5px;
|
|
52
|
+
font-size: 18px;
|
|
53
|
+
font-weight: 300;
|
|
54
|
+
|
|
55
|
+
.divider {
|
|
56
|
+
width: 3px;
|
|
57
|
+
height: 3px;
|
|
58
|
+
border-radius: 3px;
|
|
59
|
+
background: #000;
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
export const StarIcon = styled(BsStarFill)`
|
|
64
|
+
color: #ffc107;
|
|
65
|
+
margin-right: 5px;
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
export const LearnersCount = styled.p`
|
|
69
|
+
margin: 0;
|
|
70
|
+
`;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const ArrowIcon = ({ width, height, fill }) => (
|
|
2
|
+
<svg
|
|
3
|
+
width={width || "5"}
|
|
4
|
+
height={height || "10"}
|
|
5
|
+
viewBox="0 0 5 10"
|
|
6
|
+
fill="none"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
>
|
|
9
|
+
<path d="M0 10L5 5L0 0V10Z" fill="#323232" />
|
|
10
|
+
</svg>
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export const FolderOpenIcon = ({ width, height, fill }) => (
|
|
14
|
+
<svg
|
|
15
|
+
width={width || "24"}
|
|
16
|
+
height={height || "24"}
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
fill="none"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
>
|
|
21
|
+
<path
|
|
22
|
+
d="M5 19C3.89543 19 3 18.1046 3 17V7C3 5.89543 3.89543 5 5 5H9L11 7H15C16.1046 7 17 7.89543 17 9V10M5 19H19C20.1046 19 21 18.1046 21 17V12C21 10.8954 20.1046 10 19 10H9C7.89543 10 7 10.8954 7 12V17C7 18.1046 6.10457 19 5 19Z"
|
|
23
|
+
stroke="#009999"
|
|
24
|
+
stroke-width="2"
|
|
25
|
+
stroke-linecap="round"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
export const FolderCloseIcon = ({ width, height, fill }) => (
|
|
31
|
+
<svg
|
|
32
|
+
width={width || "24"}
|
|
33
|
+
height={height || "24"}
|
|
34
|
+
viewBox="0 0 24 24"
|
|
35
|
+
fill="none"
|
|
36
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
+
>
|
|
38
|
+
<path
|
|
39
|
+
d="M3 7V17C3 18.1046 3.89543 19 5 19H19C20.1046 19 21 18.1046 21 17V9C21 7.89543 20.1046 7 19 7H13L11 5H5C3.89543 5 3 5.89543 3 7Z"
|
|
40
|
+
stroke="#009999"
|
|
41
|
+
stroke-width="2"
|
|
42
|
+
stroke-linecap="round"
|
|
43
|
+
stroke-linejoin="round"
|
|
44
|
+
/>
|
|
45
|
+
</svg>
|
|
46
|
+
);
|