diff --git a/frontend/index.html b/frontend/index.html index 6c894d3..56ea2aa 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -3,7 +3,7 @@ - + diff --git a/frontend/public/public/favicon.png b/frontend/public/public/logo.png similarity index 100% rename from frontend/public/public/favicon.png rename to frontend/public/public/logo.png diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 6b6cdb1..4b2e875 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -9,31 +9,38 @@ import '@uiw/react-md-editor/markdown-editor.css' import '@uiw/react-markdown-preview/markdown.css' import NotesScreen from '@/screens/NotesScreen' import TopViewContainer from '@/components/TopView.tsx' +import Root from '@/components/Root.tsx' const router = createBrowserRouter([ { path: '/', - element: - }, - { - path: '/search', - element: - }, - { - path: '/notes', - element: - }, - { - path: '/notes/:id', - element: - }, - { - path: '/notes/:id/edit', - element: - }, - { - path: '/new', - element: + element: , + children: [ + { + index: true, + element: + }, + { + path: '/search', + element: + }, + { + path: '/notes', + element: + }, + { + path: '/notes/:id', + element: + }, + { + path: '/notes/:id/edit', + element: + }, + { + path: '/new', + element: + } + ] } ]) diff --git a/frontend/src/components/LoadingView.tsx b/frontend/src/components/LoadingView.tsx index 50a3457..95c679d 100644 --- a/frontend/src/components/LoadingView.tsx +++ b/frontend/src/components/LoadingView.tsx @@ -3,7 +3,7 @@ import React from 'react' const LoadingView: React.FC = () => { return (
- +
) } diff --git a/frontend/src/components/Navbar.tsx b/frontend/src/components/Navbar.tsx index c47cfc4..3eca1cb 100644 --- a/frontend/src/components/Navbar.tsx +++ b/frontend/src/components/Navbar.tsx @@ -28,7 +28,7 @@ const Navbar: React.FC = () => { zIndex: 100, backgroundColor: isHome ? 'transparent' : 'var(--theme-navbar-color)' }}> -
+
{isHome &&
} {!isHome && ( @@ -41,8 +41,8 @@ const Navbar: React.FC = () => { )} {!isHome && ( -
-
+
+
= () => {
)} - +
-
+
) diff --git a/frontend/src/components/Root.tsx b/frontend/src/components/Root.tsx new file mode 100644 index 0000000..7e6e275 --- /dev/null +++ b/frontend/src/components/Root.tsx @@ -0,0 +1,14 @@ +import { Outlet } from 'react-router-dom' +import Navbar from '@/components/Navbar.tsx' +import React from 'react' + +const Root: React.FC = () => { + return ( +
+ + +
+ ) +} + +export default Root diff --git a/frontend/src/screens/EditNoteScreen/EditNoteScreen.tsx b/frontend/src/screens/EditNoteScreen/EditNoteScreen.tsx index 32d885e..4f73af5 100644 --- a/frontend/src/screens/EditNoteScreen/EditNoteScreen.tsx +++ b/frontend/src/screens/EditNoteScreen/EditNoteScreen.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useRef, useState } from 'react' -import Navbar from '@/components/Navbar.tsx' import { displayName, isValidFileName } from '@/utils' import { isAxiosError } from 'axios' import { useBlocker, useNavigate, useParams } from 'react-router-dom' @@ -96,8 +95,7 @@ const EditNoteScreen: React.FC = () => { return (
- -
+
{ return (
-
diff --git a/frontend/src/screens/NewNoteScreen/NewNoteScreen.tsx b/frontend/src/screens/NewNoteScreen/NewNoteScreen.tsx index fada387..0481038 100644 --- a/frontend/src/screens/NewNoteScreen/NewNoteScreen.tsx +++ b/frontend/src/screens/NewNoteScreen/NewNoteScreen.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useRef, useState } from 'react' -import Navbar from '@/components/Navbar.tsx' import { isValidFileName } from '@/utils' import { useBlocker, useNavigate } from 'react-router-dom' import MDEditor from '@uiw/react-md-editor' @@ -80,8 +79,7 @@ const NewNoteScreen: React.FC = () => { return (
- -
+
{ return (
-
{loading && !note && } {note && ( diff --git a/frontend/src/screens/NotesScreen/NotesScreen.tsx b/frontend/src/screens/NotesScreen/NotesScreen.tsx index 4b789fc..d63f3bf 100644 --- a/frontend/src/screens/NotesScreen/NotesScreen.tsx +++ b/frontend/src/screens/NotesScreen/NotesScreen.tsx @@ -1,5 +1,4 @@ import React, { useEffect, useState } from 'react' -import Navbar from '@/components/Navbar.tsx' import { NoteType } from '@/types' import useRequest from '@/hooks/useRequest.ts' import useDebouncedValue from '@/hooks/useDebouncedValue.ts' @@ -34,7 +33,6 @@ const NotesScreen: React.FC = () => { return (
-
{loading && isEmpty(notes) && } diff --git a/frontend/src/screens/SearchScreen/SearchScreen.tsx b/frontend/src/screens/SearchScreen/SearchScreen.tsx index 82b8792..274f1d3 100644 --- a/frontend/src/screens/SearchScreen/SearchScreen.tsx +++ b/frontend/src/screens/SearchScreen/SearchScreen.tsx @@ -1,7 +1,6 @@ import { Link, useNavigate, useSearchParams } from 'react-router-dom' import React, { useEffect, useState } from 'react' import { displayName, runAsyncFunction } from '@/utils' -import Navbar from '@/components/Navbar.tsx' import { NoteType } from '@/types' import './index.css' import LoadingView from '@/components/LoadingView.tsx' @@ -57,19 +56,12 @@ const SearchScreen: React.FC = () => { return (
-
About {notes.length} results ({time.toFixed(6)} seconds)
{isLoading && } - {empty && ( - - )} + {empty && } {notes.map((note, index) => (