-
Notifications
You must be signed in to change notification settings - Fork 13
Conversation
Adds in a basic Confirm/Deny modal with customizable text.
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.
Awesome, thank you! Before merging though, could you run the code style/quality enforcement tools as described in the README?
# auto-fixes any style problems
$ pnpm run style:fix
# auto-fixes any linting problems, and prints the ones that can't be auto-fixed
$ pnpm run lint:fix
# runs the TypeScript compiler so any type errors will be shown
$ pnpm run typecheck
</div> | ||
<div class="black mb-4 text-lg">{props.message}</div> | ||
<div class="flex items-center justify-end"> | ||
<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.
Could there be a case where we may need more or less buttons than two? For example, a modal with information that doesn't need a confirm/deny action.
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.
Yep, I can also foresee situations where e.g. the button(s) should be disabled until a certain condition is met, and things of the sort.
I think the best interface for that will likely imply breaking the Modal component apart into Modal.Header
, Modal.Body
and Modal.Footer
so we have fine-grained control of the contents in each through the children
prop, but I think that can be left as a future PR if necessary.
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.
Thanks. Don't worry about the linter complaining about the default export for the mock file, the mocking is being reworked in a separate PR so that point will be moot in a bit. Left some other comments below.
<div class="fixed inset-0 transition-opacity"> | ||
<div class="absolute inset-0 bg-gray-500 opacity-75" /> | ||
</div> |
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.
</div> | ||
<div class="black mb-4 text-lg">{props.message}</div> | ||
<div class="flex items-center justify-end"> | ||
<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.
Yep, I can also foresee situations where e.g. the button(s) should be disabled until a certain condition is met, and things of the sort.
I think the best interface for that will likely imply breaking the Modal component apart into Modal.Header
, Modal.Body
and Modal.Footer
so we have fine-grained control of the contents in each through the children
prop, but I think that can be left as a future PR if necessary.
Adds in basic confirm/decline modal.
Example of Usage: