Browse Source

improve barrel import

Yuki Takei 1 month ago
parent
commit
6484e71079

+ 3 - 3
apps/app/src/client/components/Admin/Customize/CustomizeNoscriptSetting.tsx

@@ -1,8 +1,8 @@
-import React, { type JSX, useCallback, useEffect } from 'react';
+import { type JSX, useCallback, useEffect } from 'react';
 import { useTranslation } from 'next-i18next';
 import { useTranslation } from 'next-i18next';
 import { useForm } from 'react-hook-form';
 import { useForm } from 'react-hook-form';
-import { PrismAsyncLight } from 'react-syntax-highlighter';
-import { oneDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';
+import PrismAsyncLight from 'react-syntax-highlighter/dist/esm/prism-async-light';
+import oneDark from 'react-syntax-highlighter/dist/esm/styles/prism/one-dark';
 import { Card, CardBody } from 'reactstrap';
 import { Card, CardBody } from 'reactstrap';
 
 
 import AdminCustomizeContainer from '~/client/services/AdminCustomizeContainer';
 import AdminCustomizeContainer from '~/client/services/AdminCustomizeContainer';

+ 2 - 2
apps/app/src/client/components/Admin/Customize/CustomizeScriptSetting.tsx

@@ -1,8 +1,8 @@
 import React, { type JSX, useCallback, useEffect } from 'react';
 import React, { type JSX, useCallback, useEffect } from 'react';
 import { useTranslation } from 'next-i18next';
 import { useTranslation } from 'next-i18next';
 import { useForm } from 'react-hook-form';
 import { useForm } from 'react-hook-form';
-import { PrismAsyncLight } from 'react-syntax-highlighter';
-import { oneDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';
+import PrismAsyncLight from 'react-syntax-highlighter/dist/esm/prism-async-light';
+import oneDark from 'react-syntax-highlighter/dist/esm/styles/prism/one-dark';
 import { Card, CardBody } from 'reactstrap';
 import { Card, CardBody } from 'reactstrap';
 
 
 import AdminCustomizeContainer from '~/client/services/AdminCustomizeContainer';
 import AdminCustomizeContainer from '~/client/services/AdminCustomizeContainer';

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

@@ -1,7 +1,7 @@
 import type { JSX } from 'react';
 import type { JSX } from 'react';
 import { useTranslation } from 'next-i18next';
 import { useTranslation } from 'next-i18next';
-import { PrismAsyncLight } from 'react-syntax-highlighter';
-import { oneDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';
+import PrismAsyncLight from 'react-syntax-highlighter/dist/esm/prism-async-light';
+import oneDark from 'react-syntax-highlighter/dist/esm/styles/prism/one-dark';
 
 
 export const Cheatsheet = (): JSX.Element => {
 export const Cheatsheet = (): JSX.Element => {
   const { t } = useTranslation();
   const { t } = useTranslation();

+ 2 - 2
apps/app/src/components/ReactMarkdownComponents/PrismHighlighter.tsx

@@ -1,6 +1,6 @@
 import type { JSX, ReactNode } from 'react';
 import type { JSX, ReactNode } from 'react';
-import { PrismAsyncLight } from 'react-syntax-highlighter';
-import { oneDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';
+import PrismAsyncLight from 'react-syntax-highlighter/dist/esm/prism-async-light';
+import oneDark from 'react-syntax-highlighter/dist/esm/styles/prism/one-dark';
 
 
 // Remove font-family to use the page's default monospace font
 // Remove font-family to use the page's default monospace font
 Object.entries<object>(oneDark).forEach(([key, value]) => {
 Object.entries<object>(oneDark).forEach(([key, value]) => {