Make minimized standard progress bar gaps transparent

This commit is contained in:
schroda
2025-01-02 14:43:01 +01:00
parent 87a1a67880
commit 4aa144cb25
2 changed files with 4 additions and 24 deletions

View File

@@ -12,7 +12,6 @@ import { memo } from 'react';
import { applyStyles } from '@/modules/core/utils/ApplyStyles.ts'; import { applyStyles } from '@/modules/core/utils/ApplyStyles.ts';
import { ReaderProgressBarSlot } from '@/modules/reader/components/overlay/progress-bar/ReaderProgressBarSlot.tsx'; import { ReaderProgressBarSlot } from '@/modules/reader/components/overlay/progress-bar/ReaderProgressBarSlot.tsx';
import { IReaderSettings } from '@/modules/reader/types/Reader.types.ts'; import { IReaderSettings } from '@/modules/reader/types/Reader.types.ts';
import { getProgressBarPositionInfo } from '@/modules/reader/utils/ReaderProgressBar.utils.tsx';
export const ReaderProgressBarSlotDesktop = memo( export const ReaderProgressBarSlotDesktop = memo(
({ ({
@@ -22,8 +21,6 @@ export const ReaderProgressBarSlotDesktop = memo(
secondaryPageLoadState, secondaryPageLoadState,
progressBarPosition, progressBarPosition,
isCurrentPage, isCurrentPage,
isFirstPage,
isLastPage,
isLeadingPage, isLeadingPage,
showDraggingStyle, showDraggingStyle,
}: Pick<IReaderSettings, 'progressBarPosition'> & { }: Pick<IReaderSettings, 'progressBarPosition'> & {
@@ -32,15 +29,11 @@ export const ReaderProgressBarSlotDesktop = memo(
primaryPageLoadState: boolean; primaryPageLoadState: boolean;
secondaryPageLoadState?: boolean; secondaryPageLoadState?: boolean;
isCurrentPage: boolean; isCurrentPage: boolean;
isFirstPage: boolean;
isLastPage: boolean;
isLeadingPage: boolean; isLeadingPage: boolean;
showDraggingStyle: boolean; showDraggingStyle: boolean;
}) => { }) => {
const theme = useTheme(); const theme = useTheme();
const { isVertical, isHorizontal } = getProgressBarPositionInfo(progressBarPosition);
return ( return (
<ReaderProgressBarSlot <ReaderProgressBarSlot
key={pageUrl} key={pageUrl}
@@ -51,16 +44,6 @@ export const ReaderProgressBarSlotDesktop = memo(
sx: { sx: {
cursor: 'pointer', cursor: 'pointer',
backgroundColor: darken(theme.palette.background.paper, 0.2), backgroundColor: darken(theme.palette.background.paper, 0.2),
...applyStyles(isHorizontal, {
borderLeftWidth: 2,
borderLeftColor: 'background.paper',
borderLeftStyle: 'solid',
}),
...applyStyles(isVertical, {
borderTopWidth: 2,
borderTopColor: 'background.paper',
borderTopStyle: 'solid',
}),
...theme.applyStyles('dark', { ...theme.applyStyles('dark', {
backgroundColor: lighten(theme.palette.background.paper, 0.1), backgroundColor: lighten(theme.palette.background.paper, 0.1),
}), }),
@@ -73,8 +56,6 @@ export const ReaderProgressBarSlotDesktop = memo(
}), }),
}, },
), ),
borderLeftWidth: isFirstPage ? 0 : undefined,
borderRightWidth: isLastPage ? 0 : undefined,
}, },
}, },
tooltip: { tooltip: {

View File

@@ -59,13 +59,13 @@ const BaseStandardReaderProgressBar = ({
createProgressBarSlot={useCallback( createProgressBarSlot={useCallback(
( (
page, page,
pagesIndex, _pagesIndex,
primaryPageLoadState, primaryPageLoadState,
secondaryPageLoadState, secondaryPageLoadState,
isCurrentPage, isCurrentPage,
isLeadingPage, isLeadingPage,
_, _isTrailingPage,
totalPages_, _totalPages,
showDraggingStyle, showDraggingStyle,
) => ( ) => (
<ReaderProgressBarSlotDesktop <ReaderProgressBarSlotDesktop
@@ -75,8 +75,6 @@ const BaseStandardReaderProgressBar = ({
secondaryPageLoadState={secondaryPageLoadState} secondaryPageLoadState={secondaryPageLoadState}
progressBarPosition={progressBarPosition} progressBarPosition={progressBarPosition}
isCurrentPage={isCurrentPage} isCurrentPage={isCurrentPage}
isFirstPage={pagesIndex === 0}
isLastPage={pagesIndex === totalPages_ - 1}
isLeadingPage={isLeadingPage} isLeadingPage={isLeadingPage}
showDraggingStyle={showDraggingStyle} showDraggingStyle={showDraggingStyle}
/> />
@@ -182,6 +180,7 @@ const BaseStandardReaderProgressBar = ({
}, },
progressBarSlotsContainer: { progressBarSlotsContainer: {
sx: { sx: {
gap: 0.25,
borderRadius: 2, borderRadius: 2,
transition: 'height 0.1s ease-in-out', transition: 'height 0.1s ease-in-out',
...applyStyles(isHorizontal, { ...applyStyles(isHorizontal, {