-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic modal #64
Generic modal #64
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fun, enjoyed this! Appreciate your work on it
width: 100%; | ||
height: 100vh; | ||
background: rgba(0, 0, 0, 0.75); | ||
z-index: 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh this is fun
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which part? 😅
.then((response) => console.debug("Bundle submitted", bundle, response)) | ||
.catch((error) => console.error(error)); | ||
.catch((error) => { | ||
console.error(error) | ||
setModal({ | ||
message: 'Something went wrong submitting the bundle. Please try again later.', | ||
isError: true, | ||
}); | ||
}); | ||
actions.setSubmitting(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably also worth going through the response entries and if any of the response codes don't start with 2
, then add a modal message to saying that there was an error with the FHIR resource. If you'd like some example bundles which will cause an error let me know and I can make some for you
@@ -104,6 +113,9 @@ const ReportForm: FC<Props> = (props: Props) => { | |||
}; | |||
|
|||
return ( | |||
<> | |||
<ModalWrapper isError={modal?.isError} modalMessage={modal?.message} onClear={() => setModal(null)} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have expected the indentation to change here.. strange
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, my auto formatter has stopped working for some reason. I must have missed this one! I'll make sure to get prettier set up again!
src/components/UI/ModalWrapper.tsx
Outdated
isError={isError} | ||
header={isError ? 'Error' : "Info"} | ||
show={!!modalMessage} | ||
footer={<button className={classes.modal__btn} onClick={onClear}>Okay</button>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh one thing is that maybe the okay should also change colour if there's an error - red and purple look a bit jarring to my eyes at least
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, good call!
isError
,