Skip to content

Commit

Permalink
fix: modif modele
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgfr committed Aug 23, 2023
1 parent 5670f53 commit 48c0a30
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions targets/frontend/src/components/documents/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const DocumentRow = function DocumentRow({
document: { cdtnId, source, title, isPublished, isAvailable },
}) {
const [selectedItems, setSelectedItems] = useSelectionContext();
const updatePublishedRef = (cdtnId) => {
const updatePublishedRef = () => {
// eslint-disable-next-line no-prototype-builtins
if (selectedItems.hasOwnProperty(cdtnId)) {
delete selectedItems[cdtnId];
Expand All @@ -63,17 +63,18 @@ const DocumentRow = function DocumentRow({
<TableCell>
<div class="fr-checkbox-group">
<input
onChange={() => updatePublishedRef(cdtnId)}
name={cdtnId}
onChange={updatePublishedRef}
checked={
selectedItems.hasOwnProperty(cdtnId) ? !isPublished : isPublished
}
sx={checkboxStyles}
type="checkbox"
aria-describedby="checkbox-messages"
id={`row-${cdtnId}`}
/>
<label class="fr-label" for="checkbox" />
<label className="fr-label" htmlFor={`row-${cdtnId}`} />
<div
class="fr-messages-group"
className="fr-messages-group"
id="checkbox-messages"
aria-live="polite"
></div>
Expand Down Expand Up @@ -144,10 +145,3 @@ export const sourceToRoute = ({ cdtnId, source }) => {
return `/contenus/${cdtnId}`;
}
};

const checkboxStyles = {
cursor: "pointer",
display: "block",
m: "0 0 0 small",
padding: 0,
};

0 comments on commit 48c0a30

Please sign in to comment.