From 12a20c4b876dad955cb149c3d50df6576e96f1f6 Mon Sep 17 00:00:00 2001 From: seongminn Date: Wed, 29 Nov 2023 03:42:26 +0900 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20profile=20icon=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/Icon/iconMap.ts | 2 ++ src/components/common/Icon/svg/Profile.tsx | 18 ++++++++++++++++++ .../common/MatchCard/pieces/Team.tsx | 13 +++++-------- 3 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 src/components/common/Icon/svg/Profile.tsx diff --git a/src/components/common/Icon/iconMap.ts b/src/components/common/Icon/iconMap.ts index 9ad7269..d537c42 100644 --- a/src/components/common/Icon/iconMap.ts +++ b/src/components/common/Icon/iconMap.ts @@ -10,6 +10,7 @@ import { Image } from './svg/Image'; import { PaperPlane } from './svg/PaperPlane'; import { Pencil } from './svg/Pencil'; import { PlusCircled } from './svg/PlusCircled'; +import { Profile } from './svg/Profile'; import { Symbol } from './svg/Symbol'; import { ThumbsUp } from './svg/Thumbsup'; import { Trash } from './svg/Trash'; @@ -32,4 +33,5 @@ export const iconMap = { thumbsUp: ThumbsUp, trash: Trash, write: Write, + profile: Profile, }; diff --git a/src/components/common/Icon/svg/Profile.tsx b/src/components/common/Icon/svg/Profile.tsx new file mode 100644 index 0000000..6e782ca --- /dev/null +++ b/src/components/common/Icon/svg/Profile.tsx @@ -0,0 +1,18 @@ +import { ComponentProps } from 'react'; + +export const Profile = ({ + viewBox = '0 0 20 20', + ...props +}: ComponentProps<'svg'>) => { + return ( + + ); +}; diff --git a/src/components/common/MatchCard/pieces/Team.tsx b/src/components/common/MatchCard/pieces/Team.tsx index bf745fa..5fff144 100644 --- a/src/components/common/MatchCard/pieces/Team.tsx +++ b/src/components/common/MatchCard/pieces/Team.tsx @@ -3,6 +3,8 @@ import Image from 'next/image'; import { useMatchCardContext } from '@/hooks/useMatchCardContext'; import { $ } from '@/utils/core'; +import { Icon } from '../../Icon'; + type TeamProps = { teamIndex: number; className?: string; @@ -14,15 +16,10 @@ export default function Team({ teamIndex, className }: TeamProps) { if (gameTeams.length === 0) { return (
- + />
); } From fecf355dda9cd7d2bd7d9d2c334e28c6f8b04844 Mon Sep 17 00:00:00 2001 From: seongminn Date: Wed, 29 Nov 2023 04:59:56 +0900 Subject: [PATCH 2/6] =?UTF-8?q?chore:=20=ED=95=84=EC=9A=94=20=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=ED=8C=8C=EC=9D=BC=20=EC=82=AD=EC=A0=9C=20=EB=B0=8F?= =?UTF-8?q?=20=EB=8C=93=EA=B8=80=20margin=20bottom=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/match/[id]/modify/page.tsx | 92 ------------------------------ src/app/match/[id]/page.tsx | 2 +- 2 files changed, 1 insertion(+), 93 deletions(-) delete mode 100644 src/app/match/[id]/modify/page.tsx diff --git a/src/app/match/[id]/modify/page.tsx b/src/app/match/[id]/modify/page.tsx deleted file mode 100644 index e95f9bb..0000000 --- a/src/app/match/[id]/modify/page.tsx +++ /dev/null @@ -1,92 +0,0 @@ -'use client'; - -import { useParams, useRouter } from 'next/navigation'; -import { ChangeEvent, FormEvent, useState } from 'react'; - -import { postGameScore } from '@/api/admin'; -import Input from '@/components/common/Input/Input'; -import { getUtcHours } from '@/utils/utc-times'; - -export default function ModifyGame() { - const router = useRouter(); - const params = useParams(); - const id = Number(params.id); - const [scoreData, setScoreData] = useState({ - playerName: '', - team: 0, - hour: new Date().getHours(), - minute: new Date().getMinutes(), - }); - - const handleChange = ( - e: ChangeEvent, - ) => { - const { name, value } = e.target; - - setScoreData(prev => ({ ...prev, [name]: value })); - }; - - const handleSubmit = (e: FormEvent) => { - e.preventDefault(); - - const date = getUtcHours({ - hour: scoreData.hour, - minute: scoreData.minute, - }); - - postGameScore(id, { - playerName: scoreData.playerName, - team: scoreData.team, - scoredAt: date, - }).then(() => router.push('/')); - }; - - return ( -
- - -

득점한 팀

- - - -
- ); -} diff --git a/src/app/match/[id]/page.tsx b/src/app/match/[id]/page.tsx index 5ef4ff4..60e9dfd 100644 --- a/src/app/match/[id]/page.tsx +++ b/src/app/match/[id]/page.tsx @@ -115,7 +115,7 @@ export default function Match({ params }: { params: { id: string } }) { {({ commentList, matchTeams, ...data }) => (
-
    +
      Date: Wed, 29 Nov 2023 05:00:32 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=EB=A3=A8=EB=AF=B8=ED=81=90?= =?UTF-8?q?=EB=B8=8C=EC=9A=A9=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/rummikub/Cheer/index.tsx | 55 ++++++++++++ src/components/rummikub/MatchBanner/index.tsx | 89 +++++++++++++++++++ src/components/rummikub/MatchItem/index.tsx | 51 +++++++++++ 3 files changed, 195 insertions(+) create mode 100644 src/components/rummikub/Cheer/index.tsx create mode 100644 src/components/rummikub/MatchBanner/index.tsx create mode 100644 src/components/rummikub/MatchItem/index.tsx diff --git a/src/components/rummikub/Cheer/index.tsx b/src/components/rummikub/Cheer/index.tsx new file mode 100644 index 0000000..7f3c925 --- /dev/null +++ b/src/components/rummikub/Cheer/index.tsx @@ -0,0 +1,55 @@ +import { FallbackProps } from '@/components/common/ErrorBoundary'; +import CheerTeam from '@/components/match/CheerTeam'; +import { MatchCheerType } from '@/types/match'; + +type CheerProps = { + cheers: MatchCheerType[]; +}; + +export default function Cheer({ cheers }: CheerProps) { + const [firstTeam, secondTeam, thirdTeam, fourthTeam] = cheers; + + return ( +
      +
      + + 🤜 + {firstTeam.cheerCount} + + + 🤜 + {thirdTeam.cheerCount} + +
      +
      + VS +
      +
      + + {secondTeam.cheerCount} + 🤛 + + + {fourthTeam.cheerCount} + 🤛 + +
      +
      + ); +} + +Cheer.ErrorFallback = function ErrorFallback({ + resetErrorBoundary, +}: FallbackProps) { + return ( +
      +
      + 응원하기를 불러올 수 없어요. + 잠시 후 다시 시도해주세요! +
      + +
      + ); +}; diff --git a/src/components/rummikub/MatchBanner/index.tsx b/src/components/rummikub/MatchBanner/index.tsx new file mode 100644 index 0000000..6875146 --- /dev/null +++ b/src/components/rummikub/MatchBanner/index.tsx @@ -0,0 +1,89 @@ +import { FallbackProps } from '@/components/common/ErrorBoundary'; +import { MatchCard } from '@/components/common/MatchCard'; +import { MatchType } from '@/types/match'; + +export default function RummiKubMatchBanner(match: MatchType) { + return ( + + +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      +
      +
      +
      + ); +} + +RummiKubMatchBanner.ErrorFallback = function ErrorFallback({ + resetErrorBoundary, +}: FallbackProps) { + return ( +
      +
      + 게임 정보를 불러올 수 없어요. + 잠시 후 다시 시도해주세요! +
      + +
      + ); +}; + +RummiKubMatchBanner.Skeleton = function Skeleton() { + return ( + +
      + +
      +
      + ); +}; diff --git a/src/components/rummikub/MatchItem/index.tsx b/src/components/rummikub/MatchItem/index.tsx new file mode 100644 index 0000000..b880ea9 --- /dev/null +++ b/src/components/rummikub/MatchItem/index.tsx @@ -0,0 +1,51 @@ +import { MatchCard } from '@/components/common/MatchCard'; +import { MatchType } from '@/types/match'; + +export default function RummiKubMatchItem(match: MatchType) { + return ( + + +
      + + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      + + +
      +
      +
      +
      +
      + ); +} From 7707d68d16b7be9df9011a41051e1b20776a32e0 Mon Sep 17 00:00:00 2001 From: seongminn Date: Wed, 29 Nov 2023 05:01:12 +0900 Subject: [PATCH 4/6] =?UTF-8?q?chore:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=A7=88=EC=A7=84=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/MatchCard/pieces/Team.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/MatchCard/pieces/Team.tsx b/src/components/common/MatchCard/pieces/Team.tsx index 5fff144..6c01fa8 100644 --- a/src/components/common/MatchCard/pieces/Team.tsx +++ b/src/components/common/MatchCard/pieces/Team.tsx @@ -18,7 +18,7 @@ export default function Team({ teamIndex, className }: TeamProps) {
      ); From 086d62ca2ba66ad6f128ff9f9dcf22cff17c81d2 Mon Sep 17 00:00:00 2001 From: seongminn Date: Wed, 29 Nov 2023 05:02:26 +0900 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20=EB=8C=93=EA=B8=80=20=EC=A2=8C?= =?UTF-8?q?=EC=9A=B0,=20=EC=83=89=EC=83=81=20=EA=B5=AC=EB=B6=84=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/match/CommentForm/index.tsx | 34 +++++++++----------- src/components/match/CommentItem/index.tsx | 36 ++++++++++------------ src/components/match/CommentList/index.tsx | 12 ++++++-- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/src/components/match/CommentForm/index.tsx b/src/components/match/CommentForm/index.tsx index 0e3100e..818206d 100644 --- a/src/components/match/CommentForm/index.tsx +++ b/src/components/match/CommentForm/index.tsx @@ -18,7 +18,6 @@ export default function CommentForm({ }: CommentFormProps) { const [inputValue, setInputValue] = useState(''); const [selectedTeamId, setSelectedTeamId] = useState(1); - const [isOpen, toggleOpen] = useState(false); const handleCommentSubmit = ( e: FormEvent, @@ -37,7 +36,7 @@ export default function CommentForm({ return ( <>
      handleCommentSubmit(e, { gameTeamId: Number(matchId), @@ -45,22 +44,20 @@ export default function CommentForm({ }) } > - {isOpen && ( -
      - {matchTeams.map(team => ( - - ))} -
      - )} +
      + {matchTeams.map(team => ( + + ))} +
      setInputValue(e.target.value)} placeholder="응원하는 팀에 댓글을 남겨보세요!" - onFocus={() => toggleOpen(true)} />