diff --git a/src/components/Settings/Customization/Theme/CustomCssChanger.tsx b/src/components/Settings/Customization/Theme/CustomCssChanger.tsx index 97155a688..d829570d1 100644 --- a/src/components/Settings/Customization/Theme/CustomCssChanger.tsx +++ b/src/components/Settings/Customization/Theme/CustomCssChanger.tsx @@ -1,24 +1,13 @@ -import { - Box, - createStyles, - Group, - Loader, - ScrollArea, - Stack, - Text, - useMantineTheme, -} from '@mantine/core'; +import { Box, createStyles, Group, Loader, Stack, Text, useMantineTheme } from '@mantine/core'; import { useDebouncedValue } from '@mantine/hooks'; import { useTranslation } from 'next-i18next'; -import dynamic from 'next/dynamic'; -import { ChangeEvent, useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; +import Editor from 'react-simple-code-editor'; +import { highlight, languages } from 'prismjs'; import { useConfigContext } from '../../../../config/provider'; import { useConfigStore } from '../../../../config/store'; - -const CodeEditor = dynamic( - () => import('@uiw/react-textarea-code-editor').then((mod) => mod.default), - { ssr: false } -); +import 'prismjs/components/prism-css'; +import 'prismjs/themes/prism.css'; export const CustomCssChanger = () => { const { t } = useTranslation('settings/customization/page-appearance'); @@ -53,22 +42,20 @@ export const CustomCssChanger = () => { {t('customCSS.label')} - {t('customCSS.description')} + {t('customCSS.description')}
- - ) => - setNonDebouncedCustomCSS(event.target.value.trim()) - } - language="css" - data-color-mode={colorScheme} - minHeight={codeEditorHeight} - /> - + setNonDebouncedCustomCSS(code)} + highlight={(code) => highlight(code, languages.extend('css', {}), 'css')} + padding={10} + style={{ + fontFamily: '"Fira code", "Fira Mono", monospace', + fontSize: 12, + minHeight: codeEditorHeight, + }} + /> {codeIsDirty && ( diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 4b10110a6..81107b5f4 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -29,7 +29,6 @@ import { usePackageAttributesStore } from '../tools/client/zustands/usePackageAt import 'video.js/dist/video-js.css'; import '../styles/global.scss'; -import '@uiw/react-textarea-code-editor/dist.css'; function App( this: any, diff --git a/src/widgets/video/VideoFeed.tsx b/src/widgets/video/VideoFeed.tsx index 604426c70..ab4e4744b 100644 --- a/src/widgets/video/VideoFeed.tsx +++ b/src/widgets/video/VideoFeed.tsx @@ -1,5 +1,4 @@ -import { LoadingOverlay } from '@mantine/core'; -import { createStyles } from '@mantine/styles'; +import { createStyles, LoadingOverlay } from '@mantine/core'; import { useEffect, useRef, useState } from 'react'; import videojs from 'video.js'; import 'video.js/dist/video-js.css'; diff --git a/src/widgets/video/VideoStreamTile.tsx b/src/widgets/video/VideoStreamTile.tsx index 873af47c8..028809f99 100644 --- a/src/widgets/video/VideoStreamTile.tsx +++ b/src/widgets/video/VideoStreamTile.tsx @@ -1,6 +1,6 @@ import { Center, Group, Stack, Title } from '@mantine/core'; import { IconDeviceCctv, IconHeartBroken } from '@tabler/icons'; -import { useTranslation } from 'react-i18next'; +import { useTranslation } from 'next-i18next'; import { defineWidget } from '../helper'; import { IWidget } from '../widgets'; import VideoFeed from './VideoFeed';