Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[온보딩] STEP06 마지막 온보딩 뷰 구현 #81

Closed
wants to merge 10 commits into from
3 changes: 3 additions & 0 deletions public/svg/ic_kakao_share.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/assets/svg/IcKakaoShare.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { SVGProps } from 'react';
const SvgIcKakaoShare = (props: SVGProps<SVGSVGElement>) => (
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 18 19' {...props}>
<path
fill='#000'
fillRule='evenodd'
d='M9 1.1c-4.97 0-9 3.113-9 6.952 0 2.388 1.558 4.493 3.932 5.745l-.999 3.648c-.088.322.28.579.563.392l4.377-2.889q.555.055 1.127.057c4.97 0 9-3.113 9-6.953C18 4.213 13.97 1.1 9 1.1'
clipRule='evenodd'
/>
</svg>
);
export default SvgIcKakaoShare;
3 changes: 2 additions & 1 deletion src/assets/svg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export { default as IcGift } from './IcGift';
export { default as IcGroup } from './IcGroup';
export { default as IcImg } from './IcImg';
export { default as IcImgAdd } from './IcImgAdd';
export { default as IcKakaoShare } from './IcKakaoShare';
export { default as IcKakaoSmall } from './IcKakaoSmall';
export { default as IcKakoLarge } from './IcKakoLarge';
export { default as IcLeft } from './IcLeft';
Expand All @@ -36,7 +37,7 @@ export { default as IcUnselectedCalender } from './IcUnselectedCalender';
export { default as IcUnselectedClock } from './IcUnselectedClock';
export { default as IcUp } from './IcUp';
export { default as IcUser } from './IcUser';
export { default as Logotype } from './Logotype';
export { default as Logo } from './Logo';
export { default as LogoSweet } from './LogoSweet';
export { default as Logotype } from './Logotype';
export { default as Vite } from './Vite';
1 change: 1 addition & 0 deletions src/components/common/title/Title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as S from './Title.style';
interface TitleProps {
title: string;
userName?: string;
customStyle?: React.CSSProperties;
}

const Title = ({ title, userName }: TitleProps) => {
Expand Down
107 changes: 107 additions & 0 deletions src/components/onboarding/step06/Step06.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import styled from 'styled-components';
import imageSample from './image_sample.png';

export const Wrapper = styled.div`
${({ theme }) => theme.mixin.flexBox({ align: 'center', justify: 'center' })}
width: 100%;
border-bottom: 0.1rem solid ${({ theme }) => theme.colors.G_02};
position: relative;
overflow: hidden;
`;

export const GradientImg = styled.div`
background-image: url(${imageSample});
background-size: cover;
background-blend-mode: overlay;
opacity: 0.7;
/* 이렇게 height를 의도적으로 주는 방법밖에 없나... 하 */
height: 36.5rem;
width: 100%;
position: relative;

&::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 100%);
z-index: 1;
}
`;

export const TitleContainer = styled.div`
${({ theme }) => theme.mixin.flexBox({ direction: 'column', align: 'flex-start' })}
position: absolute;
bottom: 0;
left: 0;
right: 0;
text-align: center;
color: white;
z-index: 999;
gap: 1.6rem;
margin-left: 2rem;
`;
Comment on lines +35 to +45
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스타일 속성 개행해서 정리 한 번 하면 좋을 것 같아요~!


export const InfoWrapper = styled.div`
${({ theme }) =>
theme.mixin.inlineFlexBox({ direction: 'column', align: 'center', justify: 'center' })};
gap: 1.2rem;
width: 100%;
height: 12.8rem;
margin-top: 2.8rem;
`;

export const InfoDetailWrapper = styled.div`
${({ theme }) =>
theme.mixin.flexBox({ direction: 'row', align: 'center', justify: 'space-between' })};
gap: 5rem;
width: 31.5rem;
`;

export const InfoTitle = styled.p`
color: ${({ theme }) => theme.colors.G_07};
${({ theme }) => theme.fonts.body_10};
`;

export const InfoDetail = styled.p`
color: ${({ theme }) => theme.colors.black};
${({ theme }) => theme.fonts.body_07};
`;

export const KakaoLinkCopyBtn = styled.button`
${({ theme }) =>
theme.mixin.flexCenter({ direction: 'row', align: 'center', justify: 'center' })};
width: 16.3rem;
padding: 1.5rem 2.2rem 1.6rem 2.2rem;
gap: 1rem;

border-radius: 10rem;
border: none;
background: #fee500;
color: (0, 0, 0, 0.85);
${({ theme }) => theme.fonts.body_09};
`;

export const BtnWrapper = styled.div`
${({ theme }) =>
theme.mixin.flexCenter({ direction: 'row', align: 'center', justify: 'center' })};
gap: 1.2rem;
width: 100%;
margin-top: 1.7rem;
`;

export const LinkCopyBtn = styled.button`
${({ theme }) =>
theme.mixin.flexCenter({ direction: 'row', align: 'center', justify: 'center' })};
width: 16.3rem;
padding: 1.5rem 2.2rem 1.6rem 2.2rem;
gap: 1rem;

border-radius: 10rem;
border: none;
background: ${({ theme }) => theme.colors.G_02};
color: (0, 0, 0, 0.85);
${({ theme }) => theme.fonts.body_09};
`;
52 changes: 52 additions & 0 deletions src/components/onboarding/step06/Step06.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import Title from '../../common/title/Title';
import BtnNext from '../../common/Button/Next/BtnNext';
import * as S from './Step06.style';
import { IcKakaoShare, IcLink } from '../../../assets/svg';

const OnboardingFinal = () => {
// TODO 추후 이전 STEP에서 유저가 입력한 값으로 변경
const infoDetails = [
{ title: '선물 받을 사람', detail: '가나다라마바사아자차님' },
{ title: '선물 등록 마감', detail: '2023.12.29(금) 13시' },
{ title: '토너먼트 진행 시간', detail: '6시간' },
{ title: '선물 전달일', detail: '2023.12.31(일)' },
];

return (
<>
<S.Wrapper>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

죠히 컨벤션 컴포넌트명 + wrapper로 변경해주시면 넘넘 좋을 것 같습니당!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

흐아... 맞다.. 마음이 급하니까 자꾸 지적해주시는 부분을 적용을 못하네요. 수정하겠습니다!!!

<S.GradientImg>
<S.TitleContainer>
<div>
<Title userName='가나다라마사아자차' title='님을 위한' />
<Title title='선물 준비방이 개설됐어요' />
</div>
{/* TODO 추후 지민이 버튼으로 변경(항상 활성화) */}
<BtnNext customStyle={{ marginBottom: '1.6rem' }} disabled={false}>
입장
</BtnNext>
</S.TitleContainer>
</S.GradientImg>
</S.Wrapper>
<S.InfoWrapper>
{infoDetails.map((item, index) => (
<S.InfoDetailWrapper key={index}>
<S.InfoTitle>{item.title}</S.InfoTitle>
<S.InfoDetail>{item.detail}</S.InfoDetail>
</S.InfoDetailWrapper>
))}
Comment on lines +32 to +37
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

맵 활용 너무 좋네요!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

덕분에 배운 부분 적용시켜보았습니다!!

</S.InfoWrapper>
<S.BtnWrapper>
<S.LinkCopyBtn>
<IcLink style={{ width: '1.8rem', height: '1.8rem' }} />
링크 복사
</S.LinkCopyBtn>
Comment on lines +40 to +43
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헉 이 부분 저도 재사용해도 될 것 같네요!! 흐흐 고마워요

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헉 저도 잘 쓰겠습니다!ㅎㅎ

<S.KakaoLinkCopyBtn>
<IcKakaoShare style={{ width: '1.8rem', height: '1.8rem' }} />
카카오톡 공유
</S.KakaoLinkCopyBtn>
</S.BtnWrapper>
</>
);
};
export default OnboardingFinal;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 21 additions & 6 deletions src/pages/OnBoardingPage.tsx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확실히 라이브러리를 사용하니까 깔끔하네요! 저도 리팩토링할 때 도입을 고민해봐야겠어요🤔

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ThumbnailInput from '../components/onboarding/step02/Step02';
import GiftDelivery from '../components/onboarding/step03/Step03';
import SetTournamentSchedule from '../components/onboarding/step04/Step04';
import SetTournamentDuration from '../components/onboarding/step05/Step05';
import OnboardingFinal from '../components/onboarding/step06/Step06';

const OnBoardingPage = () => {
const { Funnel, setStep } = useFunnel(ONBOARDING_FORM_STEP, ONBOARDING_FORM_STEP[0]);
Expand All @@ -16,19 +17,33 @@ const OnBoardingPage = () => {
<OnBoardingPageWrapper>
<Funnel>
<Funnel.Step name='NAME'>
<NameInput onNext={() => setStep(() => 'THUMBNAIL')} />
<div style={{ margin: '2rem' }}>
<NameInput onNext={() => setStep(() => 'THUMBNAIL')} />
</div>
</Funnel.Step>

<Funnel.Step name='THUMBNAIL'>
<ThumbnailInput onNext={() => setStep(() => 'PRESENT')} />
<div style={{ margin: '2rem' }}>
<ThumbnailInput onNext={() => setStep(() => 'PRESENT')} />
</div>
</Funnel.Step>
<Funnel.Step name='PRESENT'>
<GiftDelivery onNext={() => setStep(() => 'TOURNAMENT_SCHEDULE_REGISTRATION')} />
<div style={{ margin: '2rem' }}>
<GiftDelivery onNext={() => setStep(() => 'TOURNAMENT_SCHEDULE_REGISTRATION')} />
</div>
</Funnel.Step>
<Funnel.Step name='TOURNAMENT_SCHEDULE_REGISTRATION'>
<SetTournamentSchedule onNext={() => setStep(() => 'TOURNAMENT_PROCEEDING')} />
<div style={{ margin: '2rem' }}>
<SetTournamentSchedule onNext={() => setStep(() => 'TOURNAMENT_PROCEEDING')} />
</div>
</Funnel.Step>
<Funnel.Step name='TOURNAMENT_PROCEEDING'>
<SetTournamentDuration onNext={() => setStep(() => 'GIFT_ROOM_FIX')} />
<div style={{ margin: '2rem' }}>
<SetTournamentDuration onNext={() => setStep(() => 'GIFT_ROOM_FIX')} />
</div>
</Funnel.Step>
<Funnel.Step name='GIFT_ROOM_FIX'>
<OnboardingFinal />
</Funnel.Step>
</Funnel>
</OnBoardingPageWrapper>
Expand All @@ -38,5 +53,5 @@ const OnBoardingPage = () => {
export default OnBoardingPage;

const OnBoardingPageWrapper = styled.div`
margin: 2rem;
/* margin: 2rem; */
`;