-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(front): add experimental customJS system
- Loading branch information
1 parent
349e0c9
commit 2f5620f
Showing
11 changed files
with
215 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
"icns", | ||
"jwalk", | ||
"multispace", | ||
"noconflict", | ||
"rfind", | ||
"Rustup", | ||
"Skyrim", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Tooltip } from "@mui/material"; | ||
import MenuItem from "@mui/material/MenuItem"; | ||
import Select from "@mui/material/Select"; | ||
import { selectEditorMode } from "../utils/editor"; | ||
import type { EditorMode } from "@/utils/editor"; | ||
|
||
type Props = { | ||
setEditorMode: (value: EditorMode) => void; | ||
editorMode: EditorMode; | ||
}; | ||
|
||
export const SelectEditorMode = ({ editorMode, setEditorMode }: Props) => { | ||
return ( | ||
<Tooltip title="Editor Mode" placement="top"> | ||
<Select | ||
name={editorMode ?? "default"} | ||
onChange={(e) => { | ||
const presetEditor = selectEditorMode(e.target.value); | ||
setEditorMode(presetEditor); | ||
}} | ||
labelId="editor-select-label" | ||
id="editor-select" | ||
value={editorMode ?? "default"} | ||
> | ||
<MenuItem value={"default"}>Default</MenuItem> | ||
<MenuItem value={"vim"}>Vim</MenuItem> | ||
</Select> | ||
</Tooltip> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { useStorageState } from "./storage_state"; | ||
export { useDynStyle } from "./dyn_style"; | ||
export { useInjectScript, useDynStyle } from "./dyn_style"; | ||
export { useToastLimit } from "./toasts_limit"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export type EditorMode = "vim" | undefined; | ||
|
||
export function selectEditorMode(select: string): EditorMode { | ||
if (select === "vim") { | ||
return select; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.