-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added a useLocalStorageReducer funtion This is mostly a refactor of ChapterOptions to simplify it with a reducer function Also moved a lot of function used in ChaperList to a utility file * Added UseCallback where needed * renamed utility folder to util to follow the convention throughout the app * Refactor: Moved Resume FAB to seperate file * Renamed Types and Function for chapter filtering and sorting with the chapterOption prefix * more renaming
- Loading branch information
Showing
7 changed files
with
216 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (C) Contributors to the Suwayomi project | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
import React from 'react'; | ||
import { Fab } from '@mui/material'; | ||
import { Link } from 'react-router-dom'; | ||
import { PlayArrow } from '@mui/icons-material'; | ||
|
||
interface ResumeFABProps{ | ||
chapter: IChapter | ||
mangaId: string | ||
} | ||
|
||
export default function ResumeFab(props: ResumeFABProps) { | ||
const { chapter: { index, lastPageRead }, mangaId } = props; | ||
return ( | ||
<Fab | ||
sx={{ position: 'fixed', bottom: '2em', right: '3em' }} | ||
component={Link} | ||
variant="extended" | ||
color="primary" | ||
to={`/manga/${mangaId}/chapter/${index}/page/${lastPageRead}`} | ||
> | ||
<PlayArrow /> | ||
{index === 1 ? 'Start' : 'Resume' } | ||
</Fab> | ||
); | ||
} |
Oops, something went wrong.