Browse Source

160341-172821-二重記述部分の修正

mariko-h 3 months ago
parent
commit
1f7dd8a4b1

+ 3 - 2
apps/app/src/client/components/PageEditor/EditorGuideModal/EditorGuideModal.tsx

@@ -14,12 +14,13 @@ import { DecorationTab } from './contents/DecorationTab';
 import { LayoutTab } from './contents/LayoutTab';
 import { TextStyleTab } from './contents/TextStyleTab';
 
-type TabType = 'textstyle' | 'layout' | 'decoration';
+const TAB_TYPES = ['textstyle', 'layout', 'decoration'] as const;
+type TabType = (typeof TAB_TYPES)[number];
 type Props = {
   containerRef: RefObject<HTMLDivElement | null>,
 };
 const isTabType = (key: string): key is TabType => {
-  return ['textstyle', 'layout', 'decoration'].includes(key);
+  return (TAB_TYPES as readonly string[]).includes(key);
 };
 
 /**