-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/depromeet/15th-Team2-Web
- Loading branch information
Showing
26 changed files
with
384 additions
and
37 deletions.
There are no files selected for viewing
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,15 @@ | ||
import Script from 'next/script'; | ||
|
||
export const Clarity = () => { | ||
return ( | ||
<Script id="clarity" type="text/javascript"> | ||
{` | ||
(function(c,l,a,r,i,t,y){ | ||
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; | ||
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; | ||
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); | ||
})(window, document, "clarity", "script", "o2k3nk4cvl"); | ||
`} | ||
</Script> | ||
); | ||
}; |
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 @@ | ||
export * from './clarity'; |
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
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
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,101 @@ | ||
'use client'; | ||
|
||
import '../../features/on-boarding/steps.css'; | ||
|
||
import Link from 'next/link'; | ||
import { cloneElement, ReactElement } from 'react'; | ||
import { CSSTransition, TransitionGroup } from 'react-transition-group'; | ||
|
||
import { Button } from '@/components/atoms'; | ||
import { BackButton, HeaderBar } from '@/components/molecules'; | ||
import { | ||
ProgressIndicator, | ||
SkipButton, | ||
Steps, | ||
stepsIntroduce, | ||
useProgressIndicator, | ||
} from '@/features/on-boarding'; | ||
import { css } from '@/styled-system/css'; | ||
|
||
export default function OnBoarding() { | ||
const { step, handlers } = useProgressIndicator(); | ||
return ( | ||
<div className={layoutStyles.total}> | ||
<HeaderBar | ||
className={css({ | ||
marginBottom: '43px', | ||
})} | ||
innerClassName={css({ backgroundColor: 'background.gray!' })} | ||
> | ||
<HeaderBar.LeftContent> | ||
<BackButton /> | ||
</HeaderBar.LeftContent> | ||
<HeaderBar.CenterContent> | ||
<ProgressIndicator step={step} /> | ||
</HeaderBar.CenterContent> | ||
<HeaderBar.RightContent> | ||
{[ | ||
{ | ||
component: ( | ||
<SkipButton label="๊ฑด๋๋ฐ๊ธฐ" onClick={handlers.skip} /> | ||
), | ||
key: 'skipButton', | ||
}, | ||
]} | ||
</HeaderBar.RightContent> | ||
</HeaderBar> | ||
<TransitionGroup | ||
component={null} | ||
childFactory={(child: ReactElement) => { | ||
return cloneElement(child, { | ||
classNames: 'fade', | ||
}); | ||
}} | ||
> | ||
<CSSTransition key={step} timeout={200}> | ||
<Steps current={step} /> | ||
</CSSTransition> | ||
</TransitionGroup> | ||
<div className={layoutStyles.button}> | ||
{step < stepsIntroduce.length - 1 ? ( | ||
<Button | ||
buttonType="secondary" | ||
variant="outlined" | ||
size="large" | ||
label="๋ค์" | ||
interaction="normal" | ||
onClick={() => handlers.next()} | ||
className={css({ w: 'full' })} | ||
/> | ||
) : ( | ||
<Link href="/"> | ||
<Button | ||
buttonType="primary" | ||
variant="solid" | ||
size="large" | ||
label="์์ํ๊ธฐ" | ||
interaction="normal" | ||
className={css({ w: 'full' })} | ||
/> | ||
</Link> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
const layoutStyles = { | ||
total: css({ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
backgroundColor: 'background.gray', | ||
height: '100dvh', | ||
}), | ||
button: css({ | ||
w: 'full', | ||
maxWidth: 'maxWidth', | ||
position: 'fixed', | ||
bottom: 'calc(15px + env(safe-area-inset-bottom))', | ||
padding: '0 20px', | ||
}), | ||
}; |
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
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
This file was deleted.
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 @@ | ||
export * from './skip-button'; |
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,20 @@ | ||
import { css } from '@/styled-system/css'; | ||
|
||
interface SkipButtonProps { | ||
label: string; | ||
onClick: () => void; | ||
} | ||
|
||
export function SkipButton({ label, onClick }: SkipButtonProps) { | ||
return ( | ||
<button onClick={onClick} className={skipButtonStyles}> | ||
{label} | ||
</button> | ||
); | ||
} | ||
|
||
const skipButtonStyles = css({ | ||
textStyle: 'label1.normal', | ||
color: 'text.alternative', | ||
fontWeight: 500, | ||
}); |
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,2 @@ | ||
export * from './atoms'; | ||
export * from './molecules'; |
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,2 @@ | ||
export * from './progress-indicator'; | ||
export * from './steps'; |
40 changes: 40 additions & 0 deletions
40
features/on-boarding/components/molecules/progress-indicator.tsx
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,40 @@ | ||
import { css, cva } from '@/styled-system/css'; | ||
import { flex } from '@/styled-system/patterns'; | ||
|
||
import { stepsIntroduce } from '../../constants'; | ||
|
||
interface ProgressIndicatorProps { | ||
step: number; | ||
} | ||
|
||
export function ProgressIndicator({ step }: ProgressIndicatorProps) { | ||
return ( | ||
<div className={progressIndicatorStyles}> | ||
{Array.from({ length: stepsIntroduce.length }, (_, i) => ( | ||
<IndicatorDot key={i} selected={step === i} /> | ||
))} | ||
</div> | ||
); | ||
} | ||
|
||
interface IndicatorDotProps { | ||
selected: boolean; | ||
} | ||
|
||
function IndicatorDot({ selected }: IndicatorDotProps) { | ||
return <div className={css(indicatorDotStyles.raw({ selected }))} />; | ||
} | ||
|
||
const progressIndicatorStyles = flex({ | ||
gap: '6px', | ||
}); | ||
|
||
const indicatorDotStyles = cva({ | ||
base: { display: 'flex', width: '6px', height: '6px', borderRadius: 'full' }, | ||
variants: { | ||
selected: { | ||
true: { backgroundColor: 'blue.70' }, | ||
false: { backgroundColor: 'line.neutral' }, | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.