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
|
|
|
|
2021-05-15 17:18:57 +04:30
|
|
|
import React from 'react';
|
2021-12-04 10:36:55 +03:30
|
|
|
import { Box } from '@mui/system';
|
2023-02-24 16:40:37 +01: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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function PageNumber(props: IProps) {
|
|
|
|
|
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',
|
|
|
|
|
right: settings.staticNav ? 'calc((100vw - 325px)/2)' : 'calc((100vw - 25px)/2)',
|
|
|
|
|
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
|
|
|
);
|
|
|
|
|
}
|