Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions apps/frontend/src/components/MainActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import { useLinkColor } from '../hooks/useLinkColor';
import { Icon } from '@chakra-ui/react';

export const MainActionBar = () => {
const [showPowerControls, setShowPowerControls] = React.useState(false);
const [showWorkoutControls, setShowWorkoutControls] = React.useState(false);
const [showControls, setShowControls] = React.useState(false);

const linkColor = useLinkColor();

Expand All @@ -30,8 +29,8 @@ export const MainActionBar = () => {
<Center mb="5" mx="2">
<Stack p="5" borderRadius="1em" bgColor={bgColor} pointerEvents="auto">
<PausedWorkoutButtons />
{showWorkoutControls ? <WorkoutControls /> : null}
{showPowerControls ? <PowerControls /> : null}
{showControls ? <WorkoutControls /> : null}
{showControls ? <PowerControls /> : null}

{!smartTrainerIsConnected ? (
<Center>
Expand All @@ -50,11 +49,11 @@ export const MainActionBar = () => {
<Center height="100%">
<HStack>
<SelectWorkoutButton />
<Tooltip label="Show workout controls">
<Tooltip label="Show controls">
<IconButton
aria-label="Show workout controls"
variant={showWorkoutControls ? 'outline' : 'solid'}
onClick={() => setShowWorkoutControls((current) => !current)}
aria-label="Show controls"
variant={showControls ? 'outline' : 'solid'}
onClick={() => setShowControls((current) => !current)}
icon={<Icon as={Grid3x2GapFill} />}
/>
</Tooltip>
Expand All @@ -65,11 +64,11 @@ export const MainActionBar = () => {
</Center>
<Center height="100%">
<HStack justifyContent="flex-end">
<Tooltip label="Show power controls">
<Tooltip label="Show controls">
<IconButton
aria-label="Show power controls"
variant={showPowerControls ? 'outline' : 'solid'}
onClick={() => setShowPowerControls((current) => !current)}
aria-label="Show controls"
variant={showControls ? 'outline' : 'solid'}
onClick={() => setShowControls((current) => !current)}
icon={<Icon as={Grid3x2GapFill} />}
/>
</Tooltip>
Expand Down
Loading