diff --git a/src/components/setting/NotificationSection.tsx b/src/components/setting/NotificationSection.tsx index bd0bc069..8f044dee 100644 --- a/src/components/setting/NotificationSection.tsx +++ b/src/components/setting/NotificationSection.tsx @@ -13,6 +13,7 @@ import SlackIcon from "@/assets/logo/social-logo/plain/slack.svg?react"; type TNotificationSectionProps = { email: string; + isAdmin: boolean; masterEnabled: boolean; onMasterEnabledChange: (value: boolean) => void; //channel @@ -48,6 +49,7 @@ type TNotificationSectionProps = { export default function NotificationSection({ email, + isAdmin, masterEnabled, onMasterEnabledChange, browserPush, @@ -158,140 +160,145 @@ export default function NotificationSection({ /> - -
-
- -
-

슬랙 연동하기

-

- {slackConnected - ? "연동됨 • 알림 on/off는 저장 시 반영" - : "Webhook URL로 연동"} -

+ {isAdmin && ( +
+
+ +
+

슬랙 연동하기

+

+ {slackConnected + ? "연동됨 • 알림 on/off는 저장 시 반영" + : "Webhook URL로 연동"} +

+
+ {slackConnected ? ( +
+ {slackEnabled && !channelDisabled && ( + 켜짐 + )} + onSlackEnabledChange(!slackEnabled)} + ariaLabel="슬랙 알림 켜기/끄기" + /> + +
+ ) : ( + <> + onSlackWebhookUrlChange(e.target.value)} + error={!!slackWebhookError} + helperText={slackWebhookError} + disabled={channelDisabled || isAnyOrgPending} + wrapperClassName="w-1/4 shrink-0" + containerClassName="h-10 rounded-lg" + inputClassName="px-3 font-body2" + /> + + + )}
- {slackConnected ? ( -
- {slackEnabled && !channelDisabled && ( - 켜짐 - )} - onSlackEnabledChange(!slackEnabled)} - ariaLabel="슬랙 알림 켜기/끄기" - /> - -
- ) : ( -
- onSlackWebhookUrlChange(e.target.value)} - error={!!slackWebhookError} - helperText={slackWebhookError} - disabled={channelDisabled || isAnyOrgPending} - wrapperClassName="w-1/4 shrink-0 tablet:w-full" - containerClassName="h-10 rounded-lg" - inputClassName="px-3 font-body2" - /> - -
- )} -
+ )} -
-
- -
-

디스코드 연동하기

-

- {discordConnected - ? "연동됨 • 알림 on/off는 저장 시 반영" - : "Webhook URL로 연동"} -

+ {isAdmin && ( +
+
+ +
+

+ 디스코드 연동하기 +

+

+ {discordConnected + ? "연동됨 • 알림 on/off는 저장 시 반영" + : "Webhook URL로 연동"} +

+
+ {discordConnected ? ( +
+ {discordEnabled && !channelDisabled && ( + 켜짐 + )} + onDiscordEnabledChange(!discordEnabled)} + ariaLabel="디스코드 알림 켜기/끄기" + /> + +
+ ) : ( + <> + onDiscordWebhookUrlChange(e.target.value)} + error={!!discordWebhookError} + helperText={discordWebhookError} + disabled={channelDisabled || isAnyOrgPending} + wrapperClassName="w-1/4 shrink-0" + containerClassName="h-10 rounded-lg" + inputClassName="px-3 font-body2" + /> + + + )}
- {discordConnected ? ( -
- {discordEnabled && !channelDisabled && ( - 켜짐 - )} - onDiscordEnabledChange(!discordEnabled)} - ariaLabel="디스코드 알림 켜기/끄기" - /> - -
- ) : ( -
- onDiscordWebhookUrlChange(e.target.value)} - error={!!discordWebhookError} - helperText={discordWebhookError} - disabled={channelDisabled || isAnyOrgPending} - wrapperClassName="w-1/4 shrink-0 tablet:w-full" - containerClassName="h-10 rounded-lg" - inputClassName="px-3 font-body2" - /> - -
- )} -
+ )}
diff --git a/src/pages/setting/Setting.tsx b/src/pages/setting/Setting.tsx index 73e35949..1576154b 100644 --- a/src/pages/setting/Setting.tsx +++ b/src/pages/setting/Setting.tsx @@ -131,6 +131,9 @@ export default function Setting() { getMyWorkspaces, ); + const myRole = useWorkspaceStore((s) => s.myRole); + const isAdmin = myRole === "ADMIN"; + const { data: notificationSettings, isLoading: isNotificationLoading, @@ -419,7 +422,10 @@ export default function Setting() { const shouldSaveMaster = canSaveNotification && hasMasterChanges && selectedOrgId != null; const shouldSaveOrg = - canSaveNotification && hasOrgToggleChanges && selectedOrgId != null; + canSaveNotification && + hasOrgToggleChanges && + selectedOrgId != null && + isAdmin; if ( shouldSaveChannel || @@ -648,6 +654,7 @@ export default function Setting() { > { if (!value) {