-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fe-dev' into feature/#854
- Loading branch information
Showing
16 changed files
with
173 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {User} from 'types/serviceType'; | ||
|
||
import {BASE_URL} from '@apis/baseUrl'; | ||
import {requestGet} from '@apis/fetcher'; | ||
|
||
export const requestGetUserInfo = async () => { | ||
return await requestGet<User>({ | ||
baseUrl: BASE_URL.HD, | ||
endpoint: `/api/users/mine`, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
client/src/components/Design/components/Profile/Profile.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** @jsxImportSource @emotion/react */ | ||
import type {Meta, StoryObj} from '@storybook/react'; | ||
|
||
import {Profile} from './Profile'; | ||
|
||
const meta: Meta<typeof Profile> = { | ||
title: 'Components/Profile', | ||
component: Profile, | ||
tags: ['autodocs'], | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
decorators: [ | ||
Story => ( | ||
<div style={{width: '200px', height: '200px', padding: '1rem'}}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
args: { | ||
src: 'https://wooteco-crew-wiki.s3.ap-northeast-2.amazonaws.com/%EC%9B%A8%EB%94%94%286%EA%B8%B0%29/g583lirp8yg.jpg', | ||
size: 'large', | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
// Playground μ€ν 리 | ||
export const Playground: Story = {}; |
26 changes: 26 additions & 0 deletions
26
client/src/components/Design/components/Profile/Profile.style.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import {css} from '@emotion/react'; | ||
|
||
import {Theme} from '@components/Design/theme/theme.type'; | ||
|
||
import {ProfileSize} from './Profile.type'; | ||
|
||
const SEMANTIC_SIZE: Record<ProfileSize, string> = { | ||
small: '1rem', | ||
medium: '1.75rem', | ||
large: '3rem', | ||
}; | ||
|
||
export const profileContainerStyle = (theme: Theme, size: ProfileSize) => { | ||
return css({ | ||
display: 'flex', | ||
|
||
width: SEMANTIC_SIZE[size], | ||
height: SEMANTIC_SIZE[size], | ||
|
||
borderRadius: '50%', | ||
|
||
backgroundColor: theme.colors.white, | ||
|
||
objectFit: 'cover', | ||
}); | ||
}; |
13 changes: 13 additions & 0 deletions
13
client/src/components/Design/components/Profile/Profile.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** @jsxImportSource @emotion/react */ | ||
import {useTheme} from '@components/Design/theme/HDesignProvider'; | ||
|
||
import Image from '../Image/Image'; | ||
|
||
import {profileContainerStyle} from './Profile.style'; | ||
import {ProfileProps} from './Profile.type'; | ||
|
||
export const Profile = ({size = 'medium', ...profileProps}: ProfileProps) => { | ||
const {theme} = useTheme(); | ||
|
||
return <Image aria-label="νλ‘ν μ΄λ―Έμ§" {...profileProps} css={profileContainerStyle(theme, size)} />; | ||
}; |
7 changes: 7 additions & 0 deletions
7
client/src/components/Design/components/Profile/Profile.type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {ImageProps} from '../Image/Image'; | ||
|
||
export type ProfileSize = 'small' | 'medium' | 'large'; | ||
|
||
export type ProfileProps = ImageProps & { | ||
size?: ProfileSize; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {useSuspenseQuery} from '@tanstack/react-query'; | ||
|
||
import {requestGetUserInfo} from '@apis/request/user'; | ||
|
||
import QUERY_KEYS from '@constants/queryKeys'; | ||
|
||
const useRequestGetUserInfo = () => { | ||
const {data} = useSuspenseQuery({ | ||
queryKey: [QUERY_KEYS.userInfo], | ||
queryFn: requestGetUserInfo, | ||
}); | ||
|
||
return {userInfo: data}; | ||
}; | ||
|
||
export default useRequestGetUserInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
client/src/pages/EventPage/EventPageFallback/EventPageLoading.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {Flex, Icon, IconButton, MainLayout, TopNav} from '@components/Design'; | ||
import {Footer} from '@components/Footer'; | ||
|
||
const EventPageLoading = () => { | ||
return ( | ||
<MainLayout backgroundColor="gray"> | ||
<Flex justifyContent="spaceBetween" alignItems="center"> | ||
<TopNav> | ||
<TopNav.Item routePath="/"> | ||
<IconButton variants="none"> | ||
<Icon iconType="heundeut" /> | ||
</IconButton> | ||
</TopNav.Item> | ||
<TopNav.Item displayName="ν" routePath="/home" /> | ||
<TopNav.Item displayName="κ΄λ¦¬" routePath="/admin" /> | ||
</TopNav> | ||
</Flex> | ||
<Footer /> | ||
</MainLayout> | ||
); | ||
}; | ||
|
||
export default EventPageLoading; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters