-
Notifications
You must be signed in to change notification settings - Fork 2
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
loading modal #10
base: main
Are you sure you want to change the base?
loading modal #10
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.
Just a few ideas for changes, then I'll publish a new version
src/components/Modal/index.tsx
Outdated
@@ -15,6 +15,7 @@ import ReactDOM from 'react-dom'; | |||
|
|||
// Import other components | |||
import waitMs from '../../helpers/waitMs'; |
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.
Could you move this import to the right place? I think this issue was before you started, but let's fix it
src/components/Modal/index.tsx
Outdated
@@ -495,7 +509,7 @@ const Modal: React.FC<ModalProps> = (props) => { | |||
{title} | |||
</h5> | |||
|
|||
{(onClose && !dontShowXButton) && ( | |||
{(onClose && !dontShowXButton && !(isLoading && !isLoadingCancelable)) && ( |
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.
Let's put this logic outside jsx and describe what's happening here, now that it's getting so complex
{isLoading ? ( | ||
<> | ||
<LoadingSpinner /> | ||
<span className="sr-only">Content loading</span> |
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.
If the programmer wants to create their own loading interface, let them. I think this should only be shown if children
is undefined, null, an empty array, or falsy in some other way
No description provided.