Skip to content

Commit

Permalink
Merge pull request #813 from 42organization/GGFE-48-Style-Match-Slot
Browse files Browse the repository at this point in the history
[GGFE-48] �Match Slot 스타일
  • Loading branch information
42sungwook authored Jun 8, 2023
2 parents bfadcc7 + b9de4b0 commit 84b0d71
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 17 deletions.
42 changes: 27 additions & 15 deletions components/match/MatchBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export default function MatchBoard({ type, radioMode }: MatchBoardProps) {
const getFirstOpenSlot = () => {
for (let i = 0; i < matchBoards.length; i++) {
const matchSlot = matchBoards[i];
if (matchSlot.status === 'open') {
return stringToHourMin(matchSlot.startTime).nHour;
if (matchSlot[0].status === 'open') {
return stringToHourMin(matchSlot[0].startTime).nHour;
}
}
return null;
Expand Down Expand Up @@ -83,17 +83,29 @@ export default function MatchBoard({ type, radioMode }: MatchBoardProps) {
</button>
</div>
<div className={styles.matchBoard}>
{matchBoards.map((slot, index) => (
<div
key={index}
ref={getScrollCurrentRef(stringToHourMin(slot.startTime).nHour)}
>
{stringToHourMin(slot.startTime).sMin === '00' && (
<MatchTime startTime={slot.startTime} />
)}
<MatchSlot radioMode={radioMode} slot={slot} />
</div>
))}
{matchBoards.map((slot, index) => {
return (
<div
key={index}
ref={getScrollCurrentRef(
stringToHourMin(slot[0].startTime).nHour
)}
>
{stringToHourMin(slot[0].startTime).sMin === '00' && (
<MatchTime key={index} startTime={slot[0].startTime} />
)}
<div className={styles.slotGrid}>
{slot.map((minSlots, minIndex) => (
<MatchSlot
key={index + minIndex}
radioMode={radioMode}
slot={minSlots}
/>
))}
</div>
</div>
);
})}
</div>
</div>
</>
Expand Down Expand Up @@ -186,7 +198,7 @@ export const MatchSlot = ({ radioMode, slot }: MatchSlotProps) => {
status === 'close' ? 2 : status === 'mytable' || status === 'match' ? 1 : 0;

return (
<div className={styles.slotGrid}>
<>
<button
className={`${styles.slotButton} ${buttonStyle[status]}`}
// disabled={isDisabled}
Expand All @@ -207,6 +219,6 @@ export const MatchSlot = ({ radioMode, slot }: MatchSlotProps) => {
{isAfterSlot && (headCount === 0 ? '+' : `${headCount}/2`)}
</span>
</button>
</div>
</>
);
};
3 changes: 2 additions & 1 deletion styles/match/MatchBoard.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
.slotHour {
display: flex;
justify-content: space-between;
margin-top: 0.7rem;
margin-bottom: 0.5rem;
margin-left: 0.3rem;
color: white;
font-size: $big-font;
Expand All @@ -107,5 +109,4 @@
.slotGrid {
display: grid;
grid-template-columns: 1fr 1fr;
margin-top: 0.6rem;
}
2 changes: 1 addition & 1 deletion types/matchTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface Slot {
}

export interface Match {
matchBoards: Slot[];
matchBoards: Slot[][];
}
export interface CurrentMatchListElement {
startTime: string;
Expand Down

0 comments on commit 84b0d71

Please sign in to comment.