Skip to content

Commit

Permalink
Merge pull request #295 from TEAM-SEONYAK/feat/#294/senior-profile-data
Browse files Browse the repository at this point in the history
[ Feat ] 온보딩, 선배프로필 등록 데이터 연결 및 디자인 QA 반영
  • Loading branch information
j-nary authored Oct 29, 2024
2 parents d7b5d7d + 6d974c7 commit 1026d4b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/components/commons/seniorCard/SeniorCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ const SeniorCardWrapper = styled.div<{ $isSmall: boolean }>`
display: flex;
flex-direction: column;
gap: 1rem;
justify-content: center;
align-items: center;
width: 100%;
padding-top: 3.2rem;
border-radius: 8px;
background: ${({ theme }) => theme.colors.grayScaleWhite};
Expand All @@ -63,7 +65,7 @@ const SeniorCardWrapper = styled.div<{ $isSmall: boolean }>`
const SeniorCardLayout = styled.div`
display: flex;
gap: 1.5rem;
justify-content: center;
justify-content: flex-start;
align-items: center;
width: 100%;
Expand Down
15 changes: 12 additions & 3 deletions src/pages/seniorProfile/SeniorProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Complete from '@pages/seniorProfile/components/Complete';
import Init from '@pages/seniorProfile/components/Init';
import PreView from '@pages/seniorProfile/components/preView/index';
import { seniorProfileRegisterType, seniorProfileInitial } from '@pages/seniorProfile/types';
import { useState } from 'react';
import { useEffect, useState } from 'react';
import Career from './components/Career';
import Example from './components/Example';
import Sentence from './components/Sentence';
Expand All @@ -14,11 +14,20 @@ import { SENIOR_PROFILE_STEPS } from './constants';
import { Header } from '../../components/commons/Header';
import ProgressBar from '../../components/commons/ProgressBar';
import theme from '../../styles/theme';
import { useLocation, useNavigate } from 'react-router-dom';

const SeniorProfilePage = () => {
const [step, setStep] = useState(0);
const [profile, setProfile] = useState<seniorProfileRegisterType>(seniorProfileInitial);
const userName = step >= 2 && step <= 4 ? '도현' : '';
const location = useLocation();
const navigate = useNavigate();
const { seniorId, nickname } = location.state || {};
const userName = step >= 2 && step <= 4 ? nickname : '';

useEffect(() => {
if (!seniorId || !nickname) navigate('/');
}, [seniorId, nickname, navigate]);

const getComponent = () => {
switch (step) {
case 0:
Expand All @@ -34,7 +43,7 @@ const SeniorProfilePage = () => {
case 5:
return <TimeSelect profile={profile} setProfile={setProfile} setStep={setStep} />;
case 6:
return <PreView setStep={setStep} profile={profile} seniorId={11 + ''} />;
return <PreView setStep={setStep} profile={profile} seniorId={seniorId} />;
case 7:
return <Complete />;
default:
Expand Down
11 changes: 11 additions & 0 deletions src/pages/seniorProfile/components/Example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const Example = ({ setStep }: { setStep: React.Dispatch<React.SetStateAction<num
{seniorId ? (
<>
<Header LeftSvg={ArrowLeftIc} onClickLeft={() => setSeniorId(0)} />
<Divider />
<PreView seniorId={seniorId + ''} variant="secondary" />
</>
) : (
Expand Down Expand Up @@ -81,6 +82,16 @@ const Wrapper = styled.div`
background-color: ${({ theme }) => theme.colors.grayScaleLG1};
`;

const Divider = styled.div`
position: fixed;
top: 4.9rem;
width: 100%;
height: 0.14rem;
background: ${({ theme }) => theme.colors.grayScaleLG2};
`;

const IconContainer = styled.section`
padding-bottom: 2.2rem;
`;
Expand Down
4 changes: 4 additions & 0 deletions src/pages/seniorProfile/components/preView/Review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ const Meta = styled.p`
`;

const ReviewBox = styled.p`
display: flex;
align-items: center;
justify-content: center;
width: 100%;
padding: 4.4rem 8.7rem 4.3rem 8.6rem;
Expand Down

0 comments on commit 1026d4b

Please sign in to comment.