- Adjusted padding in EntryTitle and EntryDetailScreen for uniformity. - Updated HTML component to enhance structure and readability. - Modified CSS classes in HTML and image components for better alignment. - Cleaned up link component styles to remove unnecessary classes. These changes enhance the overall user interface and maintain a consistent design throughout the application. Signed-off-by: Innei <tukon479@gmail.com>
49 lines
1.2 KiB
TypeScript
49 lines
1.2 KiB
TypeScript
import { createStore, Provider, useAtomValue } from "jotai"
|
|
|
|
import type { EntryModel } from "../types"
|
|
import {
|
|
codeThemeDarkAtom,
|
|
codeThemeLightAtom,
|
|
entryAtom,
|
|
noMediaAtom,
|
|
readerRenderInlineStyleAtom,
|
|
} from "./atoms"
|
|
import { HTML } from "./HTML"
|
|
|
|
const store = createStore()
|
|
|
|
Object.assign(window, {
|
|
setEntry(entry: EntryModel) {
|
|
store.set(entryAtom, entry)
|
|
bridge.measure()
|
|
},
|
|
setCodeTheme(light: string, dark: string) {
|
|
store.set(codeThemeLightAtom, light)
|
|
store.set(codeThemeDarkAtom, dark)
|
|
},
|
|
setReaderRenderInlineStyle(value: boolean) {
|
|
store.set(readerRenderInlineStyleAtom, value)
|
|
},
|
|
setNoMedia(value: boolean) {
|
|
store.set(noMediaAtom, value)
|
|
},
|
|
reset() {
|
|
store.set(entryAtom, null)
|
|
bridge.measure()
|
|
},
|
|
})
|
|
|
|
export const App = () => {
|
|
const entry = useAtomValue(entryAtom, { store })
|
|
const readerRenderInlineStyle = useAtomValue(readerRenderInlineStyleAtom, { store })
|
|
const noMedia = useAtomValue(noMediaAtom, { store })
|
|
|
|
return (
|
|
<Provider store={store}>
|
|
<HTML renderInlineStyle={readerRenderInlineStyle} noMedia={noMedia}>
|
|
{entry?.content}
|
|
</HTML>
|
|
</Provider>
|
|
)
|
|
}
|