From 011e4a30d9d93404d681da04148dcd9d16049a6f Mon Sep 17 00:00:00 2001 From: Anthony Geourjon <anthony.geourjon@tetras-libre.fr> Date: Fri, 2 Feb 2024 19:03:36 +0100 Subject: [PATCH] Improve edit list displaying --- .../AnnotationFormOverlay/Accordion.js | 17 ++++++++--------- .../AnnotationFormOverlayTool.js | 3 ++- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/annotationForm/AnnotationFormOverlay/Accordion.js b/src/annotationForm/AnnotationFormOverlay/Accordion.js index 7608abc..bb50239 100644 --- a/src/annotationForm/AnnotationFormOverlay/Accordion.js +++ b/src/annotationForm/AnnotationFormOverlay/Accordion.js @@ -5,21 +5,20 @@ import React from 'react'; import Typography from '@mui/material/Typography'; import PropTypes from 'prop-types'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; -import Button from "@mui/material/Button"; -import DeleteIcon from "@mui/icons-material/DeleteForever"; +import Button from '@mui/material/Button'; +import DeleteIcon from '@mui/icons-material/DeleteForever'; -function AccordionShapes({ shapes, deleteShape }) { +function AccordionShapes({ shapes, deleteShape, currentShapeId }) { return ( <Paper> {shapes.map((shape) => ( - <Accordion> + <Accordion style={shape.id === currentShapeId ? { fontWeight: 'bold' } : {}}> <AccordionSummary expandIcon={<ExpandMoreIcon />} aria-controls="panel1-content" id="panel1-header" > - - <Typography>{shape.id}</Typography> + {shape.id} </AccordionSummary> <AccordionDetails> <ul> @@ -32,9 +31,9 @@ function AccordionShapes({ shapes, deleteShape }) { ))} </ul> <Button - onClick={() => deleteShape(shape.id)} + onClick={() => deleteShape(shape.id)} > - <DeleteIcon /> + <DeleteIcon /> </Button> </AccordionDetails> </Accordion> @@ -46,7 +45,7 @@ function AccordionShapes({ shapes, deleteShape }) { AccordionShapes.propTypes = { shapes: PropTypes.array.isRequired, - deleteShape: PropTypes.func.isRequired, + deleteShape: PropTypes.func.isRequired, }; export default AccordionShapes; diff --git a/src/annotationForm/AnnotationFormOverlay/AnnotationFormOverlayTool.js b/src/annotationForm/AnnotationFormOverlay/AnnotationFormOverlayTool.js index 942a202..7a30878 100644 --- a/src/annotationForm/AnnotationFormOverlay/AnnotationFormOverlayTool.js +++ b/src/annotationForm/AnnotationFormOverlay/AnnotationFormOverlayTool.js @@ -61,7 +61,7 @@ function AnnotationFormOverlayTool({ currentShape && ( <Paper> <Typography variant="overline"> - Forme selectionné + Forme selectionnée </Typography> <ul> @@ -77,6 +77,7 @@ function AnnotationFormOverlayTool({ ) } <AccordionShapes + currentShapeId={currentShape?.id} shapes={shapes} deleteShape={deleteShape} /> -- GitLab