Skip to content

Commit

Permalink
reverts to page scroll instead of reader content scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
land-cap committed Jan 2, 2024
1 parent 59451dd commit 4ef2299
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 42 deletions.
3 changes: 0 additions & 3 deletions src/app/[readerMode]/_components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ export const Footer = () => (
mx: 'auto',
my: '20',
placeContent: 'center',
sm: {
my: '32',
},
textAlign: 'center',
w: 'full',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ export const BookList = ({
key={book.code}
isCurrBook={book.code === currBookCode}
isFirstEl={bookIndex === 0}
onClick={() => {
onListItemClick()
setSelectedBook(book)
}}
>
<BookListItem
onClick={() => {
onListItemClick()
setSelectedBook(book)
}}
>
{book.book_name?.name}
</BookListItem>
<BookListItem>{book.book_name?.name}</BookListItem>
</BookListItemContainer>
))
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
)
Expand Down Expand Up @@ -63,7 +60,10 @@ export const ReaderControls = ({ bookList }: { bookList: TBook[] }) => {
className={cx(
macrogrid({
bg: 'bg.canvas',
bottom: '0',
column: 'fullbleed',
position: 'sticky',
w: 'full',
}),
)}
>
Expand Down

This file was deleted.

9 changes: 3 additions & 6 deletions src/app/[readerMode]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
<ReaderPageContainer>
<Header />
{children}
<Footer />
</ReaderPageContainer>
<Header />
{children}
<Footer />
<ReaderControls bookList={bookList} />
</>
)
Expand Down
6 changes: 3 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ const RootLayout = ({ children }: { children: ReactNode }) => (
background: 'bg.canvas',
color: 'fg',
fontSize: 'base',
gridTemplateRows: '1fr min-content',
h: '100dvh',
overflow: 'clip',
gridTemplateRows: 'min-content 1fr min-content',
minH: 'screen',
overscrollBehavior: 'contain',
})}
>
{children}
Expand Down

1 comment on commit 4ef2299

@vercel
Copy link

@vercel vercel bot commented on 4ef2299 Jan 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

the-good-book – ./

the-good-book-dalandcap.vercel.app
the-good-book-git-master-dalandcap.vercel.app
the-good-book.vercel.app

Please sign in to comment.