diff --git a/package.json b/package.json index 45f8157b..314eedae 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "url": "^0.11.3" }, "dependencies": { + "@codemirror/lang-less": "^6.0.2", "@million/lint": "latest", "@sentry/browser": "^7.100.1", "@sentry/cli": "^2.28.6", @@ -43,6 +44,8 @@ "@types/react-dom": "^18.2.19", "@types/sortablejs": "^1.15.7", "@types/webextension-polyfill": "^0.10.7", + "@uiw/codemirror-theme-github": "^4.21.25", + "@uiw/react-codemirror": "^4.21.25", "@vitejs/plugin-react": "^4.2.1", "autoprefixer": "^10.4.17", "color": "^4.2.3", diff --git a/src/interface/components/CodeEditor.tsx b/src/interface/components/CodeEditor.tsx new file mode 100644 index 00000000..8b9aae88 --- /dev/null +++ b/src/interface/components/CodeEditor.tsx @@ -0,0 +1,30 @@ +import CodeMirror, { ViewUpdate } from '@uiw/react-codemirror' +import { githubDark, githubLight } from '@uiw/codemirror-theme-github' +import { less } from '@codemirror/lang-less' +import { useCallback, useEffect, useState } from 'react'; + +export default function CodeEditor({ callback, initialState }: { callback: (value: string) => void, initialState: string }) { + const [value, setValue] = useState(initialState) + const [darkMode, setDarkMode] = useState(true) + + useEffect(() => { + if (document.body.classList.contains('dark')) { + setDarkMode(true) + } + }, []) + + const onChange = useCallback((value: string, _: ViewUpdate) => { + setValue(value) + callback(value) + }, []) + + return( + + ) +} \ No newline at end of file diff --git a/src/interface/main.tsx b/src/interface/main.tsx index 1ea8973f..21c17296 100644 --- a/src/interface/main.tsx +++ b/src/interface/main.tsx @@ -7,6 +7,7 @@ import browser from 'webextension-polyfill'; import font from '../resources/fonts/IconFamily.woff' import * as Sentry from "@sentry/react"; +import ThemeCreator from './pages/ThemeCreator'; browser.storage.local.get().then(({ telemetry, DarkMode }) => { if (DarkMode) document.body.classList.add('dark'); @@ -41,6 +42,7 @@ root.render( } /> } /> + } /> , diff --git a/src/interface/pages/About.tsx b/src/interface/pages/About.tsx deleted file mode 100644 index 39bd95cc..00000000 --- a/src/interface/pages/About.tsx +++ /dev/null @@ -1,20 +0,0 @@ -const About: React.FC = () => { - - return ( -
-
-

About

-

BetterSEQTA+ is a branch of BetterSEQTA which was originally developed by Nulkem. It was discontinued. So BetterSEQTA+ has come in to fill in that gap!

-

We are currently working on fixing bugs and adding new features. If you want to request a feature or report a bug, you can do so on - Github. -

-
-
-

Credits

-

Nulkem for the original extension, OG-RandomTechChannel, Crazypersonalph, and the current maintainer BetterSEQTA

-
-
- ); -}; - -export default About; diff --git a/src/interface/pages/ThemeCreator.tsx b/src/interface/pages/ThemeCreator.tsx new file mode 100644 index 00000000..cc255e84 --- /dev/null +++ b/src/interface/pages/ThemeCreator.tsx @@ -0,0 +1,14 @@ +import CodeEditor from '../components/CodeEditor'; + +export default function ThemeCreator() { + const handleSave = (value: string) => { + // Save the theme + console.log(value) + } + + return ( +
+ +
+ ); +} \ No newline at end of file