소스 검색

clean code

jam411 3 년 전
부모
커밋
1fe9fd7d62
1개의 변경된 파일5개의 추가작업 그리고 13개의 파일을 삭제
  1. 5 13
      packages/app/src/components/Admin/Notification/GlobalNotificationTypeIcon.tsx

+ 5 - 13
packages/app/src/components/Admin/Notification/GlobalNotificationTypeIcon.tsx

@@ -21,17 +21,9 @@ export const GlobalNotificationTypeIcon = (props: GlobalNotificationTypeIconProp
   }
 
   // Global notification
-  const type = (__t != null && __t === 'mail') ? 'mail' : 'slack';
-
-  const elemId = `notification-${type}-${_id}`;
-
-  return (
-    <>
-      { type === 'mail' ? (
-        <><i id={elemId} className='icon-fw fa fa-envelope-o'></i><UncontrolledTooltip target={elemId}>Mail</UncontrolledTooltip></>
-      ) : (
-        <><i id={elemId} className='icon-fw fa fa-hashtag'></i><UncontrolledTooltip target={elemId}>Slack</UncontrolledTooltip></>
-      ) }
-    </>
-  );
+  const elemId = `notification-${__t}-${_id}`;
+  const className = __t === 'mail' ? 'icon-fw fa fa-envelope-o' : 'icon-fw fa fa-hashtag';
+  const toolChip = __t === 'mail' ? 'Mail' : 'Slack';
+
+  return <><i id={elemId} className={className}></i><UncontrolledTooltip target={elemId}>{toolChip}</UncontrolledTooltip></>;
 };