Skip to content

Commit

Permalink
[feat] create ProgressBar component
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonhongberkeley committed Nov 8, 2024
1 parent 3296bd8 commit e0a57cf
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
7 changes: 2 additions & 5 deletions app/onboarding/general/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
'use client';

import { useContext } from 'react';
import ProgressBar from '@/components/ProgressBar/ProgressBar';
import Back from '@/public/images/back.svg';
import { OnboardingContext } from '@/utils/onboardingContext';
import {
Expand All @@ -13,7 +14,6 @@ import {
Image,
InlineContainer,
Input,
Rectangle,
StyledLink,
Title,
} from '../styles';
Expand All @@ -38,12 +38,9 @@ export default function Onboarding() {
<Background>
<InlineContainer>
<Image src={Back} alt="Back icon" />
<div>
<Rectangle variant="light" widthPercentage="25%" />
<Rectangle variant="dark" widthPercentage="75%" />
</div>
<Container>
<Title>Tell us a bit about yourself!</Title>
<ProgressBar/>
<text>
{' '}
First Name <RedAsterisk>*</RedAsterisk>{' '}
Expand Down
8 changes: 3 additions & 5 deletions app/onboarding/preferences/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { useContext } from 'react';
import Link from 'next/link';
import ProgressBar from '@/components/ProgressBar/ProgressBar';
import Back from '@/public/images/back.svg';
import { OnboardingContext } from '@/utils/onboardingContext';
import {
Expand All @@ -13,7 +14,6 @@ import {
Image,
InlineContainer,
Input,
Rectangle,
Title,
} from '../styles';

Expand All @@ -35,12 +35,10 @@ export default function Onboarding() {
<Image src={Back} alt="Back icon" />
</Link>

<div>
<Rectangle variant="light" widthPercentage="50%" />
<Rectangle variant="dark" widthPercentage="50%" />
</div>
<Container>
<Title>Help us tailor shows to you!</Title>
<ProgressBar/>

<text>Facility Type</text>
<Input
name="facilityType"
Expand Down
4 changes: 2 additions & 2 deletions app/onboarding/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ export const Input = styled.input`
border-radius: 4px;
margin-bottom: 1.3rem;
margin-top: 0.25rem;
padding-left: 0.4rem;
padding-left: 0.5rem;
`;

export const Title = styled.h1`
font-size: 28px;
text-align: start;
color: ${COLORS.gray11};
margin-top: 0;
margin-bottom: 2rem;
margin-bottom: 0.8rem;
`;

export const ButtonContainer = styled.div`
Expand Down
16 changes: 16 additions & 0 deletions components/ProgressBar/ProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import * as styles from './styles';

const ProgressBar: React.FC = () => {

return (
<styles.ProgressBarContainer>
<styles.ProgressBarFiller progress={20}>

</styles.ProgressBarFiller>
</styles.ProgressBarContainer>
)

}

export default ProgressBar;
20 changes: 20 additions & 0 deletions components/ProgressBar/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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;
`;

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

0 comments on commit e0a57cf

Please sign in to comment.