Skip to content

Commit

Permalink
✨(frontend) center error screen body
Browse files Browse the repository at this point in the history
Added a new props on Text primitive to allow centering
the text if needed. It's align the design with the mockup.
  • Loading branch information
lebaudantoine committed Aug 5, 2024
1 parent 01390b1 commit ca3b1f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/frontend/src/components/ErrorScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const ErrorScreen = ({ title, body }: {
<CenteredContent title={title || t('error.heading')} withBackButton>
{!!body && (
<Center>
<Text as="p" variant="h3">
<Text as="p" variant="h3" centered>
{body}
</Text>
</Center>
Expand Down
8 changes: 8 additions & 0 deletions src/frontend/src/primitives/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ export const text = cva({
},
inherits: {},
},
centered: {
true: {
textAlign: 'center',
},
false: {
textAlign: 'inherit',
},
},
bold: {
true: {
fontWeight: 'bold',
Expand Down

0 comments on commit ca3b1f0

Please sign in to comment.