2024-09-28 03:24:16 +02:00
|
|
|
/*
|
|
|
|
|
* 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 Stack from '@mui/material/Stack';
|
|
|
|
|
import { styled } from '@mui/material/styles';
|
2025-08-16 02:02:13 +02:00
|
|
|
import { IReaderSettings } from '@/features/reader/Reader.types.ts';
|
2025-08-15 22:02:58 +02:00
|
|
|
import { shouldForwardProp } from '@/features/core/utils/ShouldForwardProp.ts';
|
|
|
|
|
import { applyStyles } from '@/features/core/utils/ApplyStyles.ts';
|
2025-08-16 02:02:13 +02:00
|
|
|
import { getProgressBarPositionInfo } from '@/features/reader/overlay/progress-bar/ReaderProgressBar.utils.tsx';
|
2024-09-28 03:24:16 +02:00
|
|
|
|
|
|
|
|
type ReaderProgressBarContainerProps = Pick<IReaderSettings, 'progressBarPosition'>;
|
|
|
|
|
export const ReaderProgressBarContainer = styled(Stack, {
|
|
|
|
|
shouldForwardProp: shouldForwardProp<ReaderProgressBarContainerProps>(['progressBarPosition']),
|
|
|
|
|
})<ReaderProgressBarContainerProps>(({ theme, progressBarPosition }) => ({
|
|
|
|
|
position: 'fixed',
|
2024-11-04 18:00:35 +01:00
|
|
|
pointerEvents: 'all',
|
2025-04-27 01:05:25 +02:00
|
|
|
touchAction: 'none',
|
2024-09-28 03:24:16 +02:00
|
|
|
...applyStyles(getProgressBarPositionInfo(progressBarPosition).isHorizontal, {
|
|
|
|
|
justifyContent: 'flex-end',
|
|
|
|
|
bottom: 0,
|
|
|
|
|
right: 0,
|
|
|
|
|
}),
|
|
|
|
|
...applyStyles(getProgressBarPositionInfo(progressBarPosition).isVertical, {
|
|
|
|
|
top: 0,
|
|
|
|
|
bottom: 0,
|
|
|
|
|
}),
|
|
|
|
|
...applyStyles(getProgressBarPositionInfo(progressBarPosition).isLeft, {
|
|
|
|
|
alignItems: theme.direction === 'ltr' ? 'flex-start' : 'flex-end',
|
|
|
|
|
}),
|
|
|
|
|
...applyStyles(getProgressBarPositionInfo(progressBarPosition).isRight, {
|
|
|
|
|
alignItems: theme.direction === 'ltr' ? 'flex-end' : 'flex-start',
|
|
|
|
|
}),
|
|
|
|
|
}));
|