Skip to content

Commit

Permalink
disable extra controls while slideshow is running
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhuignoto committed Feb 21, 2024
1 parent 16bfbd0 commit 8c17f03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/timeline/timeline-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const TimelineToolbar: FunctionComponent<TimelineToolbarProps> = ({
toolbarPosition,
textDensity,
isMobile,

} = useContext(GlobalContext);

// Define the toolbar items
Expand Down Expand Up @@ -104,7 +105,7 @@ const TimelineToolbar: FunctionComponent<TimelineToolbarProps> = ({
onToggleDarkMode={toggleDarkMode}
onPaused={onPaused}
/>
<ToolbarExtraControl $isMobile={isMobile}>
<ToolbarExtraControl $isMobile={isMobile} $slideShowRunning={slideShowRunning}>
<ToolbarExtraControlChild key="quick-jump">
{enableQuickJump ? (
<QuickJump
Expand Down
6 changes: 5 additions & 1 deletion src/components/timeline/timeline.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,16 @@ export const ToolbarWrapper = styled.div<{ position: 'top' | 'bottom' }>`
order: ${(p) => (p.position === 'top' ? 0 : 1)};
`;

export const ToolbarExtraControl = styled.ul<{ $isMobile: boolean }>`
export const ToolbarExtraControl = styled.ul<{
$isMobile: boolean;
$slideShowRunning: boolean;
}>`
display: flex;
align-items: center;
list-style: none;
margin: 0;
padding: 0.5rem;
visibility: ${(p) => (p.$slideShowRunning ? 'hidden' : 'visible')};
// margin-top: ${(p) => (p.$isMobile ? '1rem' : '0')};
`;

Expand Down

0 comments on commit 8c17f03

Please sign in to comment.