diff --git a/src/app/[readerMode]/_components/Footer.tsx b/src/app/[readerMode]/_components/Footer.tsx index 4ba6dece..ec1c5487 100644 --- a/src/app/[readerMode]/_components/Footer.tsx +++ b/src/app/[readerMode]/_components/Footer.tsx @@ -14,9 +14,6 @@ export const Footer = () => ( mx: 'auto', my: '20', placeContent: 'center', - sm: { - my: '32', - }, textAlign: 'center', w: 'full', })} diff --git a/src/app/[readerMode]/_components/ReaderControls/ChapterPicker/BookList.tsx b/src/app/[readerMode]/_components/ReaderControls/ChapterPicker/BookList.tsx index fd6138d5..a796f941 100644 --- a/src/app/[readerMode]/_components/ReaderControls/ChapterPicker/BookList.tsx +++ b/src/app/[readerMode]/_components/ReaderControls/ChapterPicker/BookList.tsx @@ -18,14 +18,11 @@ export const BookList = ({ key={book.code} isCurrBook={book.code === currBookCode} isFirstEl={bookIndex === 0} + onClick={() => { + onListItemClick() + setSelectedBook(book) + }} > - { - onListItemClick() - setSelectedBook(book) - }} - > - {book.book_name?.name} - + {book.book_name?.name} )) diff --git a/src/app/[readerMode]/_components/ReaderControls/ReaderControls.tsx b/src/app/[readerMode]/_components/ReaderControls/ReaderControls.tsx index 1a77ee96..0f5643d5 100644 --- a/src/app/[readerMode]/_components/ReaderControls/ReaderControls.tsx +++ b/src/app/[readerMode]/_components/ReaderControls/ReaderControls.tsx @@ -10,7 +10,6 @@ import { type TBook } from '~/db' import { ChapterPicker } from './ChapterPicker' import { ReaderNavButton } from './ReaderNavButton' -import { useResetReaderScrollOnParamChange } from './useResetReaderScrollOnParamChange' export const ReaderControls = ({ bookList }: { bookList: TBook[] }) => { const { @@ -27,8 +26,6 @@ export const ReaderControls = ({ bookList }: { bookList: TBook[] }) => { throw new Error('No book data') } - useResetReaderScrollOnParamChange(currBook.code, chapter) - const currBookIndex = bookList.findIndex( (book) => book.book_name?.name === currBook.book_name?.name, ) @@ -63,7 +60,10 @@ export const ReaderControls = ({ bookList }: { bookList: TBook[] }) => { className={cx( macrogrid({ bg: 'bg.canvas', + bottom: '0', column: 'fullbleed', + position: 'sticky', + w: 'full', }), )} > diff --git a/src/app/[readerMode]/_components/ReaderControls/useResetReaderScrollOnParamChange.tsx b/src/app/[readerMode]/_components/ReaderControls/useResetReaderScrollOnParamChange.tsx deleted file mode 100644 index 234d580c..00000000 --- a/src/app/[readerMode]/_components/ReaderControls/useResetReaderScrollOnParamChange.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { useAtomValue } from 'jotai' -import { useCallback } from 'react' - -import { readerPageContainerElAtom } from '~/app/[readerMode]/_readerPage.state' - -import { useOnReaderParamChange } from './useOnReaderParamChange' - -export const useResetReaderScrollOnParamChange = ( - currBookCode: string, - currChapter: number, -) => { - const readerPageContentEl = useAtomValue(readerPageContainerElAtom) - - const handler = useCallback(() => { - readerPageContentEl?.scrollTo(0, 0) - }, [readerPageContentEl]) - - useOnReaderParamChange(handler, currBookCode, currChapter) -} diff --git a/src/app/[readerMode]/layout.tsx b/src/app/[readerMode]/layout.tsx index a94993e9..069f9a0b 100644 --- a/src/app/[readerMode]/layout.tsx +++ b/src/app/[readerMode]/layout.tsx @@ -5,18 +5,15 @@ import { getBookListWithCache } from '~/db' import { Footer } from './_components/Footer' import { Header } from './_components/Header' import { ReaderControls } from './_components/ReaderControls' -import { ReaderPageContainer } from './_components/ReaderPageContainer' const Layout = async ({ children }: { children: ReactNode }) => { const bookList = await getBookListWithCache() return ( <> - -
- {children} -