2021-05-17 01:38:59 +04:30
|
|
|
/*
|
|
|
|
|
* 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
|
2023-05-18 13:17:41 +02:00
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
2021-05-17 01:38:59 +04:30
|
|
|
|
2024-04-14 15:50:12 +02:00
|
|
|
import Box from '@mui/material/Box';
|
2023-06-05 01:42:39 +02:00
|
|
|
import { IReaderSettings } from '@/typings';
|
2021-05-15 17:18:57 +04:30
|
|
|
|
|
|
|
|
interface IProps {
|
2023-02-06 10:06:33 +01:00
|
|
|
settings: IReaderSettings;
|
|
|
|
|
curPage: number;
|
|
|
|
|
pageCount: number;
|
2021-05-15 17:18:57 +04:30
|
|
|
}
|
|
|
|
|
|
2023-10-28 00:32:02 +02:00
|
|
|
export function PageNumber(props: IProps) {
|
2021-05-15 17:18:57 +04:30
|
|
|
const { settings, curPage, pageCount } = props;
|
|
|
|
|
|
|
|
|
|
return (
|
2023-02-06 10:06:33 +01:00
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
display: settings.showPageNumber ? 'block' : 'none',
|
|
|
|
|
position: 'fixed',
|
|
|
|
|
bottom: '50px',
|
|
|
|
|
padding: '2px',
|
|
|
|
|
paddingLeft: '4px',
|
|
|
|
|
paddingRight: '4px',
|
|
|
|
|
textAlign: 'center',
|
|
|
|
|
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
|
|
|
borderRadius: '10px',
|
|
|
|
|
}}
|
2021-12-04 10:36:55 +03:30
|
|
|
>
|
2021-05-15 17:18:57 +04:30
|
|
|
{`${curPage + 1} / ${pageCount}`}
|
2021-12-04 10:36:55 +03:30
|
|
|
</Box>
|
2021-05-15 17:18:57 +04:30
|
|
|
);
|
|
|
|
|
}
|