diff --git a/apps/readest-app/public/apple-touch-icon.png b/apps/readest-app/public/apple-touch-icon.png new file mode 100644 index 00000000..1a3caa24 Binary files /dev/null and b/apps/readest-app/public/apple-touch-icon.png differ diff --git a/apps/readest-app/public/favicon.ico b/apps/readest-app/public/favicon.ico new file mode 100644 index 00000000..4be4cfdb Binary files /dev/null and b/apps/readest-app/public/favicon.ico differ diff --git a/apps/readest-app/src/app/layout.tsx b/apps/readest-app/src/app/layout.tsx index d1dfbcad..87fae059 100644 --- a/apps/readest-app/src/app/layout.tsx +++ b/apps/readest-app/src/app/layout.tsx @@ -1,46 +1,36 @@ -'use client'; - import * as React from 'react'; -import { usePathname } from 'next/navigation'; import { AuthProvider } from '@/context/AuthContext'; import { EnvProvider } from '@/context/EnvContext'; import { CSPostHogProvider } from '@/context/PHContext'; -import { useTheme } from '@/hooks/useTheme'; -import { isTauriAppPlatform } from '@/services/environment'; -import { checkForAppUpdates } from '@/helpers/updater'; import '../styles/globals.css'; import '../styles/fonts.css'; +const url = 'https://web.readest.com/'; +const title = 'Readest — Where You Read, Digest and Get Insight'; +const description = 'Readest brings your entire library to your fingertips.'; +const previewImage = 'https://cdn.readest.com/images/open_graph_preview_read_now.png'; + export default function RootLayout({ children }: { children: React.ReactNode }) { - useTheme(); - const pathname = usePathname(); - React.useEffect(() => { - document.documentElement.setAttribute('data-page', pathname.replace('/', '') || 'default'); - }, [pathname]); - - React.useEffect(() => { - const doAppUpdates = async () => { - if (isTauriAppPlatform()) { - await checkForAppUpdates(); - } - }; - doAppUpdates(); - }, []); - - React.useEffect(() => { - // TODO: disabled for now - // if (process.env['NODE_ENV'] === 'production') { - // document.oncontextmenu = (event) => { - // event.preventDefault(); - // }; - // } - }, []); - return ( + {title} + + + + + + + + + + + + + + diff --git a/apps/readest-app/src/app/library/page.tsx b/apps/readest-app/src/app/library/page.tsx index f436df84..97acec93 100644 --- a/apps/readest-app/src/app/library/page.tsx +++ b/apps/readest-app/src/app/library/page.tsx @@ -9,9 +9,11 @@ import { AppService } from '@/types/system'; import { navigateToReader } from '@/utils/nav'; import { parseOpenWithFiles } from '@/helpers/cli'; import { isTauriAppPlatform } from '@/services/environment'; +import { checkForAppUpdates } from '@/helpers/updater'; import { FILE_ACCEPT_FORMATS, SUPPORTED_FILE_EXTS } from '@/services/constants'; import { useEnv } from '@/context/EnvContext'; +import { useTheme } from '@/hooks/useTheme'; import { useLibraryStore } from '@/store/libraryStore'; import { useSettingsStore } from '@/store/settingsStore'; @@ -28,12 +30,22 @@ const LibraryPage = () => { checkOpenWithBooks, clearOpenWithBooks, } = useLibraryStore(); + useTheme(); const { setSettings } = useSettingsStore(); const [loading, setLoading] = useState(false); const isInitiating = useRef(false); const [libraryLoaded, setLibraryLoaded] = useState(false); const [isSelectMode, setIsSelectMode] = useState(false); + React.useEffect(() => { + const doAppUpdates = async () => { + if (isTauriAppPlatform()) { + await checkForAppUpdates(); + } + }; + doAppUpdates(); + }, []); + const processOpenWithFiles = React.useCallback( async (appService: AppService, openWithFiles: string[], libraryBooks: Book[]) => { const bookIds: string[] = []; diff --git a/apps/readest-app/src/app/reader/page.tsx b/apps/readest-app/src/app/reader/page.tsx index 76c76aa1..faa1228a 100644 --- a/apps/readest-app/src/app/reader/page.tsx +++ b/apps/readest-app/src/app/reader/page.tsx @@ -1,7 +1,21 @@ 'use client'; +import { useEffect } from 'react'; +import { useTheme } from '@/hooks/useTheme'; +import { isTauriAppPlatform } from '@/services/environment'; +import { checkForAppUpdates } from '@/helpers/updater'; import Reader from './components/Reader'; export default function Page() { + useTheme(); + useEffect(() => { + const doAppUpdates = async () => { + if (isTauriAppPlatform()) { + await checkForAppUpdates(); + } + }; + doAppUpdates(); + }, []); + return ; }