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

Fix/몇몇 ts error 해결 및 리팩토링 #740 #741

Merged
merged 14 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
</br>
<br>

<div align=center>

<img width="600" alt="Frame 3" src="https://user-images.githubusercontent.com/86540825/209137349-57356fde-777f-4d4f-877f-b5f2b2053da0.png">

</br>
</br>
<br>
<br>

<h2>프로젝트 소개</h2>

42 서울 내에서 탁구 경기 매칭, 전적 서비스를 제공하는 프로젝트 입니다.

42 Cadet들만 이용 가능!

</br>
<br>

<h2>배포 주소</h2>

[42gg.kr](https://42gg.kr)

</br>
<br>

<h2>Front-end 기술 스택</h2>

Expand All @@ -34,7 +34,7 @@
<img src="https://img.shields.io/badge/Amazon EC2-FF9900?style=for-the-badge&logo=AmazonEC2&logoColor=white"/></a>
<img src="https://img.shields.io/badge/Amazon S3-569A31?style=for-the-badge&logo=AmazonS3&logoColor=white"/>

<br/>
<br>

<h2>멤버</h2>

Expand Down Expand Up @@ -72,7 +72,7 @@
</tr>
</table>

</br>
<br>

<h2>주요 기능 소개</h2>

Expand Down
1 change: 0 additions & 1 deletion components/Layout/MenuBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { userState } from 'utils/recoil/layout';
import { seasonListState } from 'utils/recoil/seasons';
import { openMenuBarState } from 'utils/recoil/layout';
import { modalState } from 'utils/recoil/modal';
import instance from 'utils/axios';
import styles from 'styles/Layout/MenuBar.module.scss';

export default function MenuBar() {
Expand Down
8 changes: 4 additions & 4 deletions components/Layout/NotiItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export default function NotiItem({ data }: NotiItemProps) {
} = {
imminent: {
title: '경기 준비',
content: makeImminentContent(data.enemyTeam, data.time, data.createdAt),
content: MakeImminentContent(data.enemyTeam, data.time, data.createdAt),
},
announce: { title: '공 지', content: makeAnnounceContent(data.message) },
announce: { title: '공 지', content: MakeAnnounceContent(data.message) },
matched: {
title: '매칭 성사',
content: makeContent(data.time, '에 신청한 매칭이 성사되었습니다.'),
Expand Down Expand Up @@ -53,7 +53,7 @@ function makeContent(time: string | undefined, message: string) {
if (time) return gameTimeToString(time) + message;
}

function makeAnnounceContent(message: string | undefined) {
function MakeAnnounceContent(message: string | undefined) {
if (message && !message.includes('https')) return message;
const url = message?.split('https')[1];
const content = message?.split('https')[0].split('=>')[0];
Expand All @@ -66,7 +66,7 @@ function makeAnnounceContent(message: string | undefined) {
);
}

function makeImminentContent(
function MakeImminentContent(
enemyTeam: string[] | undefined,
time: string | undefined,
createdAt: string
Expand Down
12 changes: 1 addition & 11 deletions components/admin/games/GamesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import { useCallback, useEffect, useState } from 'react';
import {
Paper,
Table,
TableBody,
TableCell,
TableContainer,
TableHead,
TableRow,
} from '@mui/material';
import PageNation from 'components/Pagination';
import { tableFormat } from 'constants/admin/table';
import { IGames, IGameLog } from 'types/admin/gameLogTypes';
import instance from 'utils/axios';
import { getFormattedDateToString } from 'utils/handleTime';
Expand Down Expand Up @@ -98,7 +88,7 @@ export default function GamesTable() {
시작 날짜: {game.startAt.toLocaleString().split(' ')[0]}
</div>
<div>게임 모드: {game.mode}</div>
<div>슬롯 시간: {game.slotTime}분</div>
<div>슬롯 시간: {game.playTime}분</div>
<div>
{game.mode === 'Normal'
? ''
Expand Down
2 changes: 1 addition & 1 deletion components/admin/notification/NotificationTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export default function NotificationTable() {
}
)}
</TableRow>
)}
))}
</TableBody>
</Table>
</TableContainer>
Expand Down
3 changes: 1 addition & 2 deletions components/admin/slot/SlotCurrent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export default function SlotCurrent(props: SlotCurrentProps) {
const { pastSlotTime } = scheduleInfo;

const slotHour = (date: string) => {
const time = new Date(date).getHours();
return time;
return new Date(date).getHours();
};

const initSlotInfo = () => {
Expand Down
3 changes: 1 addition & 2 deletions components/admin/slot/SlotMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ export default function SlotMain() {
};

const slotHour = (date: string) => {
const time = new Date(date).getHours();
return time;
return new Date(date).getHours();
};

const initSlotInfo = async () => {
Expand Down
1 change: 0 additions & 1 deletion components/game/big/GameResultBigTeam.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Link from 'next/link';
import router from 'next/router';
import { RankResult, RankPlayer, NormalPlayer } from 'types/gameTypes';
import PlayerImage from 'components/PlayerImage';
import styles from 'styles/game/GameResultItem.module.scss';
Expand Down
3 changes: 1 addition & 2 deletions components/match/MatchBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ export default function MatchBoard({ type, toggleMode }: MatchBoardProps) {
for (let j = 0; j < matchBoards[i].length; j++) {
const match = matchBoards[i][j];
if (match.status === 'open') {
const openSlotHour = new Date(match.time).getHours();
return openSlotHour;
return new Date(match.time).getHours();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions components/modal/admin/AdminPenaltyModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ export default function AdminPenaltyModal(props: { value: string }) {
const resultDate = fillZero(newDate.getDate().toString(), 2);
const resultHour = fillZero(newDate.getHours().toString(), 2);
const resultMinute = fillZero(newDate.getMinutes().toString(), 2);
const result = `${newDate.getFullYear()}-${resultMonth}-${resultDate} ${resultHour}:${resultMinute}`;
return result;
return `${newDate.getFullYear()}-${resultMonth}-${resultDate} ${resultHour}:${resultMinute}`;
};

const sendPenaltyHandler = async () => {
Expand Down
10 changes: 3 additions & 7 deletions components/modal/profile/EditProfileModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { profileState } from 'utils/recoil/user';
import { errorState } from 'utils/recoil/error';
import { modalState } from 'utils/recoil/modal';
import instance from 'utils/axios';
import styles from 'styles/user/Profile.module.scss';
import { racketTypes } from 'types/userTypes';
import styles from 'styles/user/Profile.module.scss';

interface EditedProfile {
racketType: string;
Expand Down Expand Up @@ -128,17 +128,13 @@ export default function EditProfileModal() {
<div className={styles.editType}>알림 받기</div>
<div className={styles.snsWrap}>
<div
className={`${styles.snsButton} ${
slack === true ? styles.snsClicked : ''
}`}
className={`${styles.snsButton} ${slack ? styles.snsClicked : ''}`}
onClick={() => setSlack(!slack)}
>
Slack
</div>
<div
className={`${styles.snsButton} ${
email === true ? styles.snsClicked : ''
}`}
className={`${styles.snsButton} ${email ? styles.snsClicked : ''}`}
onClick={() => setEmail(!email)}
>
Email
Expand Down
1 change: 0 additions & 1 deletion styles/admin/common/Pagination.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
padding: 0;

li {
display: inline-block;
cursor: pointer;
width: 27px;
height: 27px;
Expand Down
4 changes: 2 additions & 2 deletions styles/admin/feedback/FeedbackTable.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
@import 'styles/common.scss';

.feedbackWrap {
width: '100%';
height: '100%';
width: 100%;
height: 100%;

.header {
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions styles/admin/games/GamesTable.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
.gamesWrap {
display: flex;
flex-direction: column;
width: '100%';
height: '100%';
width: 100%;
height: 100%;
color: black;

.header {
Expand Down
2 changes: 1 addition & 1 deletion styles/admin/modal/AdminFeedbackCheck.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
justify-content: center;
align-items: center;
background-color: white;
box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.25);
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
border-radius: 10px;
width: 20rem;
height: 15rem;
Expand Down
9 changes: 4 additions & 5 deletions styles/admin/modal/AdminNoti.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
align-content: space-evenly;
width: 510px;
height: 130px;
padding: 0rem 1rem;
padding: 0 1rem;
}

.titleText {
Expand All @@ -38,11 +38,11 @@
.body {
display: flex;
flex-direction: column;
padding: 0rem 1rem;
padding: 0 1rem;
}

.bodyWrap {
padding: 0rem 1rem;
padding: 0 1rem;
}

.bodyText {
Expand Down Expand Up @@ -71,7 +71,7 @@
}

.messageWrap {
padding: 0rem 0rem;
padding: 0 0;
}

.messageBlank {
Expand Down Expand Up @@ -159,7 +159,6 @@
}
}
.dropdown {
width: 275px;
width: 100%;
z-index: 999;
padding: 0 0.8rem 0.5rem 0.5rem;
Expand Down
12 changes: 6 additions & 6 deletions styles/admin/modal/AdminPenalty.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
align-content: space-evenly;
width: 510px;
height: 130px;
padding: 0rem 1rem;
padding: 0 1rem;
}

.titleText {
Expand All @@ -40,7 +40,7 @@
}

.bodyWrap {
padding: 0rem 1rem;
padding: 0 1rem;
}

.bodyText {
Expand Down Expand Up @@ -71,7 +71,7 @@
display: flex;
align-items: center;
margin-bottom: 10px;
padding: 0rem 1rem;
padding: 0 1rem;
:focus {
outline: none;
}
Expand All @@ -93,7 +93,7 @@
display: flex;
align-items: center;
margin-bottom: 10px;
padding: 0rem 1rem;
padding: 0 1rem;
}

.reasonBlank {
Expand All @@ -112,7 +112,7 @@
display: flex;
align-items: center;
margin-bottom: 10px;
padding: 0rem 1rem;
padding: 0 1rem;
}

.durationBlank {
Expand All @@ -131,7 +131,7 @@
display: flex;
align-items: center;
margin-bottom: 10px;
padding: 0rem 1rem;
padding: 0 1rem;
}

.dateBlank {
Expand Down
2 changes: 1 addition & 1 deletion styles/admin/modal/AdminProfile.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.modal {
display: flex;
flex-direction: column;
box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.25);
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
width: 450px;
background-color: #ffffff;
border-radius: 10px;
Expand Down
2 changes: 1 addition & 1 deletion styles/admin/modal/DeletePenaltyModal.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
justify-content: center;
align-items: center;
background-color: white;
box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.25);
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
border-radius: $medium-radius;
width: 20rem;
height: 15rem;
Expand Down
4 changes: 2 additions & 2 deletions styles/admin/notification/NotificationTable.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
@import 'styles/common.scss';

.notificationWrap {
width: '100%';
height: '100%';
width: 100%;
height: 100%;

.header {
display: flex;
Expand Down
1 change: 0 additions & 1 deletion styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ ul {
}

ul.pagination li {
display: inline-block;
cursor: pointer;
width: 27px;
height: 27px;
Expand Down
Loading