Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminleonard committed Dec 17, 2024
1 parent cea30e3 commit 5e49280
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
17 changes: 0 additions & 17 deletions app/components/note/EditorTheme.ts

This file was deleted.

10 changes: 3 additions & 7 deletions app/components/note/NoteForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -118,10 +118,6 @@ export const NoteForm = ({
return prepareDocument(
ad.load(body, {
standalone: true,
sourcemap: true,
attributes: {
sectnums: false,
},
}),
)
}, [body])
Expand Down Expand Up @@ -191,7 +187,7 @@ export const NoteForm = ({
width: `calc(${100 - leftPaneWidth}% - 2px)`,
}}
>
<Asciidoc document={doc} options={{ ...opts }} />
<Asciidoc document={doc} options={opts} />
</div>
</div>
</fetcher.Form>
Expand All @@ -215,7 +211,7 @@ const SavingIndicator = ({
updated: string
}) => {
return (
<div className="flex items-center gap-1 text-sans-md text-tertiary">
<div className="flex items-center gap-2 text-sans-md text-tertiary">
{dayjs(updated).format('MMM D YYYY, h:mm A')}
{status === 'unsaved' ? (
<TypingIndicator />
Expand Down
8 changes: 8 additions & 0 deletions app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
useLoaderData,
useRouteError,
useRouteLoaderData,
type ShouldRevalidateFunction,
} from '@remix-run/react'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'

Expand All @@ -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' }]
}
Expand Down
2 changes: 1 addition & 1 deletion app/routes/notes_.$id.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 5e49280

Please sign in to comment.