Skip to content

Commit

Permalink
[Fix] [GGFE-233] if문->switch로 변경 + 삭제불가 -> X
Browse files Browse the repository at this point in the history
  • Loading branch information
PHJoon committed Sep 11, 2023
1 parent c558eec commit b11c650
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions components/admin/usageHistory/MenuTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,20 @@ function MenuTab() {
];

useEffect(() => {
if (tabIdx === 0) setChild(<MegaphoneList />);
if (tabIdx === 1) setChild(<ProfileList />);
if (tabIdx === 2) setChild(<ProfileListCurrent />);
if (tabIdx === 3) setChild(<ProfileDeleteHistoryList />);
switch (tabIdx) {
case 0:
setChild(<MegaphoneList />);
break;
case 1:
setChild(<ProfileList />);
break;
case 2:
setChild(<ProfileListCurrent />);
break;
case 3:
setChild(<ProfileDeleteHistoryList />);
break;
}
}, [tabIdx]);

return (
Expand Down
2 changes: 1 addition & 1 deletion components/admin/usageHistory/ProfileList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function ProfileList() {
onClick={() => deleteProfile(profile)}
disabled={!profile.isCurrent}
>
삭제
{profile.isCurrent ? '삭제' : 'X'}
</button>
) : columnName === 'isCurrent' ? (
profile[columnName as keyof Iprofile] ? (
Expand Down

0 comments on commit b11c650

Please sign in to comment.