Skip to content

Commit

Permalink
feat(ui): Allow newlines in confirmation dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Jan 15, 2022
1 parent ea45f01 commit df2ee4f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions frontend/src/components/ConfirmationDialog.tsx
Expand Up @@ -28,22 +28,26 @@ const ConfirmationDialog: FunctionComponent<YesNoDialogProps> = ({
</DialogTitle>
<DialogContent>
{text && (
<DialogContentText>
{text}
<DialogContentText
style={{
whiteSpace: "pre-wrap"
}}
>
{text.split("<br/>").join("\n")}
</DialogContentText>
)}
{children}
</DialogContent>
<DialogActions>
<Button onClick={() => {
onClose();
}}>No</Button>
<Button onClick={() => {
onAccept();
onClose();
}} autoFocus>
Yes
</Button>
<Button onClick={() => {
onClose();
}}>No</Button>
</DialogActions>
</Dialog>
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/settings/Updater.tsx
Expand Up @@ -340,7 +340,7 @@ const DownloadUpdateControls: FunctionComponent = () => {
setDialogOpen(true);
}} sx={{mt: 1, mb: 1}}>Download Update</LoadingButton>
<ConfirmationDialog title="Download Update?"
text="Do you want to download the displayed Valetudo update? Please make sure to fully read the provided changelog as it may contain breaking changes as well as other relevant information."
text="Do you want to download the displayed Valetudo update?<br/>Please make sure to fully read the provided changelog as it may contain breaking changes as well as other relevant information."
open={dialogOpen} onClose={() => {
setDialogOpen(false);
}} onAccept={() => {
Expand Down

0 comments on commit df2ee4f

Please sign in to comment.