Skip to content

Commit

Permalink
Merge pull request #27 from urdego/feat/#16-mypage-ui
Browse files Browse the repository at this point in the history
Feat: mypage UI κ΅¬ν˜„μ™„λ£Œ
  • Loading branch information
bluedog129 authored Jan 1, 2025
2 parents 8c6315e + 65e1844 commit 13e2ad4
Show file tree
Hide file tree
Showing 16 changed files with 257 additions and 531 deletions.
28 changes: 28 additions & 0 deletions app/(nav)/myPage/myPage.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import styled from 'styled-components';
import colors from '@/styles/color/palette';

export const MyPageWrapper = styled.div`
padding: 0 16px;
`;

export const ProfileWrapper = styled.div`
display: flex;
flex-direction: column;
align-items: center;
padding: 20px 0px;
`;

export const SmallButtonWrapper = styled.div`
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
`;

export const Separator = styled.div`
height: 9px;
width: calc(100% + 32px); /* λΆ€λͺ¨ padding 16px * 2 보정 */
margin: 0 -16px; /* MyPageWrapper의 padding κ°’ 반영 */
background-color: ${colors.gray[95]};
`;
27 changes: 25 additions & 2 deletions app/(nav)/myPage/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
'use client';
import TopBar from '@/components/Common/TopBar/TopBar';
import {
MyPageWrapper,
ProfileWrapper,
SmallButtonWrapper,
Separator,
} from '@/app/(nav)/myPage/myPage.styles';
import ProfileInfo from '@/components/Layout/MyPage/ProfileInfo';
import SettingButton from '@/components/Layout/MyPage/SettingButton';
import SmallButton from '@/components/Layout/MyPage/SmallButton';

const MyPage = () => {
return (
<>
<TopBar NavType="other" label="λ§ˆμ΄νŽ˜μ΄μ§€" />
<h1>My Page</h1>
<TopBar NavType="default" label="λ§ˆμ΄νŽ˜μ΄μ§€" />
<MyPageWrapper>
<ProfileWrapper>
<ProfileInfo />
<SmallButtonWrapper>
<SmallButton onClick={() => {}}>캐릭터 μˆ˜μ •</SmallButton>
<SmallButton onClick={() => {}}>λ‹‰λ„€μž„ λ³€κ²½</SmallButton>
</SmallButtonWrapper>
</ProfileWrapper>
<Separator />
<SettingButton label="λΉ„λ°€λ²ˆν˜Έ λ³€κ²½" onClick={() => {}} />
<SettingButton label="κ°„νŽΈ 둜그인 μ„€μ •" onClick={() => {}} />
<SettingButton label="μ‚¬μš΄λ“œ μ„€μ •" onClick={() => {}} />
<SettingButton label="λ‘œκ·Έμ•„μ›ƒ" onClick={() => {}} />
<SettingButton label="νšŒμ›νƒˆν‡΄" onClick={() => {}} />
</MyPageWrapper>
</>
);
};
Expand Down
6 changes: 3 additions & 3 deletions components/Common/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ const NavBar = () => {
<NavBarText>λž­ν‚Ή</NavBarText>
</NavItem>
</Link>
<Link href="/mypage" passHref>
<NavItem onClick={() => setSelected('mypage')}>
{selected === 'mypage' ? <MypageColorIcon /> : <MypageIcon />}
<Link href="/myPage" passHref>
<NavItem onClick={() => setSelected('myPage')}>
{selected === 'myPage' ? <MypageColorIcon /> : <MypageIcon />}
<NavBarText>λ§ˆμ΄νŽ˜μ΄μ§€</NavBarText>
</NavItem>
</Link>
Expand Down
34 changes: 34 additions & 0 deletions components/Layout/MyPage/ProfileInfo.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import styled from 'styled-components';
import colors from '@styles/color/palette';

export const ProfileInfoWrapper = styled.div`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 12px; /* ν”„λ‘œν•„κ³Ό λ²„νŠΌ κ°„ 간격 */
`;

export const ImageWrapper = styled.div`
margin-bottom: 12px; /* 이미지와 이름/이메일 κ°„ 간격 */
background-color: ${colors.gray[80]};
border-radius: 50%;
width: 56px;
height: 56px;
display: flex;
align-items: center;
justify-content: center;
`;

export const ProfileName = styled.div`
font-size: 14px;
margin-bottom: 4px; /* 이름과 이메일 κ°„ 간격 */
font-weight: bold;
text-align: center;
`;

export const ProfileEmail = styled.div`
font-size: 12px;
color: ${colors.gray[60]};
text-align: center;
`;
23 changes: 23 additions & 0 deletions components/Layout/MyPage/ProfileInfo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {
ProfileInfoWrapper,
ImageWrapper,
ProfileName,
ProfileEmail,
} from '@/components/Layout/MyPage/ProfileInfo.styles';

import ProfileImg from '@/styles/Icon/Profile_Snowman1.svg';
import Image from 'next/image';

const ProfileInfo = () => {
return (
<ProfileInfoWrapper>
<ImageWrapper>
<Image src={ProfileImg} width={56} height={56} alt="Profile Image" />
</ImageWrapper>
<ProfileName>κΉ€λˆˆμ‚¬λžŒ</ProfileName>
<ProfileEmail>[email protected]</ProfileEmail>
</ProfileInfoWrapper>
);
};

export default ProfileInfo;
16 changes: 16 additions & 0 deletions components/Layout/MyPage/SettingButton.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import styled from 'styled-components';

export const SetButtonWrapper = styled.div`
width: 100%;
height: 55px;
display: flex;
justify-content: space-between;
align-items: center;
align-self: stretch;
`;

export const SetButton = styled.div`
font-size: 14px;
font-weight: 700;
border: none;
`;
22 changes: 22 additions & 0 deletions components/Layout/MyPage/SettingButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {
SetButton,
SetButtonWrapper,
} from '@components/Layout/MyPage/SettingButton.styles';
import direction from '@styles/Icon/Right_dir.svg';
import Image from 'next/image';

interface SettingButtonProps {
label: string;
onClick: () => void;
}

const SettingButton = ({ label, onClick }: SettingButtonProps) => {
return (
<SetButtonWrapper onClick={onClick}>
<SetButton>{label}</SetButton>
<Image src={direction} width={24} height={24} alt="Direction" />
</SetButtonWrapper>
);
};

export default SettingButton;
21 changes: 21 additions & 0 deletions components/Layout/MyPage/SmallButton.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import styled from 'styled-components';
import colors from '@/styles/color/palette';

export const SButton = styled.button`
width: 166px;
padding: 12px 16px;
font-size: 12px;
font-weight: 700;
text-align: center;
border-radius: 4px;
border: 1px solid ${colors.gray[80]};
background-color: white;
cursor: pointer;
&:disabled {
border-color: #e0e0e0;
background-color: #f9f9f9;
color: #b0b0b0;
cursor: not-allowed;
}
`;
12 changes: 12 additions & 0 deletions components/Layout/MyPage/SmallButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { SButton } from '@components/Layout/MyPage/SmallButton.styles';

interface SmallButtonProps {
onClick: () => void;
children: React.ReactNode;
}

const SmallButton = ({ onClick, children }: SmallButtonProps) => {
return <SButton onClick={onClick}>{children}</SButton>;
};

export default SmallButton;
Loading

0 comments on commit 13e2ad4

Please sign in to comment.