-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added success theme for icon and label * fixed spacing * updated icons package, modified progress page, add different colors * removed duplicate button * code cleanup * merged from main * removed continue button * made font and connector smaller for phone view, change font based on dark/light mode * rearrange test to correct order, code cleanup on component' * removed unused variables, formatted with prettier, changed component name * removed unused import
- Loading branch information
Showing
3 changed files
with
130 additions
and
65 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,80 @@ | ||
import { FC } from "react"; | ||
import { Stepper, Typography, Step, StepLabel } from "@mui/material"; | ||
import CheckCircleIcon from "@mui/icons-material/CheckCircle"; | ||
import RadioButtonUncheckedIcon from "@mui/icons-material/RadioButtonUnchecked"; | ||
|
||
const MemoryTestsLabels = [ | ||
{ | ||
name: "Memory - Immediate Recall" | ||
}, | ||
{ | ||
name: 'Visual Paired Associates - Learn' | ||
}, | ||
{ | ||
name: "Choice Reaction Time" | ||
}, | ||
{ | ||
name: 'Visual Paired Associates - Test' | ||
}, | ||
{ | ||
name: "Digit Symbol Matching" | ||
}, | ||
{ | ||
name: "Spatial Memory" | ||
}, | ||
{ | ||
name: "Memory - Delayed Recall" | ||
} | ||
]; | ||
|
||
interface ProgressTrackerProps { | ||
id: number; | ||
} | ||
|
||
export const ProgressTracker: FC<ProgressTrackerProps> = (props) => { | ||
//check for Dark/Light Mode | ||
const dark_light_color = () => { | ||
if (window.matchMedia("(prefers-color-scheme: dark").matches) { | ||
return "#ffffff"; | ||
} else { | ||
return "#000000"; | ||
} | ||
}; | ||
|
||
return ( | ||
<Stepper activeStep={props.id} orientation="vertical" sx={{ padding: 2 }}> | ||
{MemoryTestsLabels.map((step, index) => ( | ||
<Step key={index}> | ||
<StepLabel | ||
icon={ | ||
props.id > index ? ( | ||
<CheckCircleIcon fontSize="inherit" /> | ||
) : ( | ||
<RadioButtonUncheckedIcon | ||
fontSize="inherit" | ||
sx={{ color: props.id >= index ? "#ffffff" : "#808080" }} | ||
/> | ||
) | ||
} | ||
sx={{ color: props.id <= index ? "#ffffff" : "#009933" }} | ||
> | ||
<Typography | ||
variant="subtitle1" | ||
color={ | ||
props.id <= index | ||
? props.id === index | ||
? dark_light_color | ||
: "#808080" | ||
: "#009933" | ||
} | ||
overflow={"visible"} | ||
sx={{ padding: 0.5 }} | ||
> | ||
{step.name} | ||
</Typography> | ||
</StepLabel> | ||
</Step> | ||
))} | ||
</Stepper> | ||
); | ||
}; |
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