Skip to content

Commit

Permalink
Welcome component improvements (#854)
Browse files Browse the repository at this point in the history
Ref: #851

This PR adds improvements to welcome component:
- loop videos,
- clickable step dots - each dot redirect to it's own step,
- larger video box,
- remove bottom border in video.
  • Loading branch information
kkosiorowska authored Nov 13, 2024
2 parents 3e6c741 + bb26f4b commit 874d42c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions dapp/src/components/WelcomeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,14 @@ const stepIndicatorStyleProps: StepIndicatorProps = {
bgColor: "orange.50",
position: "relative",
opacity: "0.15",
_hover: {
cursor: "pointer",
},
}

function WelcomeModalBase({ closeModal }: BaseModalProps) {
// Cast to fix eslint error: `unbound-method`.
const { activeStep, goToNext } = useSteps({
const { activeStep, goToNext, setActiveStep } = useSteps({
index: 0,
count: steps.length,
}) as UseStepsReturn & { goToNext: () => void }
Expand Down Expand Up @@ -159,7 +162,7 @@ function WelcomeModalBase({ closeModal }: BaseModalProps) {
>
<Stepper index={activeStep} gap="3">
{steps.map((step) => (
<Step key={step.id}>
<Step key={step.id} onClick={() => setActiveStep(step.id)}>
<StepIndicator {...stepIndicatorStyleProps} />
</Step>
))}
Expand All @@ -175,12 +178,15 @@ function WelcomeModalBase({ closeModal }: BaseModalProps) {
<Box
as="video"
src={activeStepData.video}
width="xs"
width="24rem"
height="full"
autoPlay
muted
loop
objectFit="cover"
roundedRight="xl"
outline="1px solid #f6ead5"
outlineOffset="-1px"
/>
</SimpleGrid>
</>
Expand Down
2 changes: 1 addition & 1 deletion dapp/src/theme/Modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const variants = {
}

const sizeXl = multiStyleConfig.definePartsStyle({
dialog: { maxW: "50.75rem" },
dialog: { maxW: "52rem" },
})

const sizeLg = multiStyleConfig.definePartsStyle({
Expand Down

0 comments on commit 874d42c

Please sign in to comment.