pancake-toolkit icon indicating copy to clipboard operation
pancake-toolkit copied to clipboard

feat: Allow props to be given to dynamic modals via onPresentCallback

Open 58bits opened this issue 3 years ago • 0 comments

Your context-based dynamic modal provider is very nice. There are certain cases however, where it might be nice to call the onPresentCallback with additional props for the modal (only known at runtime).

For example....

const { onPresent, onDismiss, isOpen } = useUpgradeModal(handleUpgrade, handleWait)
...
onPresent({ currentVersion: CURRENT_VERSION, newVersion: DEPLOYED_VERSION})

The included PR allows props to be passed to the onPresent handler, and then onward to ModalContext

Hope this helps. ;-)

58bits avatar Dec 30 '21 00:12 58bits