Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 25714b4

Browse files
committedMay 23, 2021
mocked searching
1 parent 285e957 commit 25714b4

File tree

6 files changed

+123
-11
lines changed

6 files changed

+123
-11
lines changed
 
Lines changed: 1 addition & 0 deletions
Loading

‎src/routes/InputSkills/components/Completeness/index.jsx

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,46 @@
11
import Button from "components/Button";
22
import React from "react";
3+
import cn from "classnames";
34
import CompleteProgress from "../CompleteProgress";
45
import "./styles.module.scss";
56
import IconListQuill from "../../../../assets/images/icon-list-quill.svg";
67

7-
function Completeness({ isDisabled }) {
8+
function Completeness({ isDisabled, onClick, buttonLabel, stage }) {
89
return (
910
<div styleName="completeness">
10-
<CompleteProgress percentDone={26} />
11+
<CompleteProgress
12+
percentDone={stage === 1 ? 26 : stage === 2 ? 52 : 98}
13+
/>
1114
<ul styleName="list">
12-
<li styleName="list-item done">Input Skills</li>
13-
<li styleName="list-item">Search Member</li>
14-
<li styleName="list-item">Overview of the Results</li>
15+
<li
16+
styleName={cn(
17+
"list-item",
18+
{ active: stage === 1 },
19+
{ done: stage > 1 }
20+
)}
21+
>
22+
Input Skills
23+
</li>
24+
<li
25+
styleName={cn(
26+
"list-item",
27+
{ active: stage === 2 },
28+
{ done: stage === 3 }
29+
)}
30+
>
31+
Search Member
32+
</li>
33+
<li styleName={cn("list-item", { active: stage === 3 })}>
34+
Overview of the Results
35+
</li>
1536
</ul>
16-
<Button size="medium" type="primary" disabled={isDisabled}>
17-
Search
37+
<Button
38+
size="medium"
39+
type="secondary"
40+
disabled={isDisabled}
41+
onClick={onClick}
42+
>
43+
{buttonLabel}
1844
</Button>
1945
<IconListQuill styleName="transparent-icon" />
2046
</div>

‎src/routes/InputSkills/components/Completeness/styles.module.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,20 @@
2929
float: left;
3030
}
3131

32-
&.done {
32+
&.active {
3333
font-weight: 700;
3434
&:before {
3535
background-color: #fff;
3636
}
3737
}
38+
39+
&.done {
40+
font-weight: 700;
41+
color: rgba(255, 255, 255, 0.6);
42+
&:before {
43+
content: "";
44+
}
45+
}
3846
}
3947

4048
.transparent-icon {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from "react";
2+
import "./styles.module.scss";
3+
import IconEarthSearch from "../../../../assets/images/icon-earth-search.svg";
4+
import CenteredSpinner from "components/CenteredSpinner";
5+
6+
function SearchCard() {
7+
return (
8+
<div styleName="search-card">
9+
<div styleName="heading">
10+
<IconEarthSearch />
11+
<h3>Search..</h3>
12+
<p>Matching the criteria with 1.5 million members around the world..</p>
13+
</div>
14+
<CenteredSpinner />
15+
</div>
16+
);
17+
}
18+
19+
export default SearchCard;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@import "styles/include";
2+
3+
.search-card {
4+
@include rounded-card;
5+
max-width: 746px;
6+
width: 50vw;
7+
margin-right: 30px;
8+
height: 80vh;
9+
}
10+
11+
.heading {
12+
display: flex;
13+
flex-direction: column;
14+
justify-content: flex-start;
15+
align-items: center;
16+
margin: 30px 0 30px 0;
17+
18+
svg {
19+
margin-bottom: 8px;
20+
}
21+
22+
h3 {
23+
@include font-barlow-condensed;
24+
text-transform: uppercase;
25+
font-size: 34px;
26+
margin-bottom: 8px;
27+
}
28+
29+
p {
30+
font-size: 14px;
31+
color: #555555;
32+
}
33+
}

‎src/routes/InputSkills/index.jsx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
import React, { useCallback, useState } from "react";
1+
import React, { useCallback, useEffect, useState } from "react";
22
import SkillsList from "./components/SkillsList";
33
import Completeness from "./components/Completeness";
44
import "./styles.module.scss";
55
import { useData } from "hooks/useData";
66
import { getSkills } from "services/skills";
77
import LoadingIndicator from "components/LoadingIndicator";
8+
import SearchCard from "./components/SearchCard";
89

910
function InputSkills() {
1011
const [selectedSkills, setSelectedSkills] = useState([]);
12+
const [searchState, setSearchState] = useState("done");
1113
const [skills, loadingError] = useData(getSkills);
1214

15+
let searchTimer;
16+
1317
const toggleSkill = useCallback(
1418
(id) => {
1519
if (selectedSkills.includes(id)) {
@@ -23,17 +27,38 @@ function InputSkills() {
2327
[selectedSkills]
2428
);
2529

30+
const search = () => {
31+
setSearchState("searching");
32+
searchTimer = setTimeout(() => {
33+
setSearchState("done");
34+
}, 2000);
35+
};
36+
37+
useEffect(() => clearTimeout(searchTimer));
38+
2639
return !skills ? (
2740
<LoadingIndicator error={loadingError} />
28-
) : (
41+
) : !searchState ? (
2942
<div styleName="page">
3043
<SkillsList
3144
skills={skills}
3245
selectedSkills={selectedSkills}
3346
toggleSkill={toggleSkill}
3447
/>
35-
<Completeness isDisabled={selectedSkills.length < 1} />
48+
<Completeness
49+
isDisabled={selectedSkills.length < 1}
50+
onClick={search}
51+
buttonLabel="Search"
52+
stage={1}
53+
/>
54+
</div>
55+
) : searchState === "searching" ? (
56+
<div styleName="page">
57+
<SearchCard />
58+
<Completeness isDisabled buttonLabel="Submit Request" stage={2} />
3659
</div>
60+
) : (
61+
<div>Done!</div>
3762
);
3863
}
3964

0 commit comments

Comments
 (0)
This repository has been archived.