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 반영 #355

Merged
merged 9 commits into from
Nov 13, 2024
9 changes: 9 additions & 0 deletions apps/spectator/app/_components/GameList/Info.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { theme } from '@hcc/styles';
import Image from 'next/image';

import { GameListType, GameState } from '@/types/game';
Expand Down Expand Up @@ -25,6 +26,10 @@ export default function GameInfo({ gameTeams, state }: GameInfoProps) {
width={IMAGE_SIZE}
height={IMAGE_SIZE}
loading="lazy"
style={{
border: `1px solid ${theme.colors.gray50}`,
borderRadius: '50%',
}}
/>
<span className={styles.gameInfoRow.teamName}>
{firstTeam.gameTeamName}
Expand All @@ -40,6 +45,10 @@ export default function GameInfo({ gameTeams, state }: GameInfoProps) {
width={IMAGE_SIZE}
height={IMAGE_SIZE}
loading="lazy"
style={{
border: `1px solid ${theme.colors.gray50}`,
borderRadius: '50%',
}}
/>
<span className={styles.gameInfoRow.teamName}>
{secondTeam.gameTeamName}
Expand Down
16 changes: 14 additions & 2 deletions apps/spectator/app/_components/GameList/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,20 @@ export const state = styleVariants({
backgroundColor: theme.colors.red600,
},
],
SCHEDULED: [baseState],
FINISHED: [baseState],
SCHEDULED: [
baseState,
{
color: theme.colors.blue600,
backgroundColor: theme.colors.blue200,
},
],
FINISHED: [
baseState,
{
color: theme.colors.white,
backgroundColor: theme.colors.gray300,
},
],
});

export const timestamp = style({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export const item = styleVariants({
teamLogo: {
userSelect: 'none',
alignSelf: 'center',
border: `1px solid ${theme.colors.gray50}`,
borderRadius: '50%',
},
content: {
padding: `${theme.spaces.xs} ${theme.spaces.sm}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ export const list = styleVariants({
},
});

export const emptyMsg = style({
display: 'flex',
flex: 1,
fontSize: theme.textVariants.default.fontSize,
alignItems: 'center',
justifyContent: 'center',
});

export const scrollToBottomButton = style({
position: 'absolute',
display: 'flex',
Expand Down
81 changes: 44 additions & 37 deletions apps/spectator/app/game/[id]/_components/CheerTalk/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,43 +94,50 @@ export default function CheerTalkList({
}, [checkScrollHeight]);

return (
<div className={styles.list.container}>
<ul ref={scrollRef} className={styles.list.content}>
{hasNextPage && <Spinner />}
<li ref={ref} />
{/* HTTP */}
{cheerTalkList.map(talk => (
<CheerTalkItemMemo
key={`cheer-${talk.cheerTalkId}`}
hasMenu
{...talk}
/>
))}

{/* Socket */}
{socketTalkList.map(talk => (
<CheerTalkItemMemo
key={`socket-${talk.cheerTalkId}`}
hasMenu
{...talk}
/>
))}
<li ref={bottomRef} />
</ul>
<CheerTalkForm
gameTeams={gameDetail.gameTeams}
saveCheerTalkMutate={mutate}
scrollToBottom={run}
/>
{showScrollToBottomButton && (
<button
className={styles.scrollToBottomButton}
onClick={run}
type="button"
>
<Icon source={ArrowDownIcon} size={16} color="black" />
</button>
<>
{cheerTalkList.length === 0 && socketTalkList.length === 0 && (
<div className={styles.emptyMsg}>
지금 우리 팀에게 첫 응원톡을 남겨주세요! 💪
</div>
)}
</div>
<div className={styles.list.container}>
<ul ref={scrollRef} className={styles.list.content}>
{hasNextPage && <Spinner />}
<li ref={ref} />
{/* HTTP */}
{cheerTalkList.map(talk => (
<CheerTalkItemMemo
key={`cheer-${talk.cheerTalkId}`}
hasMenu
{...talk}
/>
))}

{/* Socket */}
{socketTalkList.map(talk => (
<CheerTalkItemMemo
key={`socket-${talk.cheerTalkId}`}
hasMenu
{...talk}
/>
))}
<li ref={bottomRef} />
</ul>
<CheerTalkForm
gameTeams={gameDetail.gameTeams}
saveCheerTalkMutate={mutate}
scrollToBottom={run}
/>
{showScrollToBottomButton && (
<button
className={styles.scrollToBottomButton}
onClick={run}
type="button"
>
<Icon source={ArrowDownIcon} size={16} color="black" />
</button>
)}
</div>
</>
);
}
5 changes: 5 additions & 0 deletions apps/spectator/app/game/[id]/_components/CheerVS/TeamBox.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { theme } from '@hcc/styles';
import { assignInlineVars } from '@vanilla-extract/dynamic';
import Image from 'next/image';
import { useState } from 'react';
Expand Down Expand Up @@ -79,6 +80,10 @@ export default function CheerTeamBox({
src={logoImageUrl}
alt={`${gameTeamName} 로고`}
loading="lazy"
style={{
border: `1px solid ${theme.colors.gray50}`,
borderRadius: '50%',
}}
/>
<span className={styles.countNumber}>
{count.toLocaleString('ko-KR')}
Expand Down
9 changes: 9 additions & 0 deletions apps/spectator/app/game/[id]/_components/Lineup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { theme } from '@hcc/styles';
import { Accordion } from '@hcc/ui';
import { clsx } from 'clsx';
import Image from 'next/image';
Expand Down Expand Up @@ -27,6 +28,10 @@ export default function Lineup({ gameId }: LineupProps) {
width={28}
height={28}
loading="lazy"
style={{
border: `1px solid ${theme.colors.gray50}`,
borderRadius: '50%',
}}
/>
<span className={styles.teamName.left}>{homeTeam.teamName}</span>
</div>
Expand All @@ -48,6 +53,10 @@ export default function Lineup({ gameId }: LineupProps) {
width={28}
height={28}
loading="lazy"
style={{
border: `1px solid ${theme.colors.gray50}`,
borderRadius: '50%',
}}
/>
</div>

Expand Down