From cc369c5332cbabdbfab40e37c2fc8ea3fcfa329d Mon Sep 17 00:00:00 2001 From: amhsirak Date: Thu, 9 Jan 2025 19:16:24 +0530 Subject: [PATCH] chore: lint --- src/components/molecules/Pair.tsx | 104 +++++++++++++++--------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/src/components/molecules/Pair.tsx b/src/components/molecules/Pair.tsx index 3c332600..23e1cc7d 100644 --- a/src/components/molecules/Pair.tsx +++ b/src/components/molecules/Pair.tsx @@ -54,19 +54,19 @@ export const Pair: FC = ( }; const handleEdit = (pair: WhereWhatPair, newIndex: number) => { - if (newIndex !== index){ - AddPair((newIndex - 1), pair).then((updatedWorkflow) => { - updateWorkflow(updatedWorkflow); - }).catch((error) => { - console.error(error); - }); - } else { - UpdatePair((index - 1), pair).then((updatedWorkflow) => { - updateWorkflow(updatedWorkflow); - }).catch((error) => { - console.error(error); - }); - } + if (newIndex !== index) { + AddPair((newIndex - 1), pair).then((updatedWorkflow) => { + updateWorkflow(updatedWorkflow); + }).catch((error) => { + console.error(error); + }); + } else { + UpdatePair((index - 1), pair).then((updatedWorkflow) => { + updateWorkflow(updatedWorkflow); + }).catch((error) => { + console.error(error); + }); + } handleClose(); }; @@ -78,10 +78,10 @@ export const Pair: FC = ( return ( -
- {isActive ? - : breakpoint ? - : +
+ {isActive ? + : breakpoint ? + : }
@@ -92,53 +92,53 @@ export const Pair: FC = ( fontSize: '1rem', textTransform: 'none', }} variant='text' key={`pair-${index}`} - onClick={() => handleSelectPairForEdit(pair, index)}> + onClick={() => handleSelectPairForEdit(pair, index)}> index: {index} + "&:hover": { + color: 'inherit', + } + }}> -
- -
+
+ +
- { - enableEdit(); - handleOpen(); - }} - /> + { + enableEdit(); + handleOpen(); + }} + />
-
+
- +
- { edit + {edit ? - + :
= ( } - ); + ); }; interface ViewButtonProps { handleClick: () => void; } -const ViewButton = ({handleClick}: ViewButtonProps) => { +const ViewButton = ({ handleClick }: ViewButtonProps) => { return ( - + sx={{ color: 'inherit', '&:hover': { color: '#1976d2', backgroundColor: 'transparent' } }}> + ); } const PairWrapper = styled.div<{ isActive: boolean }>` - background-color: ${({ isActive }) => isActive ? 'rgba(255, 0, 0, 0.1)' : 'transparent' }; - border: ${({ isActive }) => isActive ? 'solid 2px red' : 'none' }; + background-color: ${({ isActive }) => isActive ? 'rgba(255, 0, 0, 0.1)' : 'transparent'}; + border: ${({ isActive }) => isActive ? 'solid 2px red' : 'none'}; display: flex; flex-direction: row; flex-grow: 1; @@ -176,6 +176,6 @@ const PairWrapper = styled.div<{ isActive: boolean }>` color: gray; &:hover { color: dimgray; - background: ${({ isActive }) => isActive ? 'rgba(255, 0, 0, 0.1)' : 'transparent' }; + background: ${({ isActive }) => isActive ? 'rgba(255, 0, 0, 0.1)' : 'transparent'}; } `;