Skip to content

Commit

Permalink
import ProgressBar into onboarding flow
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonhongberkeley committed Dec 28, 2024
1 parent c02c18f commit ffe7df9
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 62 deletions.
8 changes: 2 additions & 6 deletions app/onboarding/additional-info/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { useContext } from 'react';
import { useRouter } from 'next/navigation';
import ProgressBar from '@/components/ProgressBar/ProgressBar';
import Back from '@/public/images/back.svg';
import { OnboardingContext } from '@/utils/onboardingContext';
import {
Expand All @@ -15,8 +16,6 @@ import {
InlineContainer,
InputContainer,
Label,
ProgressBarContainer,
Rectangle,
SkipButton,
SkipText,
Title,
Expand Down Expand Up @@ -63,10 +62,7 @@ export default function Onboarding() {
<br />
you&apos;d like to add?
</Title>
<ProgressBarContainer>
<Rectangle variant="dark" width="70%" />
<Rectangle variant="light" width="30%" />
</ProgressBarContainer>
<ProgressBar progress={80} />
<Container>
<InputContainer>
<Label>Additional Information</Label>
Expand Down
8 changes: 2 additions & 6 deletions app/onboarding/basic-information/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import { useContext } from 'react';
import { useRouter } from 'next/navigation';
import ProgressBar from '@/components/ProgressBar/ProgressBar';
import Back from '@/public/images/back.svg';
import { OnboardingContext } from '@/utils/onboardingContext';
import {
Expand All @@ -18,8 +19,6 @@ import {
Input,
InputContainer,
Label,
ProgressBarContainer,
Rectangle,
Title,
} from '../styles';
import { RedAsterisk, UpdateContainer, UpdateText } from './styles';
Expand Down Expand Up @@ -62,10 +61,7 @@ export default function Onboarding() {
<Image src={Back} alt="Back icon" />
</BackButton>
<Title $fontWeight={500}>Can you tell us a bit about yourself?</Title>
<ProgressBarContainer>
<Rectangle variant="dark" width="25%" />
<Rectangle variant="light" width="75%" />
</ProgressBarContainer>
<ProgressBar progress={20} />
<Container>
<InputContainer>
<Label>
Expand Down
8 changes: 2 additions & 6 deletions app/onboarding/performance/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useContext } from 'react';
import { useRouter } from 'next/navigation';
import InputDropdown from '@/components/InputDropdown/InputDropdown';
import ProgressBar from '@/components/ProgressBar/ProgressBar';
import Back from '@/public/images/back.svg';
import { OnboardingContext } from '@/utils/onboardingContext';
import {
Expand All @@ -14,8 +15,6 @@ import {
ContinueText,
Image,
InlineContainer,
ProgressBarContainer,
Rectangle,
SkipButton,
SkipText,
Title,
Expand Down Expand Up @@ -102,10 +101,7 @@ export default function Onboarding() {
<br />
perform?
</Title>
<ProgressBarContainer>
<Rectangle variant="dark" width="50%" />
<Rectangle variant="light" width="50%" />
</ProgressBarContainer>
<ProgressBar progress={60} />
<Container>
<InputDropdown
label="Type of Performance"
Expand Down
7 changes: 2 additions & 5 deletions app/onboarding/review/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useContext } from 'react';
import { useRouter } from 'next/navigation';
import { submitOnboardingData } from '@/api/supabase/queries/onboarding';
import ProgressBar from '@/components/ProgressBar/ProgressBar';
import Back from '@/public/images/back.svg';
import { SMALL } from '@/styles/text';
import { OnboardingContext } from '@/utils/onboardingContext';
Expand All @@ -12,8 +13,6 @@ import {
Image,
InlineContainer,
Label,
ProgressBarContainer,
Rectangle,
StyledLink,
Title,
} from '../styles';
Expand Down Expand Up @@ -52,9 +51,7 @@ export default function Review() {
<Image src={Back} alt="Back icon" />
</BackButton>
<Title $fontWeight={500}>Did we get everything?</Title>
<ProgressBarContainer>
<Rectangle variant="dark" width="100%" />
</ProgressBarContainer>
<ProgressBar progress={100} />
<ReviewContainer>
<Label>First Name</Label>
<SmallText>{displayValue(generalInfo.firstName)}</SmallText>
Expand Down
8 changes: 2 additions & 6 deletions app/onboarding/role-selection/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useContext } from 'react';
import { useRouter } from 'next/navigation';
import RoleSelector from '@/components/RoleSelector/RoleSelector';
import ProgressBar from '@/components/ProgressBar/ProgressBar';
import Back from '@/public/images/back.svg';
import Help from '@/public/images/help.svg';
import Star from '@/public/images/star.svg';
Expand All @@ -14,8 +15,6 @@ import {
ContinueText,
Image,
InlineContainer,
ProgressBarContainer,
Rectangle,
RoleContainer,
Title,
} from '../styles';
Expand Down Expand Up @@ -53,10 +52,7 @@ export default function Onboarding() {
<br />
your role?
</Title>
<ProgressBarContainer>
<Rectangle variant="dark" width="0%" />
<Rectangle variant="light" width="100%" />
</ProgressBarContainer>
<ProgressBar progress={0} />
<RoleContainer>
<RoleSelector
isSelected={role.isPerformer}
Expand Down
8 changes: 2 additions & 6 deletions app/onboarding/show-preference/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useContext } from 'react';
import { useRouter } from 'next/navigation';
import InputDropdown from '@/components/InputDropdown/InputDropdown';
import ProgressBar from '@/components/ProgressBar/ProgressBar';
import Back from '@/public/images/back.svg';
import { OnboardingContext } from '@/utils/onboardingContext';
import {
Expand All @@ -14,8 +15,6 @@ import {
ContinueText,
Image,
InlineContainer,
ProgressBarContainer,
Rectangle,
SkipButton,
SkipText,
Title,
Expand Down Expand Up @@ -88,10 +87,7 @@ export default function Onboarding() {
<br />
preferences?
</Title>
<ProgressBarContainer>
<Rectangle variant="dark" width="50%" />
<Rectangle variant="light" width="50%" />
</ProgressBarContainer>
<ProgressBar progress={40} />
<Container>
<InputDropdown
label="Facility Types"
Expand Down
15 changes: 0 additions & 15 deletions app/onboarding/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,6 @@ export const Image = styled(NextImage)`
margin-bottom: 16px;
`;

export const ProgressBarContainer = styled.div`
width: 100%;
`;

export const Rectangle = styled.div<{
variant: 'light' | 'dark';
width: string;
}>`
width: ${({ width }) => width};
height: 2px;
display: inline-block;
background: ${({ variant }) =>
variant === 'light' ? COLORS.gray4 : COLORS.gray12};
`;

export const Container = styled.main`
display: flex;
flex-direction: column;
Expand Down
14 changes: 6 additions & 8 deletions components/ProgressBar/ProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React from 'react';
import * as styles from './styles';
import { ProgressBarContainer, ProgressBarFiller } from './styles';

const ProgressBar: React.FC = () => {
export default function ProgressBar({ progress }: { progress: number }) {
return (
<styles.ProgressBarContainer>
<styles.ProgressBarFiller progress={20}></styles.ProgressBarFiller>
</styles.ProgressBarContainer>
<ProgressBarContainer>
<ProgressBarFiller progress={progress}></ProgressBarFiller>
</ProgressBarContainer>
);
};

export default ProgressBar;
}
6 changes: 2 additions & 4 deletions components/ProgressBar/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@ import styled from 'styled-components';
import COLORS from '@/styles/colors';

export const ProgressBarContainer = styled.div`
display: inline;
width: 100%;
height: 2px;
background-color: ${COLORS.gray4};
border-radius: 2px;
margin-bottom: 2rem;
margin-top: 1.5rem;
`;

export const ProgressBarFiller = styled.div<{
progress: number;
}>`
height: 100%;
width: ${props => props.progress}%;
height: 100%;
background-color: ${COLORS.gray12};
transition: width 0.25s ease-in-out;
`;

0 comments on commit ffe7df9

Please sign in to comment.