-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'lfglabs-dev:testnet' into fix-#969
- Loading branch information
Showing
29 changed files
with
595 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import theme from "@/styles/theme"; | ||
|
||
export const getStepColor = (currentStep: number, step: number): string => { | ||
if (currentStep > step) return theme.palette.primary.main; | ||
if (currentStep === step) return theme.palette.secondary.main; | ||
return theme.palette.grey[200]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React from "react"; | ||
import styles from "../../../styles/components/registerV3.module.css"; | ||
import DoneFilledIcon from "@/components/UI/iconsComponents/icons/doneFilledIcon"; | ||
import theme from "@/styles/theme"; | ||
|
||
type StepProps = { | ||
stepIndex: number; | ||
currentStep: number; | ||
setStep: (step: number) => void; | ||
icon: React.ReactNode; | ||
label: string; | ||
showDoneIcon?: boolean; | ||
allowSwitchAnytime?: boolean; | ||
}; | ||
|
||
const Step: React.FC<StepProps> = ({ | ||
stepIndex, | ||
currentStep, | ||
setStep, | ||
icon, | ||
label, | ||
showDoneIcon = true, | ||
allowSwitchAnytime = false, | ||
}) => { | ||
const getStep = (currentStep: number, stepIndex: number): string => { | ||
if (currentStep > stepIndex) | ||
return allowSwitchAnytime ? styles.unselectedStep : styles.passedStep; | ||
if (currentStep === stepIndex) return styles.activeStep; | ||
return allowSwitchAnytime ? styles.unselectedStep : styles.disabledStep; | ||
}; | ||
|
||
const getStepColor = (currentStep: number, step: number): string => { | ||
if (currentStep > step) | ||
return allowSwitchAnytime ? "" : theme.palette.primary.main; | ||
if (currentStep === step) | ||
return allowSwitchAnytime ? "" : theme.palette.secondary.main; | ||
return theme.palette.grey[200]; | ||
}; | ||
|
||
return ( | ||
<div | ||
className={`${styles.step} ${getStep(currentStep, stepIndex)}`} | ||
onClick={() => | ||
(allowSwitchAnytime || currentStep >= stepIndex) && setStep(stepIndex) | ||
} | ||
> | ||
<div className={styles.stepContent}> | ||
{React.cloneElement(icon as React.ReactElement, { | ||
width: "20", | ||
color: getStepColor(currentStep, stepIndex), | ||
})} | ||
<p className={styles.stepText}>{label}</p> | ||
</div> | ||
{showDoneIcon && currentStep > stepIndex && ( | ||
<DoneFilledIcon | ||
width="16" | ||
secondColor={theme.palette.primary.main} | ||
color="#FFF" | ||
/> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Step; |
Oops, something went wrong.