Skip to content

Commit

Permalink
fix(UserDetailEditor): improve styling for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianAndersen committed Aug 11, 2024
1 parent 9b159c7 commit 13bbb4f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/user/user-detail-editor/FieldErrorAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function FieldErrorAlert({
key={error.type}
severity="error"
data-testid="error-message"
sx={{ mt: 1 }}
sx={{ my: 1 }}
>
{error.message}
</Alert>
Expand Down
15 changes: 13 additions & 2 deletions src/components/user/user-detail-editor/UserDetailEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,24 @@ const UserDetailEditor = ({
)}
</Grid>
{Object.values(errors).length > 0 && (
<Alert severity="error" sx={{ mt: 2 }}>
<Alert
severity="error"
sx={{
mt: 2,
backgroundColor: "transparent",
border: "3px solid #c30000",
}}
>
<AlertTitle>
Du må rette opp følgende før du kan gå videre:
</AlertTitle>
<List sx={{ listStyleType: "disc", pl: 2 }}>
{Object.values(errors).map((error) => (
<ListItem sx={{ display: "list-item" }} key={error.message}>
<ListItem
disablePadding
sx={{ display: "list-item", py: 0.2 }}
key={error.message}
>
{error.message}
</ListItem>
))}
Expand Down

0 comments on commit 13bbb4f

Please sign in to comment.