Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 8771c8e

Browse files
authored
Merge pull request #506 from mbaghel/dev
For TaaS Intake #498 & #479
2 parents c64bcf9 + 7ba1427 commit 8771c8e

File tree

7 files changed

+79
-12
lines changed

7 files changed

+79
-12
lines changed

local/login-locally/package-lock.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/assets/images/trusted-logos.svg

+3
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* useLoadSkills hook
3+
*/
4+
import { useEffect, useState } from "react";
5+
import { flatten, partition } from "lodash";
6+
import { useData } from "hooks/useData";
7+
import { getSkills } from "services/skills";
8+
import { getRoles } from "services/roles";
9+
10+
/**
11+
* Hook which loads all skills and roles, then partitions skills based
12+
* on whether any role requires the given skill.
13+
*
14+
* @returns [skills, error] tuple with `skills` array and `error` object
15+
*/
16+
export const useLoadSkills = () => {
17+
const [skills, skillsError] = useData(getSkills);
18+
const [roles, rolesError] = useData(getRoles);
19+
const [partedSkills, setPartedSkills] = useState();
20+
21+
useEffect(() => {
22+
if (skills && roles) {
23+
const requiredSkills = new Set();
24+
roles.forEach((role) => {
25+
role.listOfSkills.forEach((skill) => {
26+
requiredSkills.add(skill);
27+
});
28+
});
29+
setPartedSkills(() =>
30+
flatten(partition(skills, (skill) => requiredSkills.has(skill.name)))
31+
);
32+
}
33+
}, [skills, roles]);
34+
35+
return [partedSkills, skillsError || rolesError];
36+
};

src/routes/CreateNewTeam/pages/CreateTaasPayment/index.jsx

+13-6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { calculateAmount } from "services/teams";
1313
import Progress from "../../components/Progress";
1414
import theme from "./theme";
1515
import FallbackIcon from "../../../../assets/images/icon-role-fallback.svg";
16+
import TrustedLogos from "../../../../assets/images/trusted-logos.svg";
1617
import "./styles.module.scss";
1718

1819
const stripePromise = loadStripe(process.env.STRIPE_PUBLIC_KEY);
@@ -163,12 +164,18 @@ const CreateTassPayment = () => {
163164
</div>
164165
</div>
165166

166-
<Progress
167-
stages={stages}
168-
extraStyleName="role-selection final-step"
169-
disabled="true"
170-
percentage="97"
171-
/>
167+
<div styleName="right-side">
168+
<Progress
169+
stages={stages}
170+
extraStyleName="role-selection final-step"
171+
disabled="true"
172+
percentage="97"
173+
/>
174+
<div styleName="trusted">
175+
<h6>Trusted By</h6>
176+
<TrustedLogos />
177+
</div>
178+
</div>
172179
</div>
173180
);
174181
};

src/routes/CreateNewTeam/pages/CreateTaasPayment/styles.module.scss

+17
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,20 @@
167167
}
168168
}
169169
}
170+
171+
.trusted {
172+
background-color: #FFF;
173+
border-radius: 8px;
174+
padding: 12px 10px 15px 10px;
175+
width: 250px;
176+
177+
h6 {
178+
@include font-barlow;
179+
font-weight: 600;
180+
text-align: center;
181+
color: #9D41C9;
182+
font-size: 16px;
183+
margin-bottom: 10px;
184+
text-transform: uppercase;
185+
}
186+
}

src/routes/CreateNewTeam/pages/InputSkills/index.jsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
*/
88
import React, { useCallback, useState } from "react";
99
import { useDispatch } from "react-redux";
10-
import { useData } from "hooks/useData";
1110
import { setIsLoading } from "../../actions";
1211
import SkillsList from "./components/SkillsList";
13-
import { getSkills } from "services/skills";
1412
import LoadingIndicator from "components/LoadingIndicator";
1513
import SkillListPopup from "../../components/SkillListPopup";
1614
import SearchAndSubmit from "../../components/SearchAndSubmit";
15+
import { useLoadSkills } from "../../hooks/useLoadSkills";
1716

1817
function InputSkills() {
1918
const dispatch = useDispatch();
@@ -26,7 +25,7 @@ function InputSkills() {
2625
const [popupSelectedSkills, setPopupSelectedSkills] = useState([]);
2726
const [popupOpen, setPopupOpen] = useState(false);
2827
const [isPopupLoading, setIsPopupLoading] = useState(false);
29-
const [skills, loadingError] = useData(getSkills);
28+
const [skills, loadingError] = useLoadSkills();
3029

3130
const toggleSkill = useCallback(
3231
(skill) => {

0 commit comments

Comments
 (0)