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

[ Feat ] 온보딩, 선배프로필 등록 데이터 연결 및 디자인 QA 반영 #295

Merged
merged 6 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: 1.4px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

P2) 얜 왜 Px이에요? 린트 에러 안났나?

Copy link
Member Author

Choose a reason for hiding this comment

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

헉 안 나더라구용! rem으로 바꾸고 머지하겠슴당 ~!


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
Loading