Fix transient props for styled-components v6

This commit is contained in:
jeffvli 2023-09-22 02:34:57 -07:00
parent bb9bf7ba6a
commit 1a87adb728
24 changed files with 96 additions and 92 deletions

View file

@ -10,7 +10,7 @@ const SliderContainer = styled.div`
margin: 10px 0; margin: 10px 0;
`; `;
const SliderValueWrapper = styled.div<{ position: 'left' | 'right' }>` const SliderValueWrapper = styled.div<{ $position: 'left' | 'right' }>`
display: flex; display: flex;
flex: 1; flex: 1;
align-self: flex-end; align-self: flex-end;
@ -38,7 +38,7 @@ export const WrapperSlider = ({ leftLabel, rightLabel, value, ...props }: Wrappe
return ( return (
<SliderContainer> <SliderContainer>
{leftLabel && <SliderValueWrapper position="left">{leftLabel}</SliderValueWrapper>} {leftLabel && <SliderValueWrapper $position="left">{leftLabel}</SliderValueWrapper>}
<SliderWrapper> <SliderWrapper>
<PlayerbarSlider <PlayerbarSlider
{...props} {...props}
@ -56,7 +56,7 @@ export const WrapperSlider = ({ leftLabel, rightLabel, value, ...props }: Wrappe
}} }}
/> />
</SliderWrapper> </SliderWrapper>
{rightLabel && <SliderValueWrapper position="right">{rightLabel}</SliderValueWrapper>} {rightLabel && <SliderValueWrapper $position="right">{rightLabel}</SliderValueWrapper>}
</SliderContainer> </SliderContainer>
); );
}; };

View file

@ -7,13 +7,13 @@ import { useWindowSettings } from '/@/renderer/store/settings.store';
import { Platform } from '/@/renderer/types'; import { Platform } from '/@/renderer/types';
const Container = styled(motion(Flex))<{ const Container = styled(motion(Flex))<{
height?: string; $height?: string;
position?: string; $position?: string;
}>` }>`
position: ${(props) => props.position || 'relative'}; position: ${(props) => props.$position || 'relative'};
z-index: 200; z-index: 200;
width: 100%; width: 100%;
height: ${(props) => props.height || '65px'}; height: ${(props) => props.$height || '65px'};
background: var(--titlebar-bg); background: var(--titlebar-bg);
`; `;
@ -40,13 +40,13 @@ const Header = styled(motion.div)<{
} }
`; `;
const BackgroundImage = styled.div<{ background: string }>` const BackgroundImage = styled.div<{ $background: string }>`
position: absolute; position: absolute;
top: 0; top: 0;
z-index: 1; z-index: 1;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: ${(props) => props.background || 'var(--titlebar-bg)'}; background: ${(props) => props.$background || 'var(--titlebar-bg)'};
`; `;
const BackgroundImageOverlay = styled.div<{ theme: 'light' | 'dark' }>` const BackgroundImageOverlay = styled.div<{ theme: 'light' | 'dark' }>`
@ -129,8 +129,8 @@ export const PageHeader = ({
{!isHidden && ( {!isHidden && (
<Container <Container
ref={ref} ref={ref}
height={height} $height={height}
position={position} $position={position}
{...props} {...props}
> >
<Header <Header
@ -151,7 +151,9 @@ export const PageHeader = ({
</Header> </Header>
{backgroundColor && ( {backgroundColor && (
<> <>
<BackgroundImage background={backgroundColor || 'var(--titlebar-bg)'} /> <BackgroundImage
$background={backgroundColor || 'var(--titlebar-bg)'}
/>
<BackgroundImageOverlay theme={theme as 'light' | 'dark'} /> <BackgroundImageOverlay theme={theme as 'light' | 'dark'} />
</> </>
)} )}

View file

@ -29,7 +29,10 @@ const StyledScrollArea = styled(MantineScrollArea)`
} }
`; `;
const StyledNativeScrollArea = styled.div<{ scrollBarOffset?: string; windowBarStyle?: Platform }>` const StyledNativeScrollArea = styled.div<{
$scrollBarOffset?: string;
$windowBarStyle?: Platform;
}>`
height: 100%; height: 100%;
`; `;
@ -133,8 +136,8 @@ export const NativeScrollArea = forwardRef(
/> />
<StyledNativeScrollArea <StyledNativeScrollArea
ref={mergedRef} ref={mergedRef}
scrollBarOffset={scrollBarOffset} $scrollBarOffset={scrollBarOffset}
windowBarStyle={windowBarStyle} $windowBarStyle={windowBarStyle}
{...props} {...props}
> >
{children} {children}

View file

@ -5,7 +5,7 @@ import { CellContainer } from '/@/renderer/components/virtual-table/cells/generi
export const ActionsCell = ({ context, api }: ICellRendererParams) => { export const ActionsCell = ({ context, api }: ICellRendererParams) => {
return ( return (
<CellContainer position="center"> <CellContainer $position="center">
<Button <Button
compact compact
variant="subtle" variant="subtle"

View file

@ -11,7 +11,7 @@ import { Skeleton } from '/@/renderer/components/skeleton';
export const AlbumArtistCell = ({ value, data }: ICellRendererParams) => { export const AlbumArtistCell = ({ value, data }: ICellRendererParams) => {
if (value === undefined) { if (value === undefined) {
return ( return (
<CellContainer position="left"> <CellContainer $position="left">
<Skeleton <Skeleton
height="1rem" height="1rem"
width="80%" width="80%"
@ -21,7 +21,7 @@ export const AlbumArtistCell = ({ value, data }: ICellRendererParams) => {
} }
return ( return (
<CellContainer position="left"> <CellContainer $position="left">
<Text <Text
$secondary $secondary
overflow="hidden" overflow="hidden"

View file

@ -11,7 +11,7 @@ import { Skeleton } from '/@/renderer/components/skeleton';
export const ArtistCell = ({ value, data }: ICellRendererParams) => { export const ArtistCell = ({ value, data }: ICellRendererParams) => {
if (value === undefined) { if (value === undefined) {
return ( return (
<CellContainer position="left"> <CellContainer $position="left">
<Skeleton <Skeleton
height="1rem" height="1rem"
width="80%" width="80%"
@ -21,7 +21,7 @@ export const ArtistCell = ({ value, data }: ICellRendererParams) => {
} }
return ( return (
<CellContainer position="left"> <CellContainer $position="left">
<Text <Text
$secondary $secondary
overflow="hidden" overflow="hidden"

View file

@ -46,7 +46,7 @@ export const FavoriteCell = ({ value, data, node }: ICellRendererParams) => {
}; };
return ( return (
<CellContainer position="center"> <CellContainer $position="center">
<Button <Button
compact compact
sx={{ sx={{

View file

@ -4,13 +4,13 @@ import styled from 'styled-components';
import { Skeleton } from '/@/renderer/components/skeleton'; import { Skeleton } from '/@/renderer/components/skeleton';
import { Text } from '/@/renderer/components/text'; import { Text } from '/@/renderer/components/text';
export const CellContainer = styled.div<{ position?: 'left' | 'center' | 'right' }>` export const CellContainer = styled.div<{ $position?: 'left' | 'center' | 'right' }>`
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: ${(props) => justify-content: ${(props) =>
props.position === 'right' props.$position === 'right'
? 'flex-end' ? 'flex-end'
: props.position === 'center' : props.$position === 'center'
? 'center' ? 'center'
: 'flex-start'}; : 'flex-start'};
width: 100%; width: 100%;
@ -34,7 +34,7 @@ export const GenericCell = (
if (value === undefined) { if (value === undefined) {
return ( return (
<CellContainer position={position || 'left'}> <CellContainer $position={position || 'left'}>
<Skeleton <Skeleton
height="1rem" height="1rem"
width="80%" width="80%"
@ -44,7 +44,7 @@ export const GenericCell = (
} }
return ( return (
<CellContainer position={position || 'left'}> <CellContainer $position={position || 'left'}>
{isLink ? ( {isLink ? (
<Text <Text
$link={isLink} $link={isLink}
@ -58,6 +58,7 @@ export const GenericCell = (
</Text> </Text>
) : ( ) : (
<Text <Text
$noSelect={false}
$secondary={!primary} $secondary={!primary}
overflow="hidden" overflow="hidden"
size="md" size="md"

View file

@ -8,7 +8,7 @@ import { AppRoute } from '/@/renderer/router/routes';
export const GenreCell = ({ value, data }: ICellRendererParams) => { export const GenreCell = ({ value, data }: ICellRendererParams) => {
return ( return (
<CellContainer position="left"> <CellContainer $position="left">
<Text <Text
$secondary $secondary
overflow="hidden" overflow="hidden"

View file

@ -47,7 +47,7 @@ export const RatingCell = ({ value, node }: ICellRendererParams) => {
}; };
return ( return (
<CellContainer position="center"> <CellContainer $position="center">
<Rating <Rating
size="xs" size="xs"
value={value?.userRating} value={value?.userRating}

View file

@ -6,7 +6,7 @@ import { CellContainer } from '/@/renderer/components/virtual-table/cells/generi
export const TitleCell = ({ value }: ICellRendererParams) => { export const TitleCell = ({ value }: ICellRendererParams) => {
if (value === undefined) { if (value === undefined) {
return ( return (
<CellContainer position="left"> <CellContainer $position="left">
<Skeleton <Skeleton
height="1rem" height="1rem"
width="80%" width="80%"
@ -16,7 +16,7 @@ export const TitleCell = ({ value }: ICellRendererParams) => {
} }
return ( return (
<CellContainer position="left"> <CellContainer $position="left">
<Text <Text
className="current-song-child" className="current-song-child"
overflow="hidden" overflow="hidden"

View file

@ -14,12 +14,12 @@ type Options = {
preset?: Presets; preset?: Presets;
}; };
export const HeaderWrapper = styled.div<{ position: Options['position'] }>` export const HeaderWrapper = styled.div<{ $position: Options['position'] }>`
display: flex; display: flex;
justify-content: ${(props) => justify-content: ${(props) =>
props.position === 'right' props.$position === 'right'
? 'flex-end' ? 'flex-end'
: props.position === 'center' : props.$position === 'center'
? 'center' ? 'center'
: 'flex-start'}; : 'flex-start'};
width: 100%; width: 100%;
@ -27,16 +27,16 @@ export const HeaderWrapper = styled.div<{ position: Options['position'] }>`
text-transform: uppercase; text-transform: uppercase;
`; `;
const HeaderText = styled(_Text)<{ position: Options['position'] }>` const HeaderText = styled(_Text)<{ $position: Options['position'] }>`
width: 100%; width: 100%;
height: 100%; height: 100%;
font-weight: 500; font-weight: 500;
line-height: inherit; line-height: inherit;
color: var(--ag-header-foreground-color); color: var(--ag-header-foreground-color);
text-align: ${(props) => text-align: ${(props) =>
props.position === 'right' props.$position === 'right'
? 'flex-end' ? 'flex-end'
: props.position === 'center' : props.$position === 'center'
? 'center' ? 'center'
: 'flex-start'}; : 'flex-start'};
text-transform: uppercase; text-transform: uppercase;
@ -80,14 +80,14 @@ export const GenericTableHeader = (
{ preset, children, position }: Options, { preset, children, position }: Options,
) => { ) => {
if (preset) { if (preset) {
return <HeaderWrapper position={position}>{headerPresets[preset]}</HeaderWrapper>; return <HeaderWrapper $position={position}>{headerPresets[preset]}</HeaderWrapper>;
} }
return ( return (
<HeaderWrapper position={position}> <HeaderWrapper $position={position}>
<HeaderText <HeaderText
$position={position}
overflow="hidden" overflow="hidden"
position={position}
weight={500} weight={500}
> >
{children || displayName} {children || displayName}

View file

@ -66,8 +66,6 @@ export const AlbumDetailContent = ({ tableRef, background }: AlbumDetailContentP
const handlePlayQueueAdd = usePlayQueueAdd(); const handlePlayQueueAdd = usePlayQueueAdd();
const tableConfig = useTableSettings('albumDetail'); const tableConfig = useTableSettings('albumDetail');
console.log('tableConfig :>> ', tableConfig);
const columnDefs = useMemo(() => getColumnDefs(tableConfig.columns), [tableConfig.columns]); const columnDefs = useMemo(() => getColumnDefs(tableConfig.columns), [tableConfig.columns]);
const getRowHeight = useCallback((params: RowHeightParams) => { const getRowHeight = useCallback((params: RowHeightParams) => {
@ -266,7 +264,7 @@ export const AlbumDetailContent = ({ tableRef, background }: AlbumDetailContentP
return ( return (
<ContentContainer> <ContentContainer>
<LibraryBackgroundOverlay backgroundColor={background} /> <LibraryBackgroundOverlay $backgroundColor={background} />
<DetailContainer> <DetailContainer>
<Box component="section"> <Box component="section">
<Group <Group

View file

@ -333,7 +333,7 @@ export const AlbumArtistDetailContent = ({ background }: AlbumArtistDetailConten
return ( return (
<ContentContainer ref={cq.ref}> <ContentContainer ref={cq.ref}>
<LibraryBackgroundOverlay backgroundColor={background} /> <LibraryBackgroundOverlay $backgroundColor={background} />
<DetailContainer> <DetailContainer>
<Stack spacing="lg"> <Stack spacing="lg">
<Group spacing="md"> <Group spacing="md">

View file

@ -55,7 +55,7 @@ const SliderContainer = styled.div`
height: 20px; height: 20px;
`; `;
const SliderValueWrapper = styled.div<{ position: 'left' | 'right' }>` const SliderValueWrapper = styled.div<{ $position: 'left' | 'right' }>`
display: flex; display: flex;
flex: 1; flex: 1;
align-self: center; align-self: center;
@ -281,7 +281,7 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => {
</ButtonsContainer> </ButtonsContainer>
</ControlsContainer> </ControlsContainer>
<SliderContainer> <SliderContainer>
<SliderValueWrapper position="left"> <SliderValueWrapper $position="left">
<Text <Text
$noSelect $noSelect
$secondary $secondary
@ -309,7 +309,7 @@ export const CenterControls = ({ playersRef }: CenterControlsProps) => {
}} }}
/> />
</SliderWrapper> </SliderWrapper>
<SliderValueWrapper position="right"> <SliderValueWrapper $position="right">
<Text <Text
$noSelect $noSelect
$secondary $secondary

View file

@ -1,6 +1,6 @@
import styled from 'styled-components'; import styled from 'styled-components';
export const LibraryBackgroundOverlay = styled.div<{ backgroundColor?: string }>` export const LibraryBackgroundOverlay = styled.div<{ $backgroundColor?: string }>`
position: absolute; position: absolute;
z-index: -1; z-index: -1;
width: 100%; width: 100%;
@ -8,7 +8,7 @@ export const LibraryBackgroundOverlay = styled.div<{ backgroundColor?: string }>
min-height: 200px; min-height: 200px;
pointer-events: none; pointer-events: none;
user-select: none; user-select: none;
background: ${(props) => props.backgroundColor}; background: ${(props) => props.$backgroundColor};
background-image: var(--bg-subheader-overlay); background-image: var(--bg-subheader-overlay);
opacity: 0.3; opacity: 0.3;
`; `;

View file

@ -1,19 +1,19 @@
import styled from 'styled-components'; import styled from 'styled-components';
export const ResizeHandle = styled.div<{ export const ResizeHandle = styled.div<{
isResizing: boolean; $isResizing: boolean;
placement: 'top' | 'left' | 'bottom' | 'right'; $placement: 'top' | 'left' | 'bottom' | 'right';
}>` }>`
position: absolute; position: absolute;
top: ${(props) => props.placement === 'top' && 0}; top: ${(props) => props.$placement === 'top' && 0};
right: ${(props) => props.placement === 'right' && 0}; right: ${(props) => props.$placement === 'right' && 0};
bottom: ${(props) => props.placement === 'bottom' && 0}; bottom: ${(props) => props.$placement === 'bottom' && 0};
left: ${(props) => props.placement === 'left' && 0}; left: ${(props) => props.$placement === 'left' && 0};
z-index: 90; z-index: 90;
width: 4px; width: 4px;
height: 100%; height: 100%;
cursor: ew-resize; cursor: ew-resize;
opacity: ${(props) => (props.isResizing ? 1 : 0)}; opacity: ${(props) => (props.$isResizing ? 1 : 0)};
&:hover { &:hover {
opacity: 0.7; opacity: 0.7;
@ -21,10 +21,10 @@ export const ResizeHandle = styled.div<{
&::before { &::before {
position: absolute; position: absolute;
top: ${(props) => props.placement === 'top' && 0}; top: ${(props) => props.$placement === 'top' && 0};
right: ${(props) => props.placement === 'right' && 0}; right: ${(props) => props.$placement === 'right' && 0};
bottom: ${(props) => props.placement === 'bottom' && 0}; bottom: ${(props) => props.$placement === 'bottom' && 0};
left: ${(props) => props.placement === 'left' && 0}; left: ${(props) => props.$placement === 'left' && 0};
width: 1px; width: 1px;
height: 100%; height: 100%;
content: ''; content: '';

View file

@ -35,12 +35,12 @@ import { AppRoute } from '/@/renderer/router/routes';
import { SidebarItemType, useGeneralSettings, useWindowSettings } from '/@/renderer/store'; import { SidebarItemType, useGeneralSettings, useWindowSettings } from '/@/renderer/store';
import { Platform } from '/@/renderer/types'; import { Platform } from '/@/renderer/types';
const SidebarContainer = styled(motion.div)<{ windowBarStyle: Platform }>` const SidebarContainer = styled(motion.div)<{ $windowBarStyle: Platform }>`
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
max-height: ${(props) => max-height: ${(props) =>
props.windowBarStyle === Platform.WEB || props.windowBarStyle === Platform.LINUX props.$windowBarStyle === Platform.WEB || props.$windowBarStyle === Platform.LINUX
? 'calc(100vh - 149px)' ? 'calc(100vh - 149px)'
: 'calc(100vh - 119px)'}; : 'calc(100vh - 119px)'};
user-select: none; user-select: none;
@ -110,7 +110,7 @@ export const CollapsedSidebar = () => {
}, [sidebarItems]); }, [sidebarItems]);
return ( return (
<SidebarContainer windowBarStyle={windowBarStyle}> <SidebarContainer $windowBarStyle={windowBarStyle}>
<ScrollArea <ScrollArea
scrollHideDelay={0} scrollHideDelay={0}
scrollbarSize={8} scrollbarSize={8}

View file

@ -55,11 +55,11 @@ import {
import { fadeIn } from '/@/renderer/styles'; import { fadeIn } from '/@/renderer/styles';
import { Platform } from '/@/renderer/types'; import { Platform } from '/@/renderer/types';
const SidebarContainer = styled.div<{ windowBarStyle: Platform }>` const SidebarContainer = styled.div<{ $windowBarStyle: Platform }>`
height: 100%; height: 100%;
max-height: ${ max-height: ${
(props) => (props) =>
props.windowBarStyle === Platform.WEB || props.windowBarStyle === Platform.LINUX props.$windowBarStyle === Platform.WEB || props.$windowBarStyle === Platform.LINUX
? 'calc(100vh - 160px)' // Playerbar (90px) & ActionBar (70px) ? 'calc(100vh - 160px)' // Playerbar (90px) & ActionBar (70px)
: 'calc(100vh - 190px)' // plus windowbar (30px) if the windowBarStyle is Windows/Mac : 'calc(100vh - 190px)' // plus windowbar (30px) if the windowBarStyle is Windows/Mac
// We use the height of the SidebarContainer to keep the Stack below the ActionBar at the correct height // We use the height of the SidebarContainer to keep the Stack below the ActionBar at the correct height
@ -199,7 +199,7 @@ export const Sidebar = () => {
return ( return (
<SidebarContainer <SidebarContainer
ref={cq.ref} ref={cq.ref}
windowBarStyle={windowBarStyle} $windowBarStyle={windowBarStyle}
> >
<ActionBar /> <ActionBar />
<Stack <Stack

View file

@ -24,14 +24,14 @@ if (!isElectron()) {
}); });
} }
const Layout = styled.div<{ windowBarStyle: Platform }>` const Layout = styled.div<{ $windowBarStyle: Platform }>`
display: grid; display: grid;
grid-template-areas: grid-template-areas:
'window-bar' 'window-bar'
'main-content' 'main-content'
'player'; 'player';
grid-template-rows: ${(props) => grid-template-rows: ${(props) =>
props.windowBarStyle === Platform.WINDOWS || props.windowBarStyle === Platform.MACOS props.$windowBarStyle === Platform.WINDOWS || props.$windowBarStyle === Platform.MACOS
? '30px calc(100vh - 120px) 90px' ? '30px calc(100vh - 120px) 90px'
: '0px calc(100vh - 90px) 90px'}; : '0px calc(100vh - 90px) 90px'};
grid-template-columns: 1fr; grid-template-columns: 1fr;
@ -84,8 +84,8 @@ export const DefaultLayout = ({ shell }: DefaultLayoutProps) => {
return ( return (
<> <>
<Layout <Layout
$windowBarStyle={windowBarStyle}
id="default-layout" id="default-layout"
windowBarStyle={windowBarStyle}
> >
{windowBarStyle !== Platform.WEB && <WindowBar />} {windowBarStyle !== Platform.WEB && <WindowBar />}
<MainContent shell={shell} /> <MainContent shell={shell} />

View file

@ -25,8 +25,8 @@ export const LeftSidebar = ({ isResizing, startResizing }: LeftSidebarProps) =>
<SidebarContainer id="sidebar"> <SidebarContainer id="sidebar">
<ResizeHandle <ResizeHandle
ref={sidebarRef} ref={sidebarRef}
isResizing={isResizing} $isResizing={isResizing}
placement="right" $placement="right"
onMouseDown={(e) => { onMouseDown={(e) => {
e.preventDefault(); e.preventDefault();
startResizing('left'); startResizing('left');

View file

@ -20,20 +20,20 @@ const SideDrawerQueue = lazy(() =>
const MINIMUM_SIDEBAR_WIDTH = 260; const MINIMUM_SIDEBAR_WIDTH = 260;
const MainContentContainer = styled.div<{ const MainContentContainer = styled.div<{
leftSidebarWidth: string; $leftSidebarWidth: string;
rightExpanded?: boolean; $rightExpanded?: boolean;
rightSidebarWidth?: string; $rightSidebarWidth?: string;
shell?: boolean; $shell?: boolean;
sidebarCollapsed?: boolean; $sidebarCollapsed?: boolean;
}>` }>`
position: relative; position: relative;
display: ${(props) => (props.shell ? 'flex' : 'grid')}; display: ${(props) => (props.$shell ? 'flex' : 'grid')};
grid-area: main-content; grid-area: main-content;
grid-template-areas: 'sidebar . right-sidebar'; grid-template-areas: 'sidebar . right-sidebar';
grid-template-rows: 1fr; grid-template-rows: 1fr;
grid-template-columns: ${(props) => (props.sidebarCollapsed ? '80px' : props.leftSidebarWidth)} 1fr ${( grid-template-columns: ${(props) =>
props, props.$sidebarCollapsed ? '80px' : props.$leftSidebarWidth} 1fr ${(props) =>
) => props.rightExpanded && props.rightSidebarWidth}; props.$rightExpanded && props.$rightSidebarWidth};
gap: 0; gap: 0;
background: var(--main-bg); background: var(--main-bg);
@ -96,12 +96,12 @@ export const MainContent = ({ shell }: { shell?: boolean }) => {
return ( return (
<MainContentContainer <MainContentContainer
$leftSidebarWidth={leftWidth}
$rightExpanded={showSideQueue && sideQueueType === 'sideQueue'}
$rightSidebarWidth={rightWidth}
$shell={shell}
$sidebarCollapsed={collapsed}
id="main-content" id="main-content"
leftSidebarWidth={leftWidth}
rightExpanded={showSideQueue && sideQueueType === 'sideQueue'}
rightSidebarWidth={rightWidth}
shell={shell}
sidebarCollapsed={collapsed}
> >
{!shell && ( {!shell && (
<> <>

View file

@ -115,8 +115,8 @@ export const RightSidebar = forwardRef(
> >
<ResizeHandle <ResizeHandle
ref={ref} ref={ref}
isResizing={isResizingRight} $isResizing={isResizingRight}
placement="left" $placement="left"
onMouseDown={(e) => { onMouseDown={(e) => {
e.preventDefault(); e.preventDefault();
startResizing('right'); startResizing('right');

View file

@ -135,13 +135,13 @@ const MacOsButtonGroup = styled.div`
`; `;
export const MacOsButton = styled.div<{ export const MacOsButton = styled.div<{
maxButton?: boolean; $maxButton?: boolean;
minButton?: boolean; $minButton?: boolean;
restoreButton?: boolean; $restoreButton?: boolean;
}>` }>`
grid-row: 1 / span 1; grid-row: 1 / span 1;
grid-column: ${(props) => grid-column: ${(props) =>
props.minButton ? 2 : props.maxButton || props.restoreButton ? 3 : 1}; props.$minButton ? 2 : props.$maxButton || props.$restoreButton ? 3 : 1};
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
@ -165,7 +165,7 @@ const MacOsControls = ({ controls, title }: WindowBarControlsProps) => {
<MacOsContainer> <MacOsContainer>
<MacOsButtonGroup> <MacOsButtonGroup>
<MacOsButton <MacOsButton
minButton $minButton
className="button" className="button"
id="min-button" id="min-button"
onClick={handleMinimize} onClick={handleMinimize}
@ -180,7 +180,7 @@ const MacOsControls = ({ controls, title }: WindowBarControlsProps) => {
/> />
</MacOsButton> </MacOsButton>
<MacOsButton <MacOsButton
maxButton $maxButton
className="button" className="button"
id="max-button" id="max-button"
onClick={handleMaximize} onClick={handleMaximize}