Skip to content

Commit

Permalink
[Feat] 노쇼 신고 로직 완성, 한글 모달 이름 적용, css 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
contemplation-person committed Mar 29, 2024
1 parent c32cb7a commit 9c73d3a
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 27 deletions.
9 changes: 8 additions & 1 deletion components/modal/Party/PartyReportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,18 @@ export function PartyReportModal({ report }: { report: PartyReportModalData }) {
reportHandler().catch(() => setIsLoading(false));
};

const reportName =
report.name === 'NOSHOW'
? `${report.userIntraId} 노쇼 신고`
: report.name === 'COMMENT'
? '댓글 신고'
: '방 신고';

return (
<div className={styles.container}>
<div>
<div className={styles.title}>42GG</div>
<div className={styles.phrase}>{`${report.name} REPORT`}</div>
<div className={styles.phrase}>{`${reportName}`}</div>
</div>
<form>
<div className={styles.contentWrapper}>
Expand Down
26 changes: 26 additions & 0 deletions components/party/roomDetail/PartyDetailButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import { instance } from 'utils/axios';
import { modalState } from 'utils/recoil/modal';
import { toastState } from 'utils/recoil/toast';
import styles from 'styles/party/PartyDetailRoom.module.scss';

type ParytButtonProps = {
roomId?: number;
commentId?: number;
userIntraId?: string;
};

function ReportComment({ commentId }: ParytButtonProps) {
Expand Down Expand Up @@ -53,6 +55,29 @@ function ReportRoom({ roomId }: ParytButtonProps) {
);
}

function ReportNoShow({ roomId, userIntraId }: ParytButtonProps) {
const setModal = useSetRecoilState(modalState);

return (
<button
className={styles.noShowBtn}
onClick={() => {
setModal({
partyReport: {
name: 'NOSHOW',
roomId: roomId,
userIntraId: userIntraId,
},
modalName: 'PARTY-REPORT',
});
}}
>
<div style={{ margin: '0 0.3rem' }}>노쇼 신고</div>
<LuAlertTriangle color='gray' style={{ marginTop: 'auto' }} />
</button>
);
}

function ShareRoom() {
const roomId = useRouter().query.roomId;
const setSnackbar = useSetRecoilState(toastState);
Expand Down Expand Up @@ -172,6 +197,7 @@ const PartyRoomDetailButton = {
JoinRoom,
LeaveRoom,
StartRoom,
ReportNoShow,
};

export default PartyRoomDetailButton;
17 changes: 15 additions & 2 deletions components/party/roomDetail/PartyDetailProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ export default function PartyDetailProfile({
</button>
</div>
<div className={styles.profileItem}>
<Profile roomUsers={roomUsers} hostNickname={hostNickname} />
<Profile
roomUsers={roomUsers}
hostNickname={hostNickname}
roomStatus={status}
/>
</div>
<ButtonHandler
currentPeople={currentPeople}
Expand All @@ -55,9 +59,10 @@ export default function PartyDetailProfile({
type ProfileProps = {
roomUsers: PartyRoomUser[];
hostNickname: string;
roomStatus: PartyRoomStatus;
};

function Profile({ roomUsers, hostNickname }: ProfileProps) {
function Profile({ roomUsers, hostNickname, roomStatus }: ProfileProps) {
return (
<ul>
{roomUsers.map(({ intraId, nickname, userImage }) => (
Expand All @@ -80,6 +85,14 @@ function Profile({ roomUsers, hostNickname }: ProfileProps) {
<div style={{ color: nameToRGB(nickname) }}>
{intraId || nickname}
</div>
{roomStatus !== 'OPEN' && intraId ? (
<PartyRoomDetailButton.ReportNoShow
roomId={1}
userIntraId={intraId}
/>
) : (
<></>
)}
</li>
))}
</ul>
Expand Down
53 changes: 30 additions & 23 deletions styles/party/PartyDetailRoom.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,6 @@ $detailCommonRem: 1rem;

/* =========================================== */

/* ----------------button--------------------- */
.reportRoomBtn {
display: flex;
align-items: flex-end;
padding: 0 0 0 0.3rem;
background-color: inherit;
border: none;
opacity: 0.7;
}

.shareBtn {
position: relative;
padding-top: 0;
padding-right: 0;
padding-left: 0.2 rem;
text-align: right;
background-color: inherit;
border: none;
}

/* =========================================== */

/* ----------------title---------------------- */
.titleBox {
position: flex;
Expand Down Expand Up @@ -77,6 +55,25 @@ $detailCommonRem: 1rem;
align-items: center;
}

.reportRoomBtn {
display: flex;
align-items: flex-end;
padding: 0 0 0 0.3rem;
background-color: inherit;
border: none;
opacity: 0.7;
}

.shareBtn {
position: relative;
padding-top: 0;
padding-right: 0;
padding-left: 0.2 rem;
text-align: right;
background-color: inherit;
border: none;
}

.title {
font-size: $giant-font;
font-weight: bold;
Expand Down Expand Up @@ -157,6 +154,17 @@ $detailCommonRem: 1rem;
border-radius: $big-radius;
}

.noShowBtn {
display: flex;
min-width: 100%;
color: white;
text-align: center;
background-color: inherit;
border: none;
justify-content: center;
size: 50rem;
}

.btnContainer {
text-align: right;
border-bottom: 0.3rem;
Expand Down Expand Up @@ -298,7 +306,6 @@ $detailCommonRem: 1rem;
background-color: rgba(216, 216, 216, 0.484);
border-radius: $small-radius;
align-items: center;
// justify-content: space-between;
}

.textBar {
Expand Down
2 changes: 1 addition & 1 deletion types/modalTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export interface PartyReportModalData {
name: 'COMMENT' | 'ROOM' | 'NOSHOW';
commentId?: number;
roomId?: number;
userIntraId?: number;
userIntraId?: string;
}

export interface Modal {
Expand Down

0 comments on commit 9c73d3a

Please sign in to comment.