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

[FE] 마이페이지 화면 퍼블리싱 #839

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions client/src/constants/routerUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const ROUTER_URLS = {
qrCode: `${EVENT_WITH_EVENT_ID}/qrcode`,
event: EVENT,
login: '/login',
myPage: '/mypage',
guestEventLogin: `${EVENT_WITH_EVENT_ID}/admin/guest/login`,
memberEventLogin: `${EVENT_WITH_EVENT_ID}/admin/member/login`,
kakaoLoginRedirectUri: process.env.KAKAO_REDIRECT_URI,
Expand Down
20 changes: 20 additions & 0 deletions client/src/pages/MyPage/Container.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {Flex} from '@components/Design';

type ContainerProps = React.PropsWithChildren;

const Container = ({children}: ContainerProps) => {
return (
<Flex
flexDirection="column"
width="100%"
gap="0.5rem"
backgroundColor="white"
padding="1rem"
css={{borderRadius: '0.75rem'}}
Comment on lines +7 to +13
Copy link
Contributor

@pakxe pakxe Dec 3, 2024

Choose a reason for hiding this comment

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

Flex 컴포넌트가 사용되는 모습을 보니 어색하네요. 간편하게 쓰기 위해서 여러 props를 열어두었는데, css prop도 받는걸 보니 누군가는 '어라 그냥 css에 다 집어넣으면 되지 왜 따로갈비지?'라고 생각할 수도 있을 것 같아서요.. 다양한 사용 방법을 모두 수용하다보니 이렇게 된 것 같기도 하구요. 어떻게 만드는게 좋았을 지 고민이 되네요. 고쳐달라는 뜻은 아니고 아마 저와 같은 생각을 하는 사람이 있을 것 같아 적어봤써요 😭

Copy link
Contributor

Choose a reason for hiding this comment

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

저도 어느정도 동감해요! css를 인자로 받아서, 다른 component처럼 css를 넘겨줄 수 있도록 하는게 제일 깔끔해 보이기는 해요!
좋은 방법이 있을지 고민해 보도록 하겠습니다 :)

>
{children}
</Flex>
);
};

export default Container;
12 changes: 12 additions & 0 deletions client/src/pages/MyPage/MyPage.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {css} from '@emotion/react';

import {Theme} from '@components/Design/theme/theme.type';

export const mockImageStyle = (theme: Theme) =>
css({
width: '3rem',
height: '3rem',

borderRadius: '50%',
backgroundColor: theme.colors.gray,
});
49 changes: 49 additions & 0 deletions client/src/pages/MyPage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import {Button, Flex, FunnelLayout, MainLayout, Text, TextButton, TopNav, useTheme} from '@components/Design';

import {mockImageStyle} from './MyPage.style';
import Container from './Container';

const MyPage = () => {
const {theme} = useTheme();

return (
<MainLayout backgroundColor="gray">
<TopNav>
<TopNav.Item displayName="뒤로가기" noEmphasis routePath="-1" />
</TopNav>
<FunnelLayout>
<Container>
<Flex justifyContent="spaceBetween" alignItems="center" margin="0 1rem">
<Flex gap="1rem" alignItems="center">
<div css={mockImageStyle(theme)}></div>
<Text size="bodyBold" textColor="onTertiary">
이름이 올 곳
</Text>
</Flex>
<Button variants="tertiary" size="small">
로그아웃
</Button>
</Flex>
</Container>
<Container>
<Flex flexDirection="column" margin="0 1.5rem" gap="1rem">
<TextButton textColor="onTertiary" textSize="body">
닉네임 설정하기
</TextButton>
<TextButton textColor="onTertiary" textSize="body">
기본 계좌 번호 설정하기
</TextButton>
<TextButton textColor="onTertiary" textSize="body">
내가 만든 행사 목록 보기
</TextButton>
<TextButton textColor="onTertiary" textSize="body">
탈퇴하기
</TextButton>
Comment on lines +30 to +41
Copy link
Contributor

Choose a reason for hiding this comment

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

나중에 기능 추가할 때, 해당 항목들과 이동 Url을 배열로 정리해서 렌더링시키는 것도 좋을 것 같아요~

Copy link
Contributor Author

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.

탈퇴하기 부분은 충분히 destructive한 기능이니까 color를 destructive로 적용해 줘도 좋을 것 같아요

</Flex>
</Container>
</FunnelLayout>
</MainLayout>
);
};

export default MyPage;
5 changes: 5 additions & 0 deletions client/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const AddImagesPage = lazy(() => import('@pages/AddImagesPage/AddImagesPage'));
const EssentialQueryApp = lazy(() => import('./EssentialQueryApp'));
const QRCodePage = lazy(() => import('@pages/QRCodePage/QRCodePage'));
const LoginPage = lazy(() => import('@pages/LoginPage'));
const MyPage = lazy(() => import('@pages/MyPage'));
const LoginRedirectPage = lazy(() => import('@pages/LoginPage/LoginRedirectPage'));
const LoginFailFallback = lazy(() => import('@pages/LoginPage/LoginFailFallback'));

Expand Down Expand Up @@ -62,6 +63,10 @@ const router = createBrowserRouter([
path: ROUTER_URLS.login,
element: <LoginPage />,
},
{
path: ROUTER_URLS.myPage,
element: <MyPage />,
},
{
path: ROUTER_URLS.kakaoLoginRedirectUri,
element: <LoginRedirectPage />,
Expand Down
Loading