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.
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
feat(Sheet): new component #840
feat(Sheet): new component #840
Changes from 8 commits
e5d5039
858f52b
7b36788
d9995c3
99f4ca2
81ff7b8
8b7f3d2
046301b
03d6546
ca2b10e
45496e9
ee13795
b58d9f9
b627dbd
b67663f
4cbd652
bf064cb
853312f
52fc6a3
fb9a4a8
515bd46
00e2495
509ac2c
1aad7a0
60cf078
1c842d9
87f8616
be5e558
355ae57
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
note that
onClose
is called when the closing animation finishes, so the idea is not unmounting the component until the transition finishes, that's why I set showSheet to false in onClose handler instead of ButtonPrimary onPress handlerThere 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.
this equivalent to the
confirm()
,alert()
methods we have for dialogsThere 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've decided to not include this automatically inside
ThemeContextProvider
to allow webs using mistica to optin to use this. The advantage is that we don't bloat webs with all sheet components JS code if they are not going to use it. Also, it isn't needed to useBottomSheetRoot
if you don't wan't to use the imperative apiThere 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.
with this approach, mistica doesn't need to depend on webview bridge lib, because the native implementation is injected, not imported. I think we could follow a similar approach for
alert()
confirm()
or other components using the bridge. That would allow us to remove the"@tef-novum/webview-bridge"
dependency from misticapackage.json
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.
Ideally we should be able to inject the bridge function "as is" to the Root component.
Something like:
and the
nativeImplementation
prop would be typed astypeof openBottomSheet
;This way everything is tied, types are verified at compile time and we won't need a
createNativeSheetImplementationFromWebviewBridge
.Perhaps the bridge dependency could be listed as
optionalDependency
. I think it would be a problem to fully decouple both implementations.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.
hmmm... I see your point, but that would mean I'd need to re-implement the specific sheet methods in mistica (
bottomSheetSingleSelector
,bottomSheetActionSelector
,bottomSheetInfo
,bottomSheetActions
)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.
ok, I've moved these specific sheet methods from the bridge lib to mistica and removed them from webview-bridge (Telefonica/webview-bridge#115)