-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
447 additions
and
511 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,5 @@ | ||
export interface CallAdmin { | ||
matchRound: number; | ||
matchName: string; | ||
callName: string; | ||
} |
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 |
---|---|---|
|
@@ -13,4 +13,5 @@ export type IconKind = | |
| 'sendEmail' | ||
| 'modify' | ||
| 'setting' | ||
| 'cancel'; | ||
| 'cancel' | ||
| 'shortcut'; |
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,91 @@ | ||
import authAPI from '@apis/authAPI'; | ||
import Icon from '@components/Icon'; | ||
import styled from '@emotion/styled'; | ||
import { BracketContents } from '@type/bracket'; | ||
import { useRouter } from 'next/router'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
interface Props { | ||
curRound: number; | ||
havingAlarm: boolean; | ||
} | ||
|
||
const RoundAlarmBody = ({ curRound, havingAlarm }: Props) => { | ||
const router = useRouter(); | ||
|
||
console.log(havingAlarm); | ||
|
||
const [roundInfo, setRoundInfo] = useState<BracketContents>(); | ||
|
||
useEffect(() => { | ||
const getRoundInfo = async () => { | ||
try { | ||
const res = await authAPI({ | ||
method: 'get', | ||
url: `/api/match/${router.query.channelLink as string}/${curRound}`, | ||
}); | ||
|
||
setRoundInfo(res.data); | ||
} catch (error) {} | ||
}; | ||
|
||
getRoundInfo(); | ||
}, []); | ||
|
||
const moveToCheckIn = (matchId: number) => { | ||
authAPI({ | ||
method: 'post', | ||
url: `/api/match/${router.query.channelLink as string}/${matchId}/call-off`, | ||
}); | ||
|
||
router.push(`/contents/${router.query.channelLink as string}/checkIn/${matchId}`); | ||
}; | ||
|
||
return ( | ||
<Ground> | ||
{roundInfo?.matchInfoDtoList.map((match) => { | ||
return ( | ||
<GroupContainer key={match.matchId} onClick={() => moveToCheckIn(match.matchId)}> | ||
<GroupTitle>{match.matchName}</GroupTitle> | ||
<Icon kind='shortcut' size={25} /> | ||
|
||
{(match.alarm || havingAlarm) && <AlarmCircle />} | ||
</GroupContainer> | ||
); | ||
})} | ||
</Ground> | ||
); | ||
}; | ||
|
||
const Ground = styled.div` | ||
margin: 2rem 0; | ||
`; | ||
|
||
const GroupContainer = styled.div` | ||
width: 15rem; | ||
height: 4rem; | ||
display: flex; | ||
align-items: center; | ||
border: 0.2rem solid #132043; | ||
justify-content: space-around; | ||
position: relative; | ||
cursor: pointer; | ||
`; | ||
|
||
const GroupTitle = styled.div` | ||
font-size: 2rem; | ||
`; | ||
|
||
const AlarmCircle = styled.div` | ||
position: absolute; | ||
width: 0.8rem; | ||
height: 0.8rem; | ||
right: 0.4rem; | ||
background-color: #c70039; | ||
border-radius: 0.4rem; | ||
`; | ||
|
||
export default RoundAlarmBody; |
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,52 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
interface Props { | ||
liveRound: number; | ||
curRound: number; | ||
} | ||
|
||
type bracketStatus = 'PAST' | 'PRESENT' | 'FUTURE'; | ||
|
||
const RoundAlarmHeader = ({ liveRound, curRound }: Props) => { | ||
return ( | ||
<> | ||
{liveRound > curRound && <Button status='PAST'>Round {curRound}</Button>} | ||
{liveRound === curRound && <Button status='PRESENT'>Round {curRound}</Button>} | ||
{liveRound < curRound && <Button status='FUTURE'>Round {curRound}</Button>} | ||
</> | ||
); | ||
}; | ||
|
||
const Button = styled.button<{ status: bracketStatus }>` | ||
width: 12rem; | ||
height: 4rem; | ||
border: none; | ||
padding: 0; | ||
margin: 0; | ||
font-size: 1.6rem; | ||
color: white; | ||
${(prop) => | ||
prop.status === 'PAST' && | ||
` | ||
background-color : #7C81AD; | ||
cursor: pointer; | ||
`} | ||
${(prop) => | ||
prop.status === 'PRESENT' && | ||
` | ||
background-color : #4B527E; | ||
cursor: pointer; | ||
`} | ||
${(prop) => | ||
prop.status === 'FUTURE' && | ||
` | ||
background-color : #2E4374; | ||
cursor: not-allowed | ||
`} | ||
`; | ||
|
||
export default RoundAlarmHeader; |
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
Oops, something went wrong.