-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge: 사용자 피드백을 반영하여 게임 화면에서 멤버별 투표 현황 보여주기 #427
[FEAT] 사용자 피드백을 반영하여 게임 화면에서 멤버별 투표 현황 보여주기
- Loading branch information
Showing
10 changed files
with
73 additions
and
12 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
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import { getUserInfo } from '@/apis/room'; | ||
|
||
const BASE_URL = process.env.API_BASE_URL; | ||
|
||
export const API_URL = { | ||
|
24 changes: 24 additions & 0 deletions
24
...Page/components/SelectContainer/GameVoteStatusContainer/GameVoteStatusContainer.styled.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,24 @@ | ||
import { css } from '@emotion/react'; | ||
import type { Theme } from '@emotion/react'; | ||
|
||
export const gameVoteStatusLayout = css` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: 1.2rem; | ||
height: 4rem; | ||
`; | ||
|
||
export const voteStatusMessage = (theme: Theme, isPending: boolean) => css` | ||
font-weight: bold; | ||
font-size: 1.6rem; | ||
opacity: ${isPending ? theme.opacity.invisible : theme.opacity.default}; | ||
transition: 1s; | ||
`; | ||
|
||
export const voteAnnounceMessage = (theme: Theme) => css` | ||
color: ${theme.color.gray500}; | ||
font-weight: bold; | ||
font-size: 1.2rem; | ||
`; |
29 changes: 29 additions & 0 deletions
29
...s/GamePage/components/SelectContainer/GameVoteStatusContainer/GameVoteStatusContainer.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,29 @@ | ||
import { | ||
gameVoteStatusLayout, | ||
voteStatusMessage, | ||
voteAnnounceMessage, | ||
} from './GameVoteStatusContainer.styled'; | ||
import useVoteIsFinished from '../hooks/useVoteIsFinished'; | ||
|
||
interface GameVoteStatusContainerProps { | ||
contentId: number; | ||
isFetching: boolean; | ||
} | ||
|
||
const GameVoteStatusContainer = ({ contentId, isFetching }: GameVoteStatusContainerProps) => { | ||
const { voteCount, memberCount, isPending } = useVoteIsFinished({ | ||
contentId, | ||
isFetching, | ||
}); | ||
|
||
const voteStatusText = `${memberCount ?? 0}명 중 ${voteCount ?? 0}명이 투표했어요!`; | ||
|
||
return ( | ||
<div css={gameVoteStatusLayout}> | ||
<span css={(theme) => voteStatusMessage(theme, isPending)}>{voteStatusText}</span> | ||
<span css={voteAnnounceMessage}>“모두 선택하면 빠르게 결과를 확인할 수 있어요”</span> | ||
</div> | ||
); | ||
}; | ||
|
||
export default GameVoteStatusContainer; |
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
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import '@emotion/react'; | ||
import { Theme } from './Theme'; | ||
|
||
type ExtendedTheme = typeof Theme; | ||
|
||
declare module '@emotion/react' { | ||
export interface Theme { | ||
color: { [key: string]: string }; | ||
} | ||
export interface Theme extends ExtendedTheme {} | ||
} |