feat(react-components): modal customization and offer status updates #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #119
closes #118
Description
For #118, this adds the
modalTheme
prop to theAgoricProvider
, which seems to successfully allow style overrides when tested with https://github.com/Agoric/ui-kit/tree/main/packages/example.For #119, it fixes the logic to call
onStatusUpdate
when the dialog is dismissed without proceeding.Testing
Tested in https://github.com/Agoric/ui-kit/tree/main/packages/example manually.
Documentation Considerations
The
modalTheme
prop supports customization via overrides, as well as creating a custom theme, as documented in https://docs.cosmology.zone/cosmos-kit/migration-to-v2#customizing-the-default-modal. For some reason, it only works to pass themodalTheme
prop intoChainProvider
... theThemeProvider
props don't work. It's not really clear from the documentation what the difference is. Probably something to do with how the css-in-js library thatinterchain-ui
uses works when it's packaged with vite (maybe it expects nextjs and to not be wrapped by another package). Furthermore, the customization doesn't seem to work too well. I wasn't able to get a custom theme working, even when testing in isolation, and theoverrides
are very limited. For example, you can override the button background color, but can't specify it according to button type, so the "Proceed" and "Go Back" buttons in the provision dialog will end up the same color. Because of this, I wouldn't recommend devs do that unless they implement a custom dialog/provision flow altogether. The option is still available at least. I don't think it looks too bad to use the default styling because it's in a modal, so it's less jarring if it doesn't match the rest of the app.