MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / Progress

Function Progress

console/src/platform/shell/Tutorial.tsx:1416–1452  ·  view source on GitHub ↗
({ min, max, value, onStepClick, ...rest }: ProgressProps)

Source from the content-addressed store, hash-verified

1414const PROGRESS_STEP_SPACING = 1;
1415
1416const Progress = ({ min, max, value, onStepClick, ...rest }: ProgressProps) => {
1417 const { colors } = useTheme<MaterializeTheme>();
1418 const steps: boolean[] = [];
1419
1420 for (let i = min; i < max; i++) {
1421 steps.push(i <= value);
1422 }
1423
1424 return (
1425 <HStack {...rest} spacing={PROGRESS_STEP_SPACING}>
1426 {steps.map((filled, idx) => {
1427 return (
1428 <Box
1429 key={idx}
1430 flexGrow="1"
1431 height="1"
1432 borderRadius="2px"
1433 transition="all 0.2s"
1434 bgColor={filled ? colors.accent.purple : colors.background.tertiary}
1435 onClick={() => onStepClick(idx)}
1436 cursor={value !== idx ? "pointer" : "auto"}
1437 title={value !== idx ? `Jump to step ${idx + 1}` : ""}
1438 sx={{
1439 _hover: {
1440 backgroundColor: colors.accent.purple,
1441 boxShadow:
1442 value !== idx
1443 ? `0px 0px 3px 1px ${colors.accent.purple}`
1444 : "none",
1445 },
1446 }}
1447 />
1448 );
1449 })}
1450 </HStack>
1451 );
1452};
1453
1454type TutorialProps = GridItemProps & {
1455 runCommand: (command: string) => void;

Callers 13

fetch_nextMethod · 0.85
run_workerMethod · 0.85
render_decode_cdcv2Function · 0.85
by_seedMethod · 0.85
by_seedMethod · 0.85
by_seedMethod · 0.85
by_seedMethod · 0.85
by_seedMethod · 0.85
by_seedMethod · 0.85
notify_progressMethod · 0.85
next_syncMethod · 0.85
report_progressMethod · 0.85

Calls 2

pushMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected