Просмотр исходного кода

use SupportedAction instead of string

WNomunomu 2 лет назад
Родитель
Сommit
760db2de68

+ 1 - 1
apps/app/src/components/InAppNotification/PageNotification/PageModelNotification.tsx

@@ -75,7 +75,7 @@ const useActionMsgAndIcon = (notification: IInAppNotification & HasObjectId): Ac
       actionMsg = 'reverted under';
       actionIcon = 'icon-action-undo';
       break;
-    case 'COMMENT_CREATE':
+    case SupportedAction.ACTION_COMMENT_CREATE:
       actionMsg = 'commented on';
       actionIcon = 'icon-bubble';
       break;

+ 2 - 1
apps/app/src/components/InAppNotification/PageNotification/UserModelNotification.tsx

@@ -6,6 +6,7 @@ import type { HasObjectId } from '@growi/core';
 import { useRouter } from 'next/router';
 
 import type { IInAppNotificationOpenable } from '~/client/interfaces/in-app-notification-openable';
+import { SupportedAction } from '~/interfaces/activity';
 import type { IInAppNotification } from '~/interfaces/in-app-notification';
 
 import { ModelNotification } from './ModelNotification';
@@ -17,7 +18,7 @@ const useActionMsgAndIcon = (notification: IInAppNotification & HasObjectId): Ac
   let actionIcon: string;
 
   switch (actionType) {
-    case 'USER_REGISTRATION_APPROVAL_REQUEST':
+    case SupportedAction.ACTION_USER_REGISTRATION_APPROVAL_REQUEST:
       actionMsg = 'requested registration approval';
       actionIcon = 'icon-bubble';
       break;