Skip to content

Commit

Permalink
#1512, use errorbox
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesUoM committed Dec 18, 2024
1 parent 95cdcb2 commit cda6ffc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"saveArea-tooltip": "Save Area",
"confirm-success": "Okay",
"cancel-save": "Don't save",
"invalid-headline-text": "Invalid Edits",
"invalid-text": "The segments do not create a valid video. Either change or discard your edits if you wish to proceed. Contact an adminstrator for further help."
},

Expand Down
13 changes: 9 additions & 4 deletions src/main/Save.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ const Save: React.FC = () => {
} else {
return (
<>
<span css={{ maxWidth: "500px" }}>
{validSegments ? t("save.info-text") : t("save.invalid-text")}
</span>
{validSegments ? <span>
{t("save.info-text")}
</span> : <ErrorBox>
<span css={{ whiteSpace: "pre-line" }}>
{t("save.invalid-text")}
</span>
</ErrorBox>
}
<div css={backOrContinueStyle}>
<PageButton pageNumber={0} label={t("various.goBack-button")} Icon={LuChevronLeft} />
{validSegments && <SaveButton />}
Expand All @@ -94,7 +99,7 @@ const Save: React.FC = () => {

return (
<div css={saveStyle}>
<h1>{validSegments ? t("save.headline-text") : t("save.invalid-headline-text")}</h1>
<h1>{t("save.headline-text")}</h1>
{render()}
{postWorkflowStatus === "failed" &&
<ErrorBox>
Expand Down
8 changes: 6 additions & 2 deletions src/main/WorkflowSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ const WorkflowSelection: React.FC = () => {
if (!validSegments) {
return (
render(
t("save.invalid-headline-text"),
<span css={{ maxWidth: "500px" }}>{t("save.invalid-text")}</span>,
t("workflowSelection.saveAndProcess-text"),
<ErrorBox>
<span css={{ whiteSpace: "pre-line" }}>
{t("save.invalid-text")}
</span>
</ErrorBox>,
false,
<div/>,
saveStatus,
Expand Down

0 comments on commit cda6ffc

Please sign in to comment.