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,109 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const Wrapper = styled.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: 10px;
|
|
7
|
+
background: rgba(0, 194, 194, 0.212);
|
|
8
|
+
padding: 10px;
|
|
9
|
+
border-radius: 20px;
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export const Header = styled.h3`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: 10px;
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const CardContainer = styled.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
|
|
23
|
+
padding: ${p => p.multiple ? 0 : '10px'};
|
|
24
|
+
|
|
25
|
+
border-radius: ${p => p.multiple ? 0 : '10px'};
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
export const ProfileImage = styled.img`
|
|
29
|
+
width: 60px;
|
|
30
|
+
height: 60px;
|
|
31
|
+
border-radius: 50%;
|
|
32
|
+
margin-right: 16px;
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
export const CardText = styled.div`
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
margin-right: auto;
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
export const ProfileName = styled.span`
|
|
42
|
+
font-weight: bold;
|
|
43
|
+
margin-bottom: 4px;
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
export const UserName = styled.span`
|
|
47
|
+
font-size: 14px;
|
|
48
|
+
color: #999;
|
|
49
|
+
|
|
50
|
+
span {
|
|
51
|
+
background: #febf10;
|
|
52
|
+
color: #fff;
|
|
53
|
+
padding: 4px;
|
|
54
|
+
border-radius: 4px;
|
|
55
|
+
font-size: 10px;
|
|
56
|
+
margin-left: 5x;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
export const ButtonContainer = styled.div`
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: flex-end;
|
|
64
|
+
gap: 10px;
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
export const CountButton = styled.button`
|
|
68
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
69
|
+
border: none;
|
|
70
|
+
border-radius: 9.27391px;
|
|
71
|
+
color: #f7d00b;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
font-size: 16px;
|
|
74
|
+
margin-right: 8px;
|
|
75
|
+
padding: 10px 26px;
|
|
76
|
+
border-radius: 8px;
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
export const SeeAllButton = styled.button`
|
|
80
|
+
background-color: #febf10;
|
|
81
|
+
border: none;
|
|
82
|
+
color: #fff;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
font-size: 16px;
|
|
85
|
+
padding: 10px 26px;
|
|
86
|
+
border-radius: 8px;
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
export const AcceptButton = styled.button`
|
|
90
|
+
background-color: #febf10;
|
|
91
|
+
border: none;
|
|
92
|
+
|
|
93
|
+
color: #fff;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
font-size: 16px;
|
|
96
|
+
padding: 10px 26px;
|
|
97
|
+
border-radius: 8px;
|
|
98
|
+
margin-right: 8px;
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
export const DeclineButton = styled.button`
|
|
102
|
+
background-color: #f95454;
|
|
103
|
+
border: none;
|
|
104
|
+
color: #fff;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
font-size: 16px;
|
|
107
|
+
padding: 10px 26px;
|
|
108
|
+
border-radius: 8px;
|
|
109
|
+
`;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Friend Request List Component
|
|
2
|
+
|
|
3
|
+
The Friend Request List component is a reusable component in a React application that displays a list of friend requests.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
The component accepts the following props:
|
|
8
|
+
|
|
9
|
+
| Prop Name | Type | Description |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `friendRequests` | `array` | An array of objects representing friend requests. Each object should have the following properties: `id`, `profileImage`, `profileName`, and `userName`. |
|
|
12
|
+
| `onAdd` | `function` | A callback function that is called when the "Accept" button is clicked on a friend request. The function should take one argument, which is the object representing the user who sent the friend request. |
|
|
13
|
+
| `onDecline` | `function` | A callback function that is called when the "Decline" button is clicked on a friend request. The function should take one argument, which is the object representing the user who sent the friend request. |
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
To use the Friend Request List component, import it into your React component and render it like this:
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
import FriendRequestList from "./components/FriendRequestList";
|
|
21
|
+
|
|
22
|
+
function App() {
|
|
23
|
+
const friendRequests = [
|
|
24
|
+
{
|
|
25
|
+
id: 1,
|
|
26
|
+
profileImage: "https://via.placeholder.com/50",
|
|
27
|
+
profileName: "John Doe",
|
|
28
|
+
userName: "@johndoe",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 2,
|
|
32
|
+
profileImage: "https://via.placeholder.com/50",
|
|
33
|
+
profileName: "Jane Smith",
|
|
34
|
+
userName: "@janesmith",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 3,
|
|
38
|
+
profileImage: "https://via.placeholder.com/50",
|
|
39
|
+
profileName: "Bob Johnson",
|
|
40
|
+
userName: "@bobjohnson",
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
const onAdd = (user) => {
|
|
45
|
+
alert("Accepted: " + JSON.stringify(user));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const onDecline = (user) => {
|
|
49
|
+
alert("Declined: " + JSON.stringify(user));
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div>
|
|
54
|
+
<FriendRequestList
|
|
55
|
+
friendRequests={friendRequests}
|
|
56
|
+
onAdd={onAdd}
|
|
57
|
+
onDecline={onDecline}
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import FriendRequestCard from "../friendRequestCard";
|
|
4
|
+
import { Container, Header, RequestList, SeeLessButton } from "./styles";
|
|
5
|
+
import FriendImg from "../../../assets/friendrequest.png"
|
|
6
|
+
|
|
7
|
+
const FriendRequestList = ({ friendRequests, onAdd, onDecline }) => {
|
|
8
|
+
const [expanded, setExpanded] = useState(false);
|
|
9
|
+
const [numRequests, setNumRequests] = useState(1);
|
|
10
|
+
|
|
11
|
+
const handleSeeAllClick = () => {
|
|
12
|
+
setExpanded(true);
|
|
13
|
+
setNumRequests(friendRequests.length);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const handleCollapseClick = () => {
|
|
17
|
+
setExpanded(false);
|
|
18
|
+
setNumRequests(1);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Container>
|
|
23
|
+
<Header>
|
|
24
|
+
{expanded && <h2>Friend Requests</h2>}
|
|
25
|
+
|
|
26
|
+
{expanded && (
|
|
27
|
+
<SeeLessButton onClick={handleCollapseClick}>see less</SeeLessButton>
|
|
28
|
+
)}
|
|
29
|
+
</Header>
|
|
30
|
+
<RequestList>
|
|
31
|
+
{friendRequests.slice(0, numRequests).map((request, index) => (
|
|
32
|
+
<FriendRequestCard
|
|
33
|
+
key={index}
|
|
34
|
+
user={request}
|
|
35
|
+
seeAll={handleSeeAllClick}
|
|
36
|
+
onAdd={onAdd}
|
|
37
|
+
onDecline={onDecline}
|
|
38
|
+
count={
|
|
39
|
+
!expanded && numRequests >= 1 ? friendRequests.length - 1 : null
|
|
40
|
+
}
|
|
41
|
+
showAcceptDeclineButtons={
|
|
42
|
+
expanded || numRequests >= 1 || index === 0
|
|
43
|
+
}
|
|
44
|
+
showCountAndSeeAllButtons={!expanded && friendRequests.length > 1}
|
|
45
|
+
/>
|
|
46
|
+
))}
|
|
47
|
+
</RequestList>
|
|
48
|
+
</Container>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
FriendRequestList.propTypes = {
|
|
53
|
+
friendRequests: PropTypes.array.isRequired,
|
|
54
|
+
onAdd: PropTypes.func.isRequired,
|
|
55
|
+
onDecline: PropTypes.func.isRequired,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default FriendRequestList;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div`
|
|
4
|
+
/* padding: 16px; */
|
|
5
|
+
border-radius: 15px;
|
|
6
|
+
/* background: rgba(0, 194, 194, 0.20); */
|
|
7
|
+
`;
|
|
8
|
+
|
|
9
|
+
export const Header = styled.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
align-items: center;
|
|
13
|
+
margin-bottom: 16px;
|
|
14
|
+
h2 {
|
|
15
|
+
font-size: 20px;
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
export const RequestList = styled.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: 15px;
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
export const SeeLessButton = styled.button`
|
|
26
|
+
color: #FEBF10;
|
|
27
|
+
border: none;
|
|
28
|
+
background: none;
|
|
29
|
+
border-radius: 4px;
|
|
30
|
+
padding: 8px 16px;
|
|
31
|
+
font-size: 16px;
|
|
32
|
+
font-weight: bold;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
`;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Line } from "react-chartjs-2";
|
|
2
|
+
import { Chart as ChartJS } from "chart.js/auto";
|
|
3
|
+
|
|
4
|
+
const GraphChart = ({ width, height, activeTab }) => {
|
|
5
|
+
const days = ["Mon", "Tues", "Wed", "Thur", "Fri", "Sat", "Sun"];
|
|
6
|
+
const weeks = ["Week 1", "Week 2", "Week 3", "Week 4", "Week 5", "Week 6"];
|
|
7
|
+
|
|
8
|
+
const months = [
|
|
9
|
+
"Jan",
|
|
10
|
+
"Feb",
|
|
11
|
+
"Mar",
|
|
12
|
+
"Apr",
|
|
13
|
+
"May",
|
|
14
|
+
"Jun",
|
|
15
|
+
"Jul",
|
|
16
|
+
// "Aug",
|
|
17
|
+
// "Sep",
|
|
18
|
+
// "Oct",
|
|
19
|
+
// "Nov",
|
|
20
|
+
// "Dec",
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const barChartData = {
|
|
24
|
+
labels: activeTab === 1 ? days : activeTab === 2 ? weeks : months,
|
|
25
|
+
datasets: [
|
|
26
|
+
{
|
|
27
|
+
label: "",
|
|
28
|
+
fill: false,
|
|
29
|
+
// backgroundColor: ,
|
|
30
|
+
borderColor: "rgba(33, 213, 155, 1)",
|
|
31
|
+
borderCapStyle: "round",
|
|
32
|
+
borderJoinStyle: "miter",
|
|
33
|
+
tension: 0.4,
|
|
34
|
+
pointBorderColor: "rgba(0, 194, 194, 1)",
|
|
35
|
+
pointBackgroundColor: "#fff",
|
|
36
|
+
pointBorderWidth: 0.5,
|
|
37
|
+
pointHoverRadius: 10,
|
|
38
|
+
pointHoverBackgroundColor: "rgba(0, 194, 194, 1)",
|
|
39
|
+
pointHoverBorderColor: "rgba(255, 255, 255, 0.8)",
|
|
40
|
+
pointHoverBorderWidth: 8,
|
|
41
|
+
pointRadius: 0,
|
|
42
|
+
pointHitRadius: 10,
|
|
43
|
+
data: [200, 180, 300, 250, 450, 150, 300],
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const barChartOptions = {
|
|
49
|
+
responsive: true,
|
|
50
|
+
layout: {
|
|
51
|
+
padding: 10,
|
|
52
|
+
},
|
|
53
|
+
plugins: {
|
|
54
|
+
legend: {
|
|
55
|
+
display: false,
|
|
56
|
+
},
|
|
57
|
+
tooltip: {
|
|
58
|
+
usePointStyle: true,
|
|
59
|
+
backgroundColor: "#00C2C2",
|
|
60
|
+
bodyColor: "rgba(0, 0, 0, 1)",
|
|
61
|
+
titleColor: "rgba(0, 0, 0, 0.6)",
|
|
62
|
+
titleAlign: "center",
|
|
63
|
+
bodyAlign: "center",
|
|
64
|
+
footerAlign: "center",
|
|
65
|
+
yAlign: "bottom",
|
|
66
|
+
caretPadding: 15,
|
|
67
|
+
boxWidth: 100,
|
|
68
|
+
displayColors: false,
|
|
69
|
+
titleMarginBottom: 10,
|
|
70
|
+
titleSpacing: 15,
|
|
71
|
+
callbacks: {},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
scales: {
|
|
75
|
+
x: {
|
|
76
|
+
// type: "category",
|
|
77
|
+
ticks: {
|
|
78
|
+
color: "rgba(173, 178, 178, 1)",
|
|
79
|
+
fontSize: 12,
|
|
80
|
+
},
|
|
81
|
+
grid: {
|
|
82
|
+
lineWidth: 1,
|
|
83
|
+
display: false,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
y: {
|
|
87
|
+
display: true,
|
|
88
|
+
beginAtZero: true,
|
|
89
|
+
grid: {
|
|
90
|
+
display: true,
|
|
91
|
+
},
|
|
92
|
+
ticks: {
|
|
93
|
+
color: "rgba(173, 178, 178, 1)",
|
|
94
|
+
fontSize: 12,
|
|
95
|
+
display: false,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
animation: {
|
|
101
|
+
easing: "linear",
|
|
102
|
+
|
|
103
|
+
y: {
|
|
104
|
+
duration: 2000,
|
|
105
|
+
from: 500,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<Line
|
|
112
|
+
data={barChartData}
|
|
113
|
+
options={barChartOptions}
|
|
114
|
+
height={height}
|
|
115
|
+
width={width}
|
|
116
|
+
/>
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
export default GraphChart;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
GraphCard,
|
|
4
|
+
GraphCardBody,
|
|
5
|
+
GraphCardFooter,
|
|
6
|
+
GraphCardHeader,
|
|
7
|
+
} from "./index.styled";
|
|
8
|
+
import DatePicker from "react-datepicker";
|
|
9
|
+
import "react-datepicker/dist/react-datepicker.css";
|
|
10
|
+
import moment from "moment";
|
|
11
|
+
import { CalendarIcon } from "../../assets/svg/calendar";
|
|
12
|
+
import { DownloadIcon } from "../../assets/svg/download";
|
|
13
|
+
import GraphChart from "./graphData";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param {{
|
|
17
|
+
* onClick: function,
|
|
18
|
+
* style: CSSProperties,
|
|
19
|
+
* }} props - properties of Component
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
const GraphComponent = (props) => {
|
|
23
|
+
const [activeTab, setActiveTab] = useState(1);
|
|
24
|
+
const [dateRange, setDateRange] = useState({
|
|
25
|
+
startDate: new Date(),
|
|
26
|
+
endDate: new Date(),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<GraphCard style={props.style}>
|
|
31
|
+
<GraphCardHeader>
|
|
32
|
+
<div className="time-calc-wrapper">
|
|
33
|
+
<div className="total-time">
|
|
34
|
+
<h6> Total time (sec)</h6>
|
|
35
|
+
<h3> {props.totalTime}</h3>
|
|
36
|
+
</div>
|
|
37
|
+
<div className="projected-time">
|
|
38
|
+
<h6> Projected Time (sec) </h6>
|
|
39
|
+
<h3> {props.projectedTime} </h3>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
<div className="date-wrapper">
|
|
43
|
+
<div className="datepicker__wrapper">
|
|
44
|
+
<DatePicker
|
|
45
|
+
selected={dateRange.startDate}
|
|
46
|
+
startDate={dateRange.startDate}
|
|
47
|
+
dateFormat="d MMM yyyy"
|
|
48
|
+
onChange={(dates) =>
|
|
49
|
+
setDateRange({
|
|
50
|
+
...dateRange,
|
|
51
|
+
startDate: dates,
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
calendarClassName="datepicker_style"
|
|
55
|
+
/>
|
|
56
|
+
<CalendarIcon />
|
|
57
|
+
</div>
|
|
58
|
+
<span> to </span>
|
|
59
|
+
<div className="datepicker__wrapper">
|
|
60
|
+
<DatePicker
|
|
61
|
+
selected={dateRange.endDate}
|
|
62
|
+
endDate={dateRange.endDate}
|
|
63
|
+
dateFormat="d MMM yyyy"
|
|
64
|
+
onChange={(dates) =>
|
|
65
|
+
setDateRange({
|
|
66
|
+
...dateRange,
|
|
67
|
+
endDate: dates,
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
calendarClassName="datepicker_style"
|
|
71
|
+
/>
|
|
72
|
+
<CalendarIcon />
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div className="download__wrapper">
|
|
76
|
+
<DownloadIcon />
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</GraphCardHeader>
|
|
80
|
+
|
|
81
|
+
<GraphCardBody>
|
|
82
|
+
<GraphChart width={650} height={250} activeTab={activeTab} />
|
|
83
|
+
</GraphCardBody>
|
|
84
|
+
|
|
85
|
+
<GraphCardFooter>
|
|
86
|
+
<span
|
|
87
|
+
className={activeTab === 1 ? "active" : ""}
|
|
88
|
+
onClick={() => setActiveTab(1)}
|
|
89
|
+
>
|
|
90
|
+
D
|
|
91
|
+
</span>
|
|
92
|
+
|
|
93
|
+
<span
|
|
94
|
+
className={activeTab === 2 ? "active" : ""}
|
|
95
|
+
onClick={() => setActiveTab(2)}
|
|
96
|
+
>
|
|
97
|
+
W
|
|
98
|
+
</span>
|
|
99
|
+
|
|
100
|
+
<span
|
|
101
|
+
className={activeTab === 3 ? "active" : ""}
|
|
102
|
+
onClick={() => setActiveTab(3)}
|
|
103
|
+
>
|
|
104
|
+
M
|
|
105
|
+
</span>
|
|
106
|
+
</GraphCardFooter>
|
|
107
|
+
</GraphCard>
|
|
108
|
+
);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export default GraphComponent;
|