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,154 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
CardContainer,
|
|
4
|
+
CardRightSection,
|
|
5
|
+
CardLeftSection,
|
|
6
|
+
} from "./index.styled";
|
|
7
|
+
import DropDownComponent from "../dropdown component";
|
|
8
|
+
import bannerImg from "./assets/learngual_developer_api_doc.png";
|
|
9
|
+
import { ArrowIcon, FolderOpenIcon, FolderCloseIcon } from "./assets/icons";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @param {{
|
|
13
|
+
* style: CSSProperties,
|
|
14
|
+
* }} props - properties of Component
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
const DevAPIdocs = (props) => {
|
|
18
|
+
const [activeTab, setActiveTab] = useState(0);
|
|
19
|
+
const documentationList = [
|
|
20
|
+
"Learngual API",
|
|
21
|
+
"Introduction",
|
|
22
|
+
"API Keys",
|
|
23
|
+
"API Regions",
|
|
24
|
+
"API Versioning",
|
|
25
|
+
"API Limits ",
|
|
26
|
+
"Terms of Service",
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const handleActiveTab = (idx) => {
|
|
30
|
+
setActiveTab(idx);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<CardContainer style={props.style}>
|
|
35
|
+
<CardLeftSection>
|
|
36
|
+
<h1> Documentation </h1>
|
|
37
|
+
<div className="docs__contents">
|
|
38
|
+
{documentationList.map((item, idx) => (
|
|
39
|
+
<p
|
|
40
|
+
className={activeTab === idx ? "active" : ""}
|
|
41
|
+
onClick={() => {
|
|
42
|
+
handleActiveTab(idx);
|
|
43
|
+
}}
|
|
44
|
+
key={idx}
|
|
45
|
+
>
|
|
46
|
+
{item}
|
|
47
|
+
</p>
|
|
48
|
+
))}
|
|
49
|
+
<div className="folder__structure">
|
|
50
|
+
<div className="folder__group">
|
|
51
|
+
<p>
|
|
52
|
+
<span>
|
|
53
|
+
<ArrowIcon /> <FolderCloseIcon />{" "}
|
|
54
|
+
</span>
|
|
55
|
+
v9 (Latest)
|
|
56
|
+
</p>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div className="folder__group folder__open_group">
|
|
60
|
+
<p>
|
|
61
|
+
<span>
|
|
62
|
+
<ArrowIcon /> <FolderOpenIcon />{" "}
|
|
63
|
+
</span>
|
|
64
|
+
v9 (Latest)
|
|
65
|
+
</p>
|
|
66
|
+
<div className="api__info">
|
|
67
|
+
<p>
|
|
68
|
+
<span className="api__type"> POST </span> Score a word or
|
|
69
|
+
sentence
|
|
70
|
+
</p>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</CardLeftSection>
|
|
76
|
+
|
|
77
|
+
<CardRightSection>
|
|
78
|
+
<div className="top__header">
|
|
79
|
+
<DropDownComponent
|
|
80
|
+
className="dropdown-content"
|
|
81
|
+
header="Environment"
|
|
82
|
+
inputPlaceHolder="Select"
|
|
83
|
+
dropdownData={[
|
|
84
|
+
{ name: "Option 1", value: "Option One" },
|
|
85
|
+
{ name: "Option 2", value: "Option Two" },
|
|
86
|
+
{ name: "Option 3", value: "Option Three" },
|
|
87
|
+
]}
|
|
88
|
+
/>
|
|
89
|
+
|
|
90
|
+
<DropDownComponent
|
|
91
|
+
className="dropdown-content"
|
|
92
|
+
header="Layout"
|
|
93
|
+
inputPlaceHolder="Select"
|
|
94
|
+
dropdownData={[
|
|
95
|
+
{ name: "Option 1", value: "Option One" },
|
|
96
|
+
{ name: "Option 2", value: "Option Two" },
|
|
97
|
+
{ name: "Option 3", value: "Option Three" },
|
|
98
|
+
]}
|
|
99
|
+
/>
|
|
100
|
+
|
|
101
|
+
<DropDownComponent
|
|
102
|
+
className="dropdown-content"
|
|
103
|
+
header="Language"
|
|
104
|
+
inputPlaceHolder="Select"
|
|
105
|
+
dropdownData={[
|
|
106
|
+
{ name: "Option 1", value: "Option One" },
|
|
107
|
+
{ name: "Option 2", value: "Option Two" },
|
|
108
|
+
{ name: "Option 3", value: "Option Three" },
|
|
109
|
+
]}
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<section className="details__section">
|
|
114
|
+
<h2> Learngual API </h2>
|
|
115
|
+
<img src={bannerImg} alt="Learngual Developer ApI" />
|
|
116
|
+
|
|
117
|
+
<p>
|
|
118
|
+
Speechace is a Speech Recognition API for fluency and pronunciation
|
|
119
|
+
assessment. Our patented technology is unique in its ability to
|
|
120
|
+
score a learner's speech and pinpoint individual syllable and
|
|
121
|
+
phoneme level mistakes in a user's pronunciation in real time.
|
|
122
|
+
</p>
|
|
123
|
+
|
|
124
|
+
<div className="new__section">
|
|
125
|
+
<h4> NEW! v9 Spontaneous Speech Scoring</h4>
|
|
126
|
+
<h4>
|
|
127
|
+
with Relevance Assessment & Comprehensive IELTS, PTE, TOEIC, CEFR
|
|
128
|
+
Speaking scores
|
|
129
|
+
</h4>
|
|
130
|
+
|
|
131
|
+
<p>
|
|
132
|
+
Speechace API v9.0 now supports transcription and assessment of
|
|
133
|
+
spontaneous speech questions in context if a given question
|
|
134
|
+
prompt. The API:{" "}
|
|
135
|
+
</p>
|
|
136
|
+
<p> Transcribes the audio response </p>
|
|
137
|
+
<p>
|
|
138
|
+
Evaluates Relevance of the response given a relevance_context{" "}
|
|
139
|
+
</p>
|
|
140
|
+
<p>
|
|
141
|
+
Evaluates: Pronunciation, Fluency, Coherence, Vocabulary, Grammar
|
|
142
|
+
</p>
|
|
143
|
+
<p>
|
|
144
|
+
Returns scores on multiple standard scales: IELTS, PTE, TOEIC,
|
|
145
|
+
CEFR See Transcribe & Score API for details.
|
|
146
|
+
</p>
|
|
147
|
+
</div>
|
|
148
|
+
</section>
|
|
149
|
+
</CardRightSection>
|
|
150
|
+
</CardContainer>
|
|
151
|
+
);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export default DevAPIdocs;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const CardContainer = styled.div`
|
|
4
|
+
background-color: rgba(255, 255, 255, 1);
|
|
5
|
+
font-family: "Nunito";
|
|
6
|
+
width: 100%;
|
|
7
|
+
border-radius: 30px;
|
|
8
|
+
display: flex;
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export const CardLeftSection = styled.div`
|
|
12
|
+
width: 26%;
|
|
13
|
+
background-color: rgba(0, 194, 194, 0.1);
|
|
14
|
+
padding: 41px 14px 30px 10px;
|
|
15
|
+
border-radius: 30px 0 0 30px;
|
|
16
|
+
transition: all 0.9s;
|
|
17
|
+
|
|
18
|
+
h1 {
|
|
19
|
+
font-size: 22px;
|
|
20
|
+
font-weight: 700;
|
|
21
|
+
color: #313333;
|
|
22
|
+
margin-bottom: 16px;
|
|
23
|
+
text-align: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
p {
|
|
27
|
+
color: #313333;
|
|
28
|
+
padding: 3px 10px;
|
|
29
|
+
font-size: 14px;
|
|
30
|
+
font-weight: 500;
|
|
31
|
+
margin-bottom: 15px;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
|
|
34
|
+
&.active {
|
|
35
|
+
background-color: rgba(0, 153, 153, 0.1);
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.folder__structure {
|
|
41
|
+
.folder__group {
|
|
42
|
+
margin-bottom: 8px;
|
|
43
|
+
transition: all 0.3s;
|
|
44
|
+
|
|
45
|
+
p,
|
|
46
|
+
span {
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
margin-bottom: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
p {
|
|
53
|
+
font-weight: 500;
|
|
54
|
+
font-size: 14px;
|
|
55
|
+
color: #313333;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
span {
|
|
59
|
+
margin-right: 6px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
svg {
|
|
63
|
+
margin-right: 12px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.api__info {
|
|
67
|
+
margin-left: 18px;
|
|
68
|
+
.api__type {
|
|
69
|
+
color: #e6ad0e;
|
|
70
|
+
margin-right: 5px;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.folder__open_group {
|
|
76
|
+
margin-left: 18px;
|
|
77
|
+
|
|
78
|
+
svg:first-child {
|
|
79
|
+
transform: rotate(90deg);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
export const CardRightSection = styled.div`
|
|
86
|
+
width: 74%;
|
|
87
|
+
padding: 21px 25px;
|
|
88
|
+
border-radius: 0 30px 30px 0;
|
|
89
|
+
|
|
90
|
+
.top__header {
|
|
91
|
+
display: flex;
|
|
92
|
+
column-gap: 15px;
|
|
93
|
+
margin-bottom: 17px;
|
|
94
|
+
|
|
95
|
+
h3 {
|
|
96
|
+
margin-bottom: 8px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.dropdown-content div {
|
|
100
|
+
height: 44px;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.details__section {
|
|
105
|
+
.new__section {
|
|
106
|
+
padding-top: 15px;
|
|
107
|
+
border-top: 1px solid #d9d9d9;
|
|
108
|
+
|
|
109
|
+
p {
|
|
110
|
+
margin-bottom: 0;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
img {
|
|
114
|
+
width: 100%;
|
|
115
|
+
margin-bottom: 17px;
|
|
116
|
+
}
|
|
117
|
+
h2 {
|
|
118
|
+
color: #313333;
|
|
119
|
+
font-weight: 600;
|
|
120
|
+
font-size: 24px;
|
|
121
|
+
margin-bottom: 14px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
h4 {
|
|
125
|
+
font-weight: 600;
|
|
126
|
+
font-size: 18px;
|
|
127
|
+
color: #000000;
|
|
128
|
+
margin-bottom: 15px;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
p {
|
|
132
|
+
color: #000000;
|
|
133
|
+
margin-bottom: 20px;
|
|
134
|
+
font-size: 13px;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
`;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { useState, CSSProperties, useEffect } from "react";
|
|
2
|
+
import {
|
|
3
|
+
ControlInput,
|
|
4
|
+
DropDownContainer,
|
|
5
|
+
DropDownContent,
|
|
6
|
+
DropDownControls,
|
|
7
|
+
DropDownHeader,
|
|
8
|
+
DropDownItem,
|
|
9
|
+
} from "./styles";
|
|
10
|
+
/**
|
|
11
|
+
* @param {{
|
|
12
|
+
* dropdownData: Array,
|
|
13
|
+
* header: string,
|
|
14
|
+
* searchable: boolean,
|
|
15
|
+
* className: string,
|
|
16
|
+
* onSelect: Function,
|
|
17
|
+
* inputPlaceHolder: string,
|
|
18
|
+
* }} props - properties of the dropdown component
|
|
19
|
+
*/
|
|
20
|
+
// dropdownData - Array of objects with property values of name and value
|
|
21
|
+
// header - this specifies the label of the dropdown
|
|
22
|
+
// searchable - property that includes search functionality or not
|
|
23
|
+
// className - if this one isn't self-explanatory, leave React.
|
|
24
|
+
// onSelect - this is a function that runs onselect and returns a selected object value.
|
|
25
|
+
// inputPlaceHolder - this is a placeholder for the dropdown
|
|
26
|
+
|
|
27
|
+
const DropDownComponent = (props) => {
|
|
28
|
+
// select state that dictates the current value.
|
|
29
|
+
const [selected, setSelected] = useState();
|
|
30
|
+
|
|
31
|
+
// dropdown state that dictates if dropdown is dropped or not.
|
|
32
|
+
const [dropdown, setDropdown] = useState();
|
|
33
|
+
|
|
34
|
+
//search params
|
|
35
|
+
const [searchParam, setSearchParam] = useState();
|
|
36
|
+
|
|
37
|
+
// useEffect to return a function value onChange
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
props?.onSelect && props?.onSelect(selected);
|
|
40
|
+
}, [selected]);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<DropDownContainer className={props?.className}>
|
|
44
|
+
<DropDownHeader>{props?.header}</DropDownHeader>
|
|
45
|
+
<DropDownControls>
|
|
46
|
+
{props?.searchable ? (
|
|
47
|
+
<ControlInput
|
|
48
|
+
placeholder={props?.inputPlaceHolder || "Select Dropdown"}
|
|
49
|
+
type="text"
|
|
50
|
+
onChange={(e) => {
|
|
51
|
+
setSearchParam(e.target.value);
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
54
|
+
) : (
|
|
55
|
+
<p onClick={() => setDropdown(!dropdown)}>{selected?.name}</p>
|
|
56
|
+
)}
|
|
57
|
+
<DownIcon onClick={() => setDropdown(!dropdown)} />
|
|
58
|
+
{searchParam && dropdown && (
|
|
59
|
+
<DropDownContent>
|
|
60
|
+
{props?.dropdownData?.map((dropdownItem, idx) => {
|
|
61
|
+
if (props?.dropdownData[idx]?.name?.includes(searchParam))
|
|
62
|
+
return (
|
|
63
|
+
<DropDownItem
|
|
64
|
+
key={idx}
|
|
65
|
+
onClick={() => {
|
|
66
|
+
setSelected(dropdownItem);
|
|
67
|
+
setDropdown();
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
<span>{dropdownItem?.name}</span>
|
|
71
|
+
{selected === dropdownItem && <Tick />}
|
|
72
|
+
</DropDownItem>
|
|
73
|
+
);
|
|
74
|
+
})}
|
|
75
|
+
</DropDownContent>
|
|
76
|
+
)}
|
|
77
|
+
{!searchParam && dropdown && (
|
|
78
|
+
<DropDownContent>
|
|
79
|
+
{props?.dropdownData?.map((dropdownItem, idx) => {
|
|
80
|
+
return (
|
|
81
|
+
<DropDownItem
|
|
82
|
+
key={idx}
|
|
83
|
+
onClick={() => {
|
|
84
|
+
setSelected(dropdownItem);
|
|
85
|
+
setDropdown();
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
<span>{dropdownItem?.name}</span>
|
|
89
|
+
{selected === dropdownItem && <Tick />}
|
|
90
|
+
</DropDownItem>
|
|
91
|
+
);
|
|
92
|
+
})}
|
|
93
|
+
</DropDownContent>
|
|
94
|
+
)}
|
|
95
|
+
</DropDownControls>
|
|
96
|
+
</DropDownContainer>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
export default DropDownComponent;
|
|
100
|
+
|
|
101
|
+
export const DownIcon = ({ width, height, fill, onClick }) => {
|
|
102
|
+
return (
|
|
103
|
+
<svg
|
|
104
|
+
width={width || "14"}
|
|
105
|
+
height={height || "8"}
|
|
106
|
+
viewBox="0 0 14 8"
|
|
107
|
+
fill="none"
|
|
108
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
109
|
+
onClick={onClick}
|
|
110
|
+
>
|
|
111
|
+
<path
|
|
112
|
+
d="M1 1L7 7L13 1"
|
|
113
|
+
stroke={fill || "#18191B"}
|
|
114
|
+
strokeWidth="2"
|
|
115
|
+
strokeLinecap="round"
|
|
116
|
+
strokeLinejoin="round"
|
|
117
|
+
/>
|
|
118
|
+
</svg>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
export const Tick = ({ size, stroke }) => {
|
|
122
|
+
return (
|
|
123
|
+
<svg
|
|
124
|
+
width={size || "16"}
|
|
125
|
+
height={size || "16"}
|
|
126
|
+
viewBox="0 0 16 16"
|
|
127
|
+
fill="none"
|
|
128
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
129
|
+
>
|
|
130
|
+
<path
|
|
131
|
+
d="M12.3828 4.23828L5.82031 11.7383L3.00781 8.92578"
|
|
132
|
+
stroke={stroke || "white"}
|
|
133
|
+
stroke-width="1.5"
|
|
134
|
+
stroke-linecap="round"
|
|
135
|
+
stroke-linejoin="round"
|
|
136
|
+
/>
|
|
137
|
+
</svg>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import(
|
|
3
|
+
"https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;0,1000;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900;1,1000&display=swap"
|
|
4
|
+
);
|
|
5
|
+
|
|
6
|
+
export const DropDownContainer = styled.div`
|
|
7
|
+
width: 100%;
|
|
8
|
+
`;
|
|
9
|
+
|
|
10
|
+
export const DropDownHeader = styled.h3`
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
font-family: "Nunito", sans-serif;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
color: #313333;
|
|
15
|
+
`;
|
|
16
|
+
|
|
17
|
+
export const DropDownControls = styled.div`
|
|
18
|
+
display: flex;
|
|
19
|
+
border: 1px solid rgba(49, 51, 51, 1);
|
|
20
|
+
border-radius: 12px;
|
|
21
|
+
align-items: center;
|
|
22
|
+
padding: 11px 20px;
|
|
23
|
+
position: relative;
|
|
24
|
+
p {
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
font-family: "Nunito", sans-serif;
|
|
27
|
+
width: 100%;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
margin: 0;
|
|
30
|
+
}
|
|
31
|
+
svg {
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
export const ControlInput = styled.input`
|
|
37
|
+
font-size: 16px;
|
|
38
|
+
font-family: "Nunito", sans-serif;
|
|
39
|
+
max-width: 100%;
|
|
40
|
+
width: 100%;
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
outline: none;
|
|
43
|
+
border: none;
|
|
44
|
+
cursor: caret;
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
export const DropDownContent = styled.ul`
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 25px;
|
|
50
|
+
left: 0;
|
|
51
|
+
list-style-type: none;
|
|
52
|
+
padding-left: 20px;
|
|
53
|
+
width: 100%;
|
|
54
|
+
padding: 4px;
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
export const DropDownItem = styled.li`
|
|
58
|
+
font-family: "Nunito", sans-serif;
|
|
59
|
+
padding: 4px;
|
|
60
|
+
font-size: 14px;
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: space-between;
|
|
64
|
+
background: #f5f7f7;
|
|
65
|
+
svg {
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
path {
|
|
68
|
+
stroke: rgba(49, 51, 51, 1);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
&:hover {
|
|
72
|
+
color: white;
|
|
73
|
+
background: rgba(0, 194, 194, 1);
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
transition: background 0.4s;
|
|
76
|
+
svg {
|
|
77
|
+
path {
|
|
78
|
+
stroke: white;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# FriendRequestCard Component
|
|
2
|
+
|
|
3
|
+
The `FriendRequestCard` component is a reusable React component that renders a card displaying information about a friend request. It takes in several props:
|
|
4
|
+
|
|
5
|
+
- `user`: an object representing the user who sent the friend request. It has the following properties:
|
|
6
|
+
- `id`: a unique identifier for the user
|
|
7
|
+
- `profileImage`: a URL pointing to the user's profile image
|
|
8
|
+
- `profileName`: the user's full name
|
|
9
|
+
- `userName`: the user's username
|
|
10
|
+
- `count`: an integer representing the number of friend requests the user has received. This prop is optional and is only used when the card is being displayed in a list of friend requests.
|
|
11
|
+
- `seeAll`: a callback function that is called when the user clicks the "See All" button. This prop is optional and is only used when the card is being displayed in a list of friend requests.
|
|
12
|
+
- `showCountAndSeeAllButtons`: a boolean indicating whether the "count" and "see all" buttons should be displayed. This prop is optional and is only used when the card is being displayed in a list of friend requests.
|
|
13
|
+
- `showAcceptDeclineButtons`: a boolean indicating whether the "accept" and "decline" buttons should be displayed. This prop is optional and is only used when the card is being displayed individually (i.e., not in a list of friend requests).
|
|
14
|
+
- `onAdd`: a callback function that is called when the user clicks the "Accept" button. It takes in the `user` object as an argument.
|
|
15
|
+
- `onDecline`: a callback function that is called when the user clicks the "Decline" button. It takes in the `user` object as an argument.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
import FriendRequestCard from "./FriendRequestCard";
|
|
21
|
+
|
|
22
|
+
const user = {
|
|
23
|
+
id: 1,
|
|
24
|
+
profileImage: "https://via.placeholder.com/50",
|
|
25
|
+
profileName: "John Doe",
|
|
26
|
+
userName: "@johndoe",
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const handleAdd = (user) => {
|
|
30
|
+
console.log("Accepted:", user);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const handleDecline = (user) => {
|
|
34
|
+
console.log("Declined:", user);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const Example = () => {
|
|
38
|
+
return (
|
|
39
|
+
<FriendRequestCard
|
|
40
|
+
user={user}
|
|
41
|
+
count={3}
|
|
42
|
+
seeAll={() => console.log("See all clicked")}
|
|
43
|
+
showCountAndSeeAllButtons={true}
|
|
44
|
+
showAcceptDeclineButtons={false}
|
|
45
|
+
onAdd={handleAdd}
|
|
46
|
+
onDecline={handleDecline}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import {
|
|
4
|
+
AcceptButton,
|
|
5
|
+
ButtonContainer,
|
|
6
|
+
CardContainer,
|
|
7
|
+
CardText,
|
|
8
|
+
CountButton,
|
|
9
|
+
DeclineButton,
|
|
10
|
+
Header,
|
|
11
|
+
ProfileImage,
|
|
12
|
+
ProfileName,
|
|
13
|
+
SeeAllButton,
|
|
14
|
+
UserName,
|
|
15
|
+
Wrapper,
|
|
16
|
+
} from "./styles";
|
|
17
|
+
|
|
18
|
+
const FriendRequestCard = ({
|
|
19
|
+
user,
|
|
20
|
+
count,
|
|
21
|
+
showCountAndSeeAllButtons,
|
|
22
|
+
showAcceptDeclineButtons,
|
|
23
|
+
onAdd,
|
|
24
|
+
onDecline,
|
|
25
|
+
seeAll,
|
|
26
|
+
}) => {
|
|
27
|
+
return (
|
|
28
|
+
<Wrapper>
|
|
29
|
+
{/* {showCountAndSeeAllButtons && <Header>Friend Request</Header>
|
|
30
|
+
} */}
|
|
31
|
+
<Header>Friend Request</Header>
|
|
32
|
+
<CardContainer multiple={showCountAndSeeAllButtons}>
|
|
33
|
+
<ProfileImage src={user?.profileImage} alt={user?.profileName} />
|
|
34
|
+
<CardText>
|
|
35
|
+
<ProfileName>{user?.profileName}</ProfileName>
|
|
36
|
+
<UserName>
|
|
37
|
+
{user?.userName} <small>Sent you a friend</small>
|
|
38
|
+
</UserName>
|
|
39
|
+
</CardText>
|
|
40
|
+
{showCountAndSeeAllButtons && (
|
|
41
|
+
<ButtonContainer>
|
|
42
|
+
<CountButton> + {count} Others</CountButton>
|
|
43
|
+
{seeAll && <SeeAllButton onClick={seeAll}>See All</SeeAllButton>}
|
|
44
|
+
</ButtonContainer>
|
|
45
|
+
)}
|
|
46
|
+
{showAcceptDeclineButtons && !showCountAndSeeAllButtons && (
|
|
47
|
+
<ButtonContainer>
|
|
48
|
+
<DeclineButton onClick={() => onDecline(user)}>
|
|
49
|
+
Decline
|
|
50
|
+
</DeclineButton>
|
|
51
|
+
<AcceptButton onClick={() => onAdd(user)}>Accept</AcceptButton>
|
|
52
|
+
</ButtonContainer>
|
|
53
|
+
)}
|
|
54
|
+
</CardContainer>
|
|
55
|
+
</Wrapper>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
FriendRequestCard.propTypes = {
|
|
60
|
+
user: PropTypes.shape({
|
|
61
|
+
profileImage: PropTypes.string,
|
|
62
|
+
profileName: PropTypes.string,
|
|
63
|
+
userName: PropTypes.string,
|
|
64
|
+
}).isRequired,
|
|
65
|
+
count: PropTypes.number,
|
|
66
|
+
showCountAndSeeAllButtons: PropTypes.bool,
|
|
67
|
+
showAcceptDeclineButtons: PropTypes.bool,
|
|
68
|
+
onAdd: PropTypes.func,
|
|
69
|
+
onDecline: PropTypes.func,
|
|
70
|
+
seeAll: PropTypes.func,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
FriendRequestCard.defaultProps = {
|
|
74
|
+
count: 0,
|
|
75
|
+
showCountAndSeeAllButtons: false,
|
|
76
|
+
showAcceptDeclineButtons: false,
|
|
77
|
+
onAdd: () => {},
|
|
78
|
+
onDecline: () => {},
|
|
79
|
+
seeAll: null,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default FriendRequestCard;
|