diff --git a/app/components/note/EditorTheme.ts b/app/components/note/EditorTheme.ts deleted file mode 100644 index a0f3687..0000000 --- a/app/components/note/EditorTheme.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { createTheme } from '@uiw/codemirror-themes' - -export const editorTheme = createTheme({ - theme: 'dark', - settings: { - background: '#080f11', - foreground: '#c8cacb', - caret: '#E7E7E8', - selection: '#5B5F61', - selectionMatch: '#5B5F61', - gutterBackground: '#141B1D', - gutterForeground: '#7e8385', - gutterBorder: '#1C2225', - lineHighlight: '#1c2225', - }, - styles: [], -}) diff --git a/app/components/note/NoteForm.tsx b/app/components/note/NoteForm.tsx index 876f935..2b743c7 100644 --- a/app/components/note/NoteForm.tsx +++ b/app/components/note/NoteForm.tsx @@ -8,7 +8,7 @@ import { Spinner } from '@oxide/design-system' import { Asciidoc, prepareDocument } from '@oxide/react-asciidoc' import * as Dropdown from '@radix-ui/react-dropdown-menu' -import { useFetcher, useLoaderData } from '@remix-run/react' +import { useFetcher } from '@remix-run/react' import dayjs from 'dayjs' import { useCallback, useEffect, useMemo, useState } from 'react' @@ -118,10 +118,6 @@ export const NoteForm = ({ return prepareDocument( ad.load(body, { standalone: true, - sourcemap: true, - attributes: { - sectnums: false, - }, }), ) }, [body]) @@ -191,7 +187,7 @@ export const NoteForm = ({ width: `calc(${100 - leftPaneWidth}% - 2px)`, }} > - + @@ -215,7 +211,7 @@ const SavingIndicator = ({ updated: string }) => { return ( -
+
{dayjs(updated).format('MMM D YYYY, h:mm A')} {status === 'unsaved' ? ( diff --git a/app/root.tsx b/app/root.tsx index e6a4c30..fa0c785 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -23,6 +23,7 @@ import { useLoaderData, useRouteError, useRouteLoaderData, + type ShouldRevalidateFunction, } from '@remix-run/react' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' @@ -41,6 +42,13 @@ import styles from '~/styles/index.css?url' import LoadingBar from './components/LoadingBar' import { inlineCommentsCookie, themeCookie } from './services/cookies.server' +export const shouldRevalidate: ShouldRevalidateFunction = ({ currentUrl, nextUrl }) => { + if (currentUrl.pathname.startsWith('/notes/') && nextUrl.pathname.startsWith('/notes/')) { + return false + } + return true +} + export const meta: MetaFunction = () => { return [{ title: 'RFD / Oxide' }] } diff --git a/app/routes/notes_.$id.tsx b/app/routes/notes_.$id.tsx index 8063e87..1e51b97 100644 --- a/app/routes/notes_.$id.tsx +++ b/app/routes/notes_.$id.tsx @@ -20,7 +20,7 @@ import Container from '~/components/Container' import { DropdownItem, DropdownLink, DropdownMenu } from '~/components/Dropdown' import Icon from '~/components/Icon' -import { NoteItem } from './notes_' +import { type NoteItem } from './notes_' import { PropertyRow } from './rfd.$slug' const ad = asciidoctor()