bezenson / react-native-unicorn-modals Goto Github PK
View Code? Open in Web Editor NEWCustom modals with Imperative API ๐ฆ
Home Page: https://inferusvv.github.io/react-native-unicorn-modals/
License: MIT License
Custom modals with Imperative API ๐ฆ
Home Page: https://inferusvv.github.io/react-native-unicorn-modals/
License: MIT License
Hi! ๐
Firstly, thanks for your work on this project! ๐
Today I used patch-package to patch [email protected]
for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-unicorn-modals/src/themes/default-dark.ts b/node_modules/react-native-unicorn-modals/src/themes/default-dark.ts
index 4b8df4a..6a5f3c0 100644
--- a/node_modules/react-native-unicorn-modals/src/themes/default-dark.ts
+++ b/node_modules/react-native-unicorn-modals/src/themes/default-dark.ts
@@ -8,7 +8,7 @@ const defaultThemeDark: DefaultTheme = {
},
cardBackgroundColor: '#111',
lineColor: '#222',
- overlayBackgroundColor: 'rgba(0, 0, 0, 0.8)',
+ overlayBackgroundColor: '#0008',
textColor: '#ddd',
titleTextColor: '#fff',
};
diff --git a/node_modules/react-native-unicorn-modals/src/themes/default-light.ts b/node_modules/react-native-unicorn-modals/src/themes/default-light.ts
index 4c5f21e..7aff425 100644
--- a/node_modules/react-native-unicorn-modals/src/themes/default-light.ts
+++ b/node_modules/react-native-unicorn-modals/src/themes/default-light.ts
@@ -8,7 +8,7 @@ const defaultThemeLight: DefaultTheme = {
},
cardBackgroundColor: '#eee',
lineColor: '#ddd',
- overlayBackgroundColor: 'rgba(0, 0, 0, 0.8)',
+ overlayBackgroundColor: '#0008',
textColor: '#333',
titleTextColor: '#000',
};
This issue body was partially generated by patch-package.
add animationType
to modal.show
options
add modal.hide()
to close modal in custom modal content view
Hi @inferusvv , as I can see, the lib depends on Reanimated 2, which may not have compatibility with newer React Native versions. Are there plans to update it?
cancelable: false Invalid
model.show( 'customModal', { title, description: message, ok: { text: 'done', onPress: onPress }, }, { cancellable: false }, );
Hi there! First of all, bravo for the library ๐ Definitely the best of the kind I've found so far both in terms of appearance and API design.
There's a small bug in v0.5.0: in the code to open a menu:
modal.show(
'menu',
{
items: [
{ text: 'Default variant', onPress: () => {} },
{ text: 'Cancel variant', variant: 'cancel', onPress: () => {} },
{ text: 'Destructive variant', variant: 'destructive', onPress: () => {} },
],
},
);
None of these onPress
callbacks get called. I looked into the source code and was able to fix it by changing a line in Menu.tsx
:
<MenuItem key={item.text} onPress={createActionCallback()} theme={theme} variant={item.variant}>
to
<MenuItem key={item.text} onPress={createActionCallback(item.onPress)} theme={theme} variant={item.variant}>
Just posting it here so you guys can fix it upstream. Thanks for the work! ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.