diff --git a/.circleci/config.yml b/.circleci/config.yml index dd4e516..0cb6119 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -77,7 +77,6 @@ workflows: branches: only: - dev - - bugbash # Production builds are exectuted only on tagged commits to the # master branch. diff --git a/src/App.jsx b/src/App.jsx index 99f5bb3..2869c97 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -2,18 +2,20 @@ * Main App component */ import React, { useState, useLayoutEffect, useEffect, useRef } from "react"; -import { Router, useLocation, redirectTo } from "@reach/router"; +import { Router, useLocation, Redirect } from "@reach/router"; import Challenges from "./containers/Challenges"; import Filter from "./containers/Filter"; +import MyGigs from "./containers/MyGigs"; import Menu from "./components/Menu"; import { disableSidebarForRoute } from "@topcoder/micro-frontends-navbar-app"; -import Button from "./components/Button"; import * as constants from "./constants"; import actions from "./actions"; import * as utils from "./utils"; import store from "./store"; import { initialChallengeFilter } from "./reducers/filter"; import _ from "lodash"; +import { usePreviousLocation } from "./utils/hooks"; +import { useSelector } from "react-redux"; import "react-date-range/dist/theme/default.css"; import "react-date-range/dist/styles.css"; @@ -23,6 +25,7 @@ import "./styles/main.scss"; const App = () => { const [selectedMenuItem, setSelectedMenuItem] = useState(null); + const isLoggedIn = useSelector((state) => state.lookup.isLoggedIn); useLayoutEffect(() => { disableSidebarForRoute("/earn/*"); @@ -31,42 +34,58 @@ const App = () => { const menu = ( { setSelectedMenuItem(item); }} + isLoggedIn={isLoggedIn} /> ); const location = useLocation(); + const previousLocation = usePreviousLocation(); const getChallengesDebounced = useRef(_.debounce((f) => f(), 500)); useEffect(() => { - if (!location.search) { - store.dispatch(actions.challenges.getChallenges(initialChallengeFilter)); - return; - } + store.dispatch(actions.lookup.checkIsLoggedIn()); + }, []); + + useEffect(() => { + if (location.pathname === "/earn/find/challenges") { + if (!location.search) { + store.dispatch( + actions.challenges.getChallenges(initialChallengeFilter) + ); + return; + } - //if (location.pathname === "/earn/find/challenges") { - const params = utils.url.parseUrlQuery(location.search); - const toUpdate = utils.challenge.createChallengeFilter(params); + const params = utils.url.parseUrlQuery(location.search); + const toUpdate = utils.challenge.createChallengeFilter(params); - if (!toUpdate.types) toUpdate.types = []; - if (!toUpdate.tracks) toUpdate.tracks = []; - if (!toUpdate.bucket) toUpdate.bucket = ""; + if (!toUpdate.types) toUpdate.types = []; + if (!toUpdate.tracks) toUpdate.tracks = []; + if (!toUpdate.bucket) toUpdate.bucket = ""; - const updatedFilter = { ...initialChallengeFilter, ...toUpdate }; - const currentFilter = store.getState().filter.challenge; - const diff = !_.isEqual(updatedFilter, currentFilter); - if (diff) { - store.dispatch(actions.filter.updateFilter(updatedFilter)); + const updatedFilter = { ...initialChallengeFilter, ...toUpdate }; + const currentFilter = store.getState().filter.challenge; + const diff = !_.isEqual(updatedFilter, currentFilter); + if (diff) { + store.dispatch(actions.filter.updateFilter(updatedFilter)); + } + getChallengesDebounced.current(() => + store.dispatch(actions.challenges.getChallenges(updatedFilter)) + ); + } + }, [location]); + + const varsRef = useRef(); + varsRef.current = { previousLocation }; + + useEffect(() => { + if (location.pathname !== varsRef.current.previousLocation.pathname) { + window.scrollTo(0, 0); } - getChallengesDebounced.current(() => - store.dispatch(actions.challenges.getChallenges(updatedFilter)) - ); - //} }, [location]); useEffect(() => { @@ -82,29 +101,34 @@ const App = () => { }, [location]); return ( -
- -
- - -
-
+
+ ); }; diff --git a/src/actions/index.js b/src/actions/index.js index ac92d9b..a9295ac 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -2,10 +2,12 @@ import challenges from "./challenges"; import filter from "./filter"; import lookup from "./lookup"; import init from "./initApp"; +import myGigs from "./myGigs"; export default { challenges, filter, lookup, init, + myGigs, }; diff --git a/src/actions/lookup.js b/src/actions/lookup.js index 83d0bc4..01a7811 100644 --- a/src/actions/lookup.js +++ b/src/actions/lookup.js @@ -9,12 +9,17 @@ async function getCommunityList() { return service.getCommunityList(); } -async function isLoggedIn() { - return service.isLoggedIn(); +async function checkIsLoggedIn() { + return service.checkIsLoggedIn(); +} + +async function getGigPhases() { + return service.getGigPhases(); } export default createActions({ GET_TAGS: getTags, GET_COMMUNITY_LIST: getCommunityList, - IS_LOGGED_IN: isLoggedIn, + CHECK_IS_LOGGED_IN: checkIsLoggedIn, + GET_GIG_PHASES: getGigPhases, }); diff --git a/src/actions/myGigs.js b/src/actions/myGigs.js new file mode 100644 index 0000000..ad3bf11 --- /dev/null +++ b/src/actions/myGigs.js @@ -0,0 +1,15 @@ +import { createActions } from "redux-actions"; +import service from "../services/myGigs"; + +async function getMyGigs() { + return service.getMyGigs(); +} + +async function loadMoreMyGigs() { + return service.loadMoreMyGigs(); +} + +export default createActions({ + GET_MY_GIGS: getMyGigs, + LOAD_MORE_MY_GIGS: loadMoreMyGigs, +}); diff --git a/src/assets/data/my-gigs.json b/src/assets/data/my-gigs.json new file mode 100644 index 0000000..f77e85a --- /dev/null +++ b/src/assets/data/my-gigs.json @@ -0,0 +1,745 @@ +{ + "phases":[ + "Applied", + "Phone Screen", + "Screen Pass", + "Interview Process", + "Selected", + "Offered", + "Placed" + ], + "phaseActions":[ + "check email", + "stand by", + "round", + "follow-up by email" + ], + "phaseTooltips":{ + "Applied":"They clicked submit on an application and no one has looked at their resume yet.", + "Phone Screen":"You either need to or have scheduled a phone screen with a Topcoder Screener.", + "Screen Pass":"You are selected by the client and an offer letter should follow shortly.", + "Interview Process":"You need to schedule or an interview has been scheduled with the client.", + "Selected":"You are selected by the client and an offer letter should follow shortly.", + "Offered":"An offer letter was sent.", + "Placed":"An offer was accepted and onboarding will begin soon." + }, + "phaseStatuses": [ + "Passed", + "Active" + ], + "myGigs":[ + { + "label":"INTERVIEW PROCESS", + "title":"Google voice assistance architect - part time", + "paymentRangeFrom":800, + "paymentRangeTo":1000, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"Any Location", + "duration":7, + "hours":40, + "workingHours":"US hours", + "note":"The interview has not been scheduled yet.", + "phase": "Interview Process", + "phaseNote":"You need to schedule or an interview has been scheduled with the client", + "phaseAction":"check email", + "phaseStatus":"Active", + "phaseInterviewRound":null, + "phasenterviewRoundStartsIn":null, + "previous":"Screen Pass", + "previousNote":"You had your resume reviewed and passed the phone screen.", + "next":"Interview Process", + "nextNote":"You need to schedule or an interview has been scheduled with the client." + }, + { + "label":"SCREEN PASS", + "title":"Databricks and Python engineer", + "paymentRangeFrom":820, + "paymentRangeTo":1020, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India Only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Congratulation! You passed the phone screening. We’ll keep you update on the next steps.", + "phase": "Screen Pass", + "phaseNote":"You are selected by the client and an offer letter should follow shortly", + "phaseAction":"stand by", + "phaseStatus":"Active", + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous": "Phone Screen", + "previousNote":"You had your resume reviewed.", + "next":"Screen Pass", + "nextNote":"You are selected by the client and an offer letter should follow shortly." + }, + { + "label":"PHONE SCREEN", + "title":"Senior Flutter professional", + "paymentRangeFrom":1250, + "paymentRangeTo":1650, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"Any Location", + "duration":12, + "hours":40, + "workingHours":"US hours", + "note":"The phone screen has not been scheduled yet.", + "phase": "Phone Screen", + "phaseNote":"You either need to or have scheduled a phone screen with a Topcoder Screener", + "phaseAction":"check email", + "phaseStatus":"Active", + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous": "Applied", + "previousNote":"Your application was sent to the client.", + "next":"Phone Screen", + "nextNote":"You either need to or have scheduled a phone screen with a Topcoder Screener." + }, + { + "label":"APPLIED", + "title":"Back end developer -Spring Boot & microservices", + "paymentRangeFrom":820, + "paymentRangeTo":1020, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India Only", + "duration":12, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":"stand by", + "phaseStatus":"Active", + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous": "", + "previousNote":"", + "next":"APPLIED", + "nextNote":"Your application was sent to the client. If we find a match, we will contact you for the next steps." + }, + { + "label":"INTERVIEW PROCESS", + "title":"Google voice assistance architect - part time", + "paymentRangeFrom":800, + "paymentRangeTo":1000, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"Any Location", + "duration":7, + "hours":40, + "workingHours":"US hours", + "note":"Round 1 scheduled for May 20, 2021 11:00 EST.", + "phase": "Interview Process", + "phaseNote":"", + "phaseAction":"round", + "phaseStatus":"Active", + "phaseInterviewRound":1, + "phaseInterviewRoundStartsIn":"2d:6h:30m", + "previous":"Screen Pass", + "previousNote":"You had your resume reviewed and passed the phone screen.", + "next":"Interview Process", + "nextNote":"" + }, + { + "label":"SELECTED", + "title":"Google voice assistance architect - part time", + "paymentRangeFrom":800, + "paymentRangeTo":1000, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"Any Location", + "duration":7, + "hours":40, + "workingHours":"US hours", + "note":"Congratulations! You are selected by the client and an offer letter should follow shortly.", + "phase": "Selected", + "phaseNote":"", + "phaseAction":"follow-up by email", + "phaseStatus":"Active", + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"Interview Process", + "previousNote":"", + "next":"Selected", + "nextNote":"" + }, + { + "label":"OFFERED", + "title":"Google voice assistance architect - part time", + "paymentRangeFrom":800, + "paymentRangeTo":1000, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"Any Location", + "duration":7, + "hours":40, + "workingHours":"US hours", + "note":"An offer letter was sent! Please check your email.", + "phase": "Offered", + "phaseNote":"", + "phaseAction":"check email", + "phaseStatus":"Active", + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"Selected", + "previousNote":"", + "next":"Offered", + "nextNote":"" + }, + { + "label":"PLACED", + "title":"Google voice assistance architect - part time", + "paymentRangeFrom":800, + "paymentRangeTo":1000, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"Any Location", + "duration":7, + "hours":40, + "workingHours":"US hours", + "note":"An offer was accepted and onboarding will begin soon!", + "phase": "Placed", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"Offered", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"NOT SELECTED", + "title":"Senior Tableau designer/developer", + "paymentRangeFrom":1650, + "paymentRangeTo":2050, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"Any Location", + "duration":52, + "hours":40, + "workingHours":"US hours", + "note":"Thank you for your interest in this gig. The client has now selected his preferred candidate for this position.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":"Active", + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"Applied", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"NOT SELECTED", + "title":"Google cloud data engineer", + "paymentRangeFrom":1650, + "paymentRangeTo":2050, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"Any Location", + "duration":52, + "hours":40, + "workingHours":"US hours", + "note":"Thank you for your interest in this gig. The client has now selected his preferred candidate for this position.", + "phase": "Interview Process", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"Screen Pass", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Kafka developer", + "paymentRangeFrom":1250, + "paymentRangeTo":1650, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Full stack Java developer", + "paymentRangeFrom":1250, + "paymentRangeTo":1650, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"Any Location", + "duration":12, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Engineer - Fullstack", + "paymentRangeFrom":2550, + "paymentRangeTo":2950, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"United States Only", + "duration":52, + "hours":40, + "workingHours":"PST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Cloud Dev-Ops engineer", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Handson architect", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Senior backend developer", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India Only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Senior fullstack developer", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Backend developer - Google Cloud", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Frontend developer", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Senior Angular developer", + "paymentRangeFrom":1250, + "paymentRangeTo":1650, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"Any Location", + "duration":26, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Front End developer", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India or Southeast Asia", + "duration":32, + "hours":40, + "workingHours":"Any", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Senior Springboot developer", + "paymentRangeFrom":1250, + "paymentRangeTo":1650, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"Any Location", + "duration":26, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Backend developer", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India or Southeast Asia", + "duration":31, + "hours":40, + "workingHours":"Any", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Backend developer", + "paymentRangeFrom":820, + "paymentRangeTo":1020, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India Only", + "duration":26, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Senior software development engineer – Java", + "paymentRangeFrom":1650, + "paymentRangeTo":2050, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"Any Location", + "duration":20, + "hours":40, + "workingHours":"IST or US time Zone", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"UI developer [Core Java + Spring Boot + GraphQL]", + "paymentRangeFrom":820, + "paymentRangeTo":1020, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India Only", + "duration":13, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Fullstack developer(Angular)", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India Only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Fullstack Developer", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India Only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Frontend developer", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India Only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Java developer", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India Only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + }, + { + "label":"APPLIED", + "title":"Backend developer", + "paymentRangeFrom":660, + "paymentRangeTo":860, + "paymentRangeRateType":"week", + "paymentRangeCurrency":"USD", + "location":"India Only", + "duration":52, + "hours":40, + "workingHours":"IST", + "note":"Your application was sent to the client. If we find a match, we will contact you for the next steps.", + "phase": "Applied", + "phaseNote":"", + "phaseAction":null, + "phaseStatus":null, + "phaseInterviewRound":null, + "phaseInterviewRoundStartsIn":null, + "previous":"", + "previousNote":"", + "next":"", + "nextNote":"" + } + ] +} diff --git a/src/assets/icons/button-chevron-down.svg b/src/assets/icons/button-chevron-down.svg new file mode 100644 index 0000000..5a7b79d --- /dev/null +++ b/src/assets/icons/button-chevron-down.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/icons/checkpoint-small.png b/src/assets/icons/checkpoint-small.png new file mode 100644 index 0000000..ebdccec Binary files /dev/null and b/src/assets/icons/checkpoint-small.png differ diff --git a/src/assets/icons/checkpoint.png b/src/assets/icons/checkpoint.png new file mode 100644 index 0000000..59bd14b Binary files /dev/null and b/src/assets/icons/checkpoint.png differ diff --git a/src/assets/icons/note.png b/src/assets/icons/note.png new file mode 100644 index 0000000..d5e89cb Binary files /dev/null and b/src/assets/icons/note.png differ diff --git a/src/assets/images/celebrate.png b/src/assets/images/celebrate.png new file mode 100644 index 0000000..df84165 Binary files /dev/null and b/src/assets/images/celebrate.png differ diff --git a/src/components/Button/index.jsx b/src/components/Button/index.jsx index ea9c7c2..0e689b5 100644 --- a/src/components/Button/index.jsx +++ b/src/components/Button/index.jsx @@ -3,23 +3,28 @@ import PT from "prop-types"; import "./styles.scss"; -const Button = ({ children, onClick, primary }) => ( +const Button = ({ children, onClick, isPrimary, isText, size }) => ( ); Button.defaultProps = { - primary: false, + isPrimary: false, + disabled: false, }; Button.propTypes = { children: PT.node, onClick: PT.func, - primary: PT.bool, + isPrimary: PT.bool, }; export default Button; diff --git a/src/components/Button/styles.scss b/src/components/Button/styles.scss index 88f1d74..37fe065 100644 --- a/src/components/Button/styles.scss +++ b/src/components/Button/styles.scss @@ -22,5 +22,16 @@ background-color: $green; } -.button-lg {} -.button-sm {} +.button-text { + padding: 0; + letter-spacing: 1px; + color: inherit; + border: none; + background: none; +} + +.button-lg { + padding: 12px 20px; + font-size: $font-size-sm; + border-radius: 20px; +} diff --git a/src/components/Menu/index.jsx b/src/components/Menu/index.jsx index b582ccb..9129201 100644 --- a/src/components/Menu/index.jsx +++ b/src/components/Menu/index.jsx @@ -9,18 +9,25 @@ import "./styles.scss"; let cnt = 0; -const Menu = ({ menu, icons, selected, onSelect }) => { +const Menu = ({ menu, selected, onSelect, isLoggedIn }) => { const selectionRef = useRef( - new utils.menu.MenuSelection(menu, selected, onSelect) + new utils.menu.MenuSelection(_.cloneDeep(menu), selected, onSelect) ); - const [__, setStateChange] = useState(0); + const [, setStateChange] = useState(0); useEffect(() => { - selectionRef.current.selectedMenuItem = selected; + selectionRef.current.select(selected); setStateChange(cnt++); }, [selected]); + useEffect(() => { + if (selectionRef.current.isAuth(selected) && isLoggedIn === false) { + utils.auth.logIn(); + } + }, [selected, isLoggedIn]); + const navigateTo = useNavigate(); + const onSelectMenuItem = (name, path) => { selectionRef.current.select(name); setStateChange(cnt++); @@ -30,38 +37,37 @@ const Menu = ({ menu, icons, selected, onSelect }) => { }; const getIcon = (menuItem, active) => { - const name = icons[menuItem][active ? 1 : 0]; + const name = active ? menuItem.iconActive : menuItem.icon; return utils.icon.getMenuIcon(name); }; - const isExpandable = (name) => !selectionRef.current.isLeaf(name); - const isSelected = (name) => selectionRef.current.isSelected(name); - const isExpanded = (name) => selectionRef.current.isExpanded(name); - const isActive = (name) => selectionRef.current.isActive(name); + const isExpandable = (menuItem) => + selectionRef.current.isExpandable(menuItem); + const isSelected = (menuItem) => selectionRef.current.isSelected(menuItem); + const isExpanded = (menuItem) => selectionRef.current.isExpanded(menuItem); + const isActive = (menuItem) => selectionRef.current.isActive(menuItem); - const renderSubSubmenu = (submenu, key) => { - if (!submenu[key]) { - return null; - } - const subSubmenu = submenu[key]; + const renderSubSubmenu = (subMenuItem) => { return (