Skip to content

Commit 805955b

Browse files
💄 - style: alter the styling of the future archive date validation
1 parent 075c1cf commit 805955b

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

frontend/src/pages/destructionlist/detail/DestructionListDetail.tsx

+28-29
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
Button,
55
CardBaseTemplate,
66
Column,
7+
ErrorMessage,
78
Form,
89
FormField,
910
Grid,
@@ -172,35 +173,33 @@ export function DestructionListDetailPage() {
172173
/>
173174
),
174175
"spacer",
175-
<>
176-
{["new", "failed"].includes(destructionList.processingStatus) ? (
177-
<Grid gutter={false}>
178-
<Column containerType="normal" span={12}>
179-
<Button
180-
variant="danger"
181-
onClick={() => setDestroyModalOpenState(true)}
182-
disabled={hasDestructionListItemsDateInFuture()}
183-
pad="h"
184-
bold={true}
185-
>
186-
<Solid.TrashIcon />
187-
{destructionList.processingStatus === "new"
188-
? "Vernietigen starten"
189-
: "Vernietigen herstarten"}
190-
</Button>
191-
</Column>
192-
<Column containerType="normal" span={12}>
193-
{hasDestructionListItemsDateInFuture() && (
194-
<P bold>
195-
Er zijn zaken met een archiefactiedatum in de toekomst
196-
</P>
197-
)}
198-
</Column>
199-
</Grid>
200-
) : (
201-
<></>
202-
)}
203-
</>,
176+
177+
hasDestructionListItemsDateInFuture() ? (
178+
<ErrorMessage>
179+
Eén of meer zaken hebben een toekomstige archiefdatum.
180+
</ErrorMessage>
181+
) : (
182+
<></>
183+
),
184+
["new", "failed"].includes(destructionList.processingStatus) ? (
185+
{
186+
bold: true,
187+
children: (
188+
<>
189+
<Solid.TrashIcon />
190+
{destructionList.processingStatus === "new"
191+
? "Vernietigen starten"
192+
: "Vernietigen herstarten"}
193+
</>
194+
),
195+
disabled: hasDestructionListItemsDateInFuture(),
196+
pad: "h",
197+
variant: "danger",
198+
onClick: () => setDestroyModalOpenState(true),
199+
}
200+
) : (
201+
<></>
202+
),
204203
];
205204
}
206205
};

0 commit comments

Comments
 (0)