diff --git a/src/components/DocumentSettings.tsx b/src/components/DocumentSettings.tsx
index 84abae2..f78d482 100644
--- a/src/components/DocumentSettings.tsx
+++ b/src/components/DocumentSettings.tsx
@@ -414,10 +414,10 @@ export function DocumentSettings({ isOpen, setIsOpen, epub, html }: {
onChange={(e) => updateConfigKey('epubTheme', e.target.checked)}
className="form-checkbox h-4 w-4 text-accent rounded border-muted"
/>
- Use theme (experimental)
+ Use theme
- Apply the current app theme to the EPUB viewer
+ Apply the current app theme to the EPUB viewer background and text colors
)}
diff --git a/src/components/EPUBViewer.tsx b/src/components/EPUBViewer.tsx
index 7f0e5c3..7289538 100644
--- a/src/components/EPUBViewer.tsx
+++ b/src/components/EPUBViewer.tsx
@@ -1,6 +1,6 @@
'use client';
-import { useEffect, useRef, useCallback } from 'react';
+import { useEffect, useRef, useCallback, useState } from 'react';
import dynamic from 'next/dynamic';
import { useEPUB } from '@/contexts/EPUBContext';
import { useTTS } from '@/contexts/TTSContext';
@@ -8,6 +8,7 @@ import { useConfig } from '@/contexts/ConfigContext';
import { DocumentSkeleton } from '@/components/DocumentSkeleton';
import { useEPUBTheme, getThemeStyles } from '@/hooks/epub/useEPUBTheme';
import { useEPUBResize } from '@/hooks/epub/useEPUBResize';
+import { DotsVerticalIcon, ChevronLeftIcon, ChevronRightIcon } from '@/components/icons/Icons';
const ReactReader = dynamic(() => import('react-reader').then(mod => mod.ReactReader), {
ssr: false,
@@ -19,9 +20,12 @@ interface EPUBViewerProps {
}
export function EPUBViewer({ className = '' }: EPUBViewerProps) {
+ const [isTocOpen, setIsTocOpen] = useState(false);
const {
currDocData,
currDocName,
+ currDocPage,
+ currDocPages,
locationRef,
handleLocationChanged,
bookRef,
@@ -116,7 +120,62 @@ export function EPUBViewer({ className = '' }: EPUBViewerProps) {
return (
-
+
+
+
+
+
+ {currDocPages !== undefined && typeof currDocPage === 'number' && (
+
+ {currDocPage} / {currDocPages}
+
+ )}
+
+
+ {isTocOpen && tocRef.current && tocRef.current.length > 0 && (
+
+
Skip to chapters
+
+ {tocRef.current.map((item, index) => (
+
+ ))}
+
+
+ )}
+
}
key={'epub-reader'}
@@ -125,8 +184,8 @@ export function EPUBViewer({ className = '' }: EPUBViewerProps) {
url={currDocData}
title={currDocName}
tocChanged={(_toc) => (tocRef.current = _toc)}
- showToc={true}
- readerStyles={epubTheme && getThemeStyles() || undefined}
+ showToc={false}
+ readerStyles={getThemeStyles(epubTheme)}
getRendition={(_rendition) => {
setRendition(_rendition);
updateTheme();
diff --git a/src/components/icons/Icons.tsx b/src/components/icons/Icons.tsx
index ffbfead..292e937 100644
--- a/src/components/icons/Icons.tsx
+++ b/src/components/icons/Icons.tsx
@@ -373,6 +373,50 @@ export function DotsVerticalIcon(props: React.SVGProps
) {
);
}
+export function ChevronLeftIcon(props: React.SVGProps) {
+ return (
+
+ );
+}
+
+export function ChevronRightIcon(props: React.SVGProps) {
+ return (
+
+ );
+}
+
export function SpeedometerIcon(props: React.SVGProps) {
return (