Skip to content

Commit

Permalink
[Feat] 패널티 부여 버튼 연결 #666
Browse files Browse the repository at this point in the history
  • Loading branch information
김성욱 authored and 김성욱 committed Feb 27, 2023
1 parent 33d1339 commit 14aaaed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
14 changes: 11 additions & 3 deletions components/admin/users/UserManagementTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@ export default function UserManagementTable() {

const buttonList: string[] = [styles.detail, styles.penalty];

const handleButtonAction = (buttonName: string, userId: number) => {
const handleButtonAction = (
buttonName: string,
userId: number,
intraId: string
) => {
switch (buttonName) {
case '자세히':
setModal({ modalName: 'ADMIN-PROFILE', userId });
break;
case '패널티 부여':
// setModal({ modalName: 'ADMIN-PENALTY', userId });
setModal({ modalName: 'ADMIN-PENALTY', intraId });
break;
}
};
Expand Down Expand Up @@ -140,7 +144,11 @@ export default function UserManagementTable() {
key={buttonName}
className={`${styles.button} ${buttonList[index]}`}
onClick={() =>
handleButtonAction(buttonName, userInfo.id)
handleButtonAction(
buttonName,
userInfo.id,
userInfo.intraId
)
}
>
{buttonName}
Expand Down
18 changes: 1 addition & 17 deletions pages/admin/penalty.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
import { useSetRecoilState } from 'recoil';
import { modalState } from 'utils/recoil/modal';

export default function Penalty() {
const setModal = useSetRecoilState(modalState);

return (
<div>
penalty page{' '}
<button
onClick={() =>
setModal({ modalName: 'ADMIN-PENALTY', intraId: 'daijeong' })
}
>
패널티 부여
</button>
</div>
);
return <div></div>;
}

0 comments on commit 14aaaed

Please sign in to comment.