Lint all files

This commit is contained in:
jeffvli 2023-07-01 19:10:05 -07:00
parent 22af76b4d6
commit 30e52ebb54
334 changed files with 76519 additions and 75932 deletions

View file

@ -6,33 +6,33 @@ import styled from 'styled-components';
const browser = isElectron() ? window.electron.browser : null;
interface WindowControlsProps {
style?: 'macos' | 'windows' | 'linux';
style?: 'macos' | 'windows' | 'linux';
}
const WindowsButtonGroup = styled.div`
display: flex;
width: 130px;
height: 100%;
-webkit-app-region: no-drag;
display: flex;
width: 130px;
height: 100%;
-webkit-app-region: no-drag;
`;
export const WindowsButton = styled.div<{ $exit?: boolean }>`
display: flex;
flex: 1;
align-items: center;
justify-content: center;
-webkit-app-region: no-drag;
width: 50px;
height: 65px;
display: flex;
flex: 1;
align-items: center;
justify-content: center;
-webkit-app-region: no-drag;
width: 50px;
height: 65px;
img {
width: 35%;
height: 50%;
}
img {
width: 35%;
height: 50%;
}
&:hover {
background: ${({ $exit }) => ($exit ? 'var(--danger-color)' : 'rgba(125, 125, 125, 30%)')};
}
&:hover {
background: ${({ $exit }) => ($exit ? 'var(--danger-color)' : 'rgba(125, 125, 125, 30%)')};
}
`;
const close = () => browser.exit();
@ -44,54 +44,54 @@ const maximize = () => browser.maximize();
const unmaximize = () => browser.unmaximize();
export const WindowControls = ({ style }: WindowControlsProps) => {
const [max, setMax] = useState(false);
const [max, setMax] = useState(false);
const handleMinimize = () => minimize();
const handleMinimize = () => minimize();
const handleMaximize = () => {
if (max) {
unmaximize();
} else {
maximize();
}
setMax(!max);
};
const handleMaximize = () => {
if (max) {
unmaximize();
} else {
maximize();
}
setMax(!max);
};
const handleClose = () => close();
const handleClose = () => close();
return (
<>
{isElectron() && (
return (
<>
{style === 'windows' && (
<WindowsButtonGroup>
<WindowsButton
role="button"
onClick={handleMinimize}
>
<RiSubtractLine size={19} />
</WindowsButton>
<WindowsButton
role="button"
onClick={handleMaximize}
>
<RiCheckboxBlankLine size={13} />
</WindowsButton>
<WindowsButton
$exit
role="button"
onClick={handleClose}
>
<RiCloseLine size={19} />
</WindowsButton>
</WindowsButtonGroup>
)}
{isElectron() && (
<>
{style === 'windows' && (
<WindowsButtonGroup>
<WindowsButton
role="button"
onClick={handleMinimize}
>
<RiSubtractLine size={19} />
</WindowsButton>
<WindowsButton
role="button"
onClick={handleMaximize}
>
<RiCheckboxBlankLine size={13} />
</WindowsButton>
<WindowsButton
$exit
role="button"
onClick={handleClose}
>
<RiCloseLine size={19} />
</WindowsButton>
</WindowsButtonGroup>
)}
</>
)}
</>
)}
</>
);
);
};
WindowControls.defaultProps = {
style: 'windows',
style: 'windows',
};