Commit Graph

17 Commits

Author SHA1 Message Date
Daniel
ad9a12b2ec Fix reader nav bar scroll to page (#236)
* Correctly scroll to page

Using "curPage" as the "initialPage" broke "scrolling up".
The page got reset to the first page in that case

* Support resume and scrolling to page for "DoublePagedPager"

* Support resume and scrolling to page for "PagedPager"

* Prevent "ReaderNavBar" from disappearing in "VerticalPager"

Due to handling the overflow on the "root" div and the "nav bar" being sticky and having a combined with of 100vw with the "vertical pager", once the first page was reached, that was behind the 100vw, the "nav bar" got moved out of the screen.
This made using the "nav bar" unusable for the "vertical pager".
2023-02-12 18:42:17 +03:30
Daniel
c7aaed8378 Add chapter page dropdown (#230)
Makes it possible to select a specific page of the current chapter
2023-02-08 20:56:09 +03:30
Daniel
2c11708c92 increase prettier line length to 120 (#233)
* [Prettier] Increase max line length to 120

100 is quite low, especially on modern monitors.
The length is also reached quite quickly with 4 spaces per tab depending on the indentation depth

* [Prettier] Increase max line length to 120 - Fix formatting
2023-02-08 20:49:26 +03:30
Daniel
4e0a860dfd add prettier for auto formatting (#231)
* [Prettier] Add "prettier"

Makes the formatting of the code consistent.
By using the eslint-plugin-prettier formatting issues will be highlighted as a lint error.
These errors will be auto fixed by running "lint --fix" (which can be done automatically on file save)

* [Prettier] Add "prettier" - Fix formatting
2023-02-06 12:36:33 +03:30
Daniel
2eeea41a45 force absolute import path (#223)
* Add "no-relative-import-paths" eslint plugin

* Add "no-relative-import-paths" eslint plugin - Fix imports
2023-02-05 18:45:20 +03:30
Daniel
f7b369b95d set browser tab title (#220)
* Update the browser tab title

The tab title will be set to the same title as the "NavigationBar" with "- Tachidesk" as the suffix

* Set the manga title and chapter name as browser tab title in the reader

While the reader is still loading the "mangaId" and the "chapterIndex" will be set as the title.
2023-01-07 19:14:00 +03:30
Daniel
dca968fdb7 make default reader settings changeable (#217)
* [#214] Move "reader settings" util functions into new file

* [#214] Extract "options" of "ReaderSettings" to new component

* [#214] Add component for changing the default reader settings

* [#214] Add default "ReaderSettings" to "Settings"

* [#214] Use default "ReaderSettings" stored on the server

Wait for both "manga" and "defaultSettings" to be loaded.
Otherwise, by the time the "manga" response was received, the "defaultSettings" might be still loading and thus, the local fallback "default" settings will get used as the "default settings"

* [#214] Save and update "ReaderSettings" options in case they are missing

- Manga gets read the first time => save settings in metadata
- Default settings get opened the first time => save settings in global metadata
2023-01-06 20:04:16 +03:30
Daniel
46ac5d5531 Save reader settings per manga in Meta (#216)
* [#213] Add missing "meta" property

- IManga
- IMangaCard (optional)
- IChapter
- ICategory

* [#213] Add util functions for handling metadata

- global server
- manga
- chapter
- category

* [#213] Use "ReaderSettings" from the manga metadata

- get ReaderSettings from manga metadata
- remove unnecessary check "make sure settings has all the keys"
    in case the stored settings in the metadata are outdated they will be filled with default values

* [#213] Reload manga only in case "mangaId" changed

In case the chapter is still from the same manga, a reload is unnecessary

* [#213] Only update the changed reader setting

Otherwise the app has to send patch requests to the server for every setting even if it didn't change

* [#213] Hide "openButton" on first render in case "navBar" is shown

The "openButton" was always set to be visible event in case the navBar was shown on the first render

* [#213] Open the "ReaderNavBar" if needed after receiving new settings

Otherwise, the drawer won't open in case the "navBar" was hidden on the first render since the default state in that case was set to false

* [#213] Update "ReaderSettings" after receiving the manga response

Otherwise, the default settings aren't getting removed

* [#213] Hide/Show "OpenButton" when opening/closing the drawer

Otherwise, the button stays hidden until it gets updated due to scrolling

* [#213] Keep "ReaderNavBar" state when opening prev/next chapter

In case the navBar wasn't sticky but opened, it got closed when the prev/next chapter got opened

* [#213] Prevent "ReaderNavBar" from closing when changing "staticNav" setting
2023-01-06 19:45:29 +03:30
Valter Martinek
7aa4d2f3de Verticall scroll navigation and fix (#200)
* Remove scroll tracking from Page component

* Replace initial scrolling trigger with initialPage prop to be more clear on when to scroll to inital page

* Add current page tracking back to HorizontalPager

* Memoize prevChapter and nextChapter functions

* Rewrite navigation in vertical pager to scroll by screen percentage instead of whole pages, refactor code

* Handle last pages explicitly to fix issue with small last pages
2022-11-24 23:35:05 +03:30
Valter Martinek
3972d7757f Fix navbar back button behavior (#195)
* Enable passing backLink through location state. Explicitly handle cases for BACK

* Allow pages to override default backLink. Fix manga page back link

* Cleanup
2022-11-21 04:03:45 +03:30
Aria Moradi
4269ee7efa migrate Reader to Mui 5 (#100) 2021-12-04 10:29:36 +03:30
Aria Moradi
c214406546 migrate ReaderNavbar to Mui 5 (#84)
* migrate ReaderNavbar to Mui 5

* cleanup, show loading text when loading.
2021-12-01 03:03:52 +03:30
Aria Moradi
04a1898ea7 Revert "migrate some components to Mui5 new styling system (#72)"
This reverts commit 72ef61e286.
2021-11-15 17:21:31 +03:30
Aria Moradi
0eedbe6626 load first page on read manga (#76) 2021-11-15 12:53:18 +03:30
abhijeetChawla
72ef61e286 migrate some components to Mui5 new styling system (#72)
* - Changed the value in Manga from 960 to 900( md breakpooint)
- The CicularLoader in About  and Reader screens is now centered to the whole screen
- Changed relative imports in About screen to absolute imports
- removed changed styles from Browse Screen, PageNumber

* Migrated Source Card, Extension Card and LoadingPlaceHolder to MUI system

* Migrated CategorySelect and LandSelect to using the sx prop

* migrated ReaderNavbar to mui 5

* - Removed Unused Styles from Page
- Migrated DoublePage, doublePagedPager, PagedPager, Vertical Pager and Horizontal Pager.

* Replaced style prop with sx prop

* removed useStyles completely from the project except for the Manga Screen

* added a comment

* Fixed the Source Card Buttons padding

* Removed the trailing backspace

Co-authored-by: Sascha Hahne <ntbm@users.noreply.github.com>

Co-authored-by: Sascha Hahne <ntbm@users.noreply.github.com>
2021-11-14 13:51:08 +03:30
Aria Moradi
b6cf4a003e closes #58 2021-10-31 23:47:24 +03:30
Aria Moradi
51008b7ee4 refactor 2021-10-30 16:14:25 +03:30