chore: lint
This commit is contained in:
@@ -54,19 +54,19 @@ 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) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
UpdatePair((index - 1), pair).then((updatedWorkflow) => {
|
UpdatePair((index - 1), pair).then((updatedWorkflow) => {
|
||||||
updateWorkflow(updatedWorkflow);
|
updateWorkflow(updatedWorkflow);
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
handleClose();
|
handleClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -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">
|
||||||
@@ -92,53 +92,53 @@ export const Pair: FC<PairProps> = (
|
|||||||
fontSize: '1rem',
|
fontSize: '1rem',
|
||||||
textTransform: 'none',
|
textTransform: 'none',
|
||||||
}} variant='text' key={`pair-${index}`}
|
}} variant='text' key={`pair-${index}`}
|
||||||
onClick={() => handleSelectPairForEdit(pair, index)}>
|
onClick={() => handleSelectPairForEdit(pair, index)}>
|
||||||
index: {index}
|
index: {index}
|
||||||
</Button>
|
</Button>
|
||||||
</Badge>
|
</Badge>
|
||||||
<Stack direction="row" spacing={0}
|
<Stack direction="row" spacing={0}
|
||||||
sx={{
|
sx={{
|
||||||
color: 'inherit',
|
|
||||||
"&:hover": {
|
|
||||||
color: 'inherit',
|
color: 'inherit',
|
||||||
}
|
"&:hover": {
|
||||||
}}>
|
color: 'inherit',
|
||||||
|
}
|
||||||
|
}}>
|
||||||
<Tooltip title="View" placement='right' arrow>
|
<Tooltip title="View" placement='right' arrow>
|
||||||
<div>
|
<div>
|
||||||
<ViewButton
|
<ViewButton
|
||||||
handleClick={handleOpen}
|
handleClick={handleOpen}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
||||||
<Tooltip title="Raw edit" placement='right' arrow>
|
<Tooltip title="Raw edit" placement='right' arrow>
|
||||||
<div>
|
<div>
|
||||||
<EditButton
|
<EditButton
|
||||||
handleClick={() => {
|
handleClick={() => {
|
||||||
enableEdit();
|
enableEdit();
|
||||||
handleOpen();
|
handleOpen();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</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}
|
||||||
numberOfPairs={numberOfPairs}
|
numberOfPairs={numberOfPairs}
|
||||||
index={index.toString()}
|
index={index.toString()}
|
||||||
where={pair.where ? JSON.stringify(pair.where) : undefined}
|
where={pair.where ? JSON.stringify(pair.where) : undefined}
|
||||||
what={pair.what ? JSON.stringify(pair.what) : undefined}
|
what={pair.what ? JSON.stringify(pair.what) : undefined}
|
||||||
id={pair.id}
|
id={pair.id}
|
||||||
/>
|
/>
|
||||||
:
|
:
|
||||||
<div>
|
<div>
|
||||||
<PairDisplayDiv
|
<PairDisplayDiv
|
||||||
@@ -149,26 +149,26 @@ export const Pair: FC<PairProps> = (
|
|||||||
}
|
}
|
||||||
</GenericModal>
|
</GenericModal>
|
||||||
</PairWrapper>
|
</PairWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface ViewButtonProps {
|
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'};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
Reference in New Issue
Block a user