diff --git a/components/EditorNavigation.tsx b/components/EditorNavigation.tsx index 5220298..32b19ec 100644 --- a/components/EditorNavigation.tsx +++ b/components/EditorNavigation.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useCallback } from "react"; +import React, { useState, useEffect, useCallback, useRef } from "react"; import { Plus, Share, @@ -101,7 +101,7 @@ const EditorNavigation = ({ showWat }: { showWat?: boolean }) => { if (!filename) { return { error: "You need to add filename" }; } - if (snap.files.find(file => file.name === filename)) { + if (snap.files.find((file) => file.name === filename)) { return { error: "Filename already exists." }; } @@ -132,22 +132,41 @@ const EditorNavigation = ({ showWat }: { showWat?: boolean }) => { createNewFile(filename); setFilename(""); }, [filename, setIsNewfileDialogOpen, setFilename, validateFilename]); - + const scrollRef = useRef(null); + const containerRef = useRef(null); const files = snap.files; return ( { + if (scrollRef.current) { + scrollRef.current.scrollLeft += e.deltaY; + } }} > - + { setFilename(e.target.value)} - onKeyPress={e => { + onChange={(e) => setFilename(e.target.value)} + onKeyPress={(e) => { if (e.key === "Enter") { handleConfirm(); } @@ -509,8 +528,8 @@ const EditorNavigation = ({ showWat }: { showWat?: boolean }) => { type="number" min="1" value={editorSettings.tabSize} - onChange={e => - setEditorSettings(curr => ({ + onChange={(e) => + setEditorSettings((curr) => ({ ...curr, tabSize: Number(e.target.value), })) diff --git a/components/Navigation.tsx b/components/Navigation.tsx index e7dc7db..dfa24f1 100644 --- a/components/Navigation.tsx +++ b/components/Navigation.tsx @@ -340,6 +340,8 @@ const Navigation = () => { height: 0, background: "transparent", }, + scrollbarColor: "transparent", + scrollbarWidth: "none", }} >