chore: lint

This commit is contained in:
amhsirak
2025-01-09 19:16:24 +05:30
parent 9a517fc68e
commit cc369c5332

View File

@@ -54,7 +54,7 @@ export const Pair: FC<PairProps> = (
}; };
const handleEdit = (pair: WhereWhatPair, newIndex: number) => { const handleEdit = (pair: WhereWhatPair, newIndex: number) => {
if (newIndex !== index){ if (newIndex !== index) {
AddPair((newIndex - 1), pair).then((updatedWorkflow) => { AddPair((newIndex - 1), pair).then((updatedWorkflow) => {
updateWorkflow(updatedWorkflow); updateWorkflow(updatedWorkflow);
}).catch((error) => { }).catch((error) => {
@@ -78,10 +78,10 @@ export const Pair: FC<PairProps> = (
return ( return (
<PairWrapper isActive={isActive}> <PairWrapper isActive={isActive}>
<Stack direction="row"> <Stack direction="row">
<div style={{display: 'flex', maxWidth:'20px', alignItems:'center', justifyContent: 'center', }}> <div style={{ display: 'flex', maxWidth: '20px', alignItems: 'center', justifyContent: 'center', }}>
{isActive ? <LoadingButton loading variant="text"/> {isActive ? <LoadingButton loading variant="text" />
: breakpoint ? <BreakpointButton changeColor={true} handleClick={handleBreakpointClick}/> : breakpoint ? <BreakpointButton changeColor={true} handleClick={handleBreakpointClick} />
: <BreakpointButton handleClick={handleBreakpointClick}/> : <BreakpointButton handleClick={handleBreakpointClick} />
} }
</div> </div>
<Badge badgeContent={pair.what.length} color="primary"> <Badge badgeContent={pair.what.length} color="primary">
@@ -123,13 +123,13 @@ export const Pair: FC<PairProps> = (
</Tooltip> </Tooltip>
<Tooltip title="Delete" placement='right' arrow> <Tooltip title="Delete" placement='right' arrow>
<div> <div>
<ClearButton handleClick={handleDelete}/> <ClearButton handleClick={handleDelete} />
</div> </div>
</Tooltip> </Tooltip>
</Stack> </Stack>
</Stack> </Stack>
<GenericModal isOpen={open} onClose={handleClose}> <GenericModal isOpen={open} onClose={handleClose}>
{ edit {edit
? ?
<PairEditForm <PairEditForm
onSubmitOfPair={handleEdit} onSubmitOfPair={handleEdit}
@@ -156,19 +156,19 @@ interface ViewButtonProps {
handleClick: () => void; handleClick: () => void;
} }
const ViewButton = ({handleClick}: ViewButtonProps) => { const ViewButton = ({ handleClick }: ViewButtonProps) => {
return ( return (
<IconButton aria-label="add" size={"small"} onClick={handleClick} <IconButton aria-label="add" size={"small"} onClick={handleClick}
sx={{color: 'inherit', '&:hover': { color: '#1976d2', backgroundColor: 'transparent' }}}> sx={{ color: 'inherit', '&:hover': { color: '#1976d2', backgroundColor: 'transparent' } }}>
<VisibilityIcon/> <VisibilityIcon />
</IconButton> </IconButton>
); );
} }
const PairWrapper = styled.div<{ isActive: boolean }>` const PairWrapper = styled.div<{ isActive: boolean }>`
background-color: ${({ isActive }) => isActive ? 'rgba(255, 0, 0, 0.1)' : 'transparent' }; background-color: ${({ isActive }) => isActive ? 'rgba(255, 0, 0, 0.1)' : 'transparent'};
border: ${({ isActive }) => isActive ? 'solid 2px red' : 'none' }; border: ${({ isActive }) => isActive ? 'solid 2px red' : 'none'};
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-grow: 1; flex-grow: 1;
@@ -176,6 +176,6 @@ const PairWrapper = styled.div<{ isActive: boolean }>`
color: gray; color: gray;
&:hover { &:hover {
color: dimgray; color: dimgray;
background: ${({ isActive }) => isActive ? 'rgba(255, 0, 0, 0.1)' : 'transparent' }; background: ${({ isActive }) => isActive ? 'rgba(255, 0, 0, 0.1)' : 'transparent'};
} }
`; `;