Phecda

feat: add RNND

@@ -339,6 +339,8 @@ PODS: @@ -339,6 +339,8 @@ PODS:
339 - RSKImageCropper 339 - RSKImageCropper
340 - RNLocalize (1.4.0): 340 - RNLocalize (1.4.0):
341 - React 341 - React
  342 + - RNNativeDialogs (2.0.0):
  343 + - React
342 - RNPermissions (2.1.2): 344 - RNPermissions (2.1.2):
343 - React 345 - React
344 - RNQuickAction (0.3.13): 346 - RNQuickAction (0.3.13):
@@ -406,6 +408,7 @@ DEPENDENCIES: @@ -406,6 +408,7 @@ DEPENDENCIES:
406 - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) 408 - RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
407 - RNImageCropPicker (from `../node_modules/react-native-image-crop-picker`) 409 - RNImageCropPicker (from `../node_modules/react-native-image-crop-picker`)
408 - RNLocalize (from `../node_modules/react-native-localize`) 410 - RNLocalize (from `../node_modules/react-native-localize`)
  411 + - RNNativeDialogs (from `../../react-native-native-dialogs`)
409 - RNPermissions (from `../node_modules/react-native-permissions`) 412 - RNPermissions (from `../node_modules/react-native-permissions`)
410 - RNQuickAction (from `../node_modules/react-native-quick-actions`) 413 - RNQuickAction (from `../node_modules/react-native-quick-actions`)
411 - RNReanimated (from `../node_modules/react-native-reanimated`) 414 - RNReanimated (from `../node_modules/react-native-reanimated`)
@@ -513,6 +516,8 @@ EXTERNAL SOURCES: @@ -513,6 +516,8 @@ EXTERNAL SOURCES:
513 :path: "../node_modules/react-native-image-crop-picker" 516 :path: "../node_modules/react-native-image-crop-picker"
514 RNLocalize: 517 RNLocalize:
515 :path: "../node_modules/react-native-localize" 518 :path: "../node_modules/react-native-localize"
  519 + RNNativeDialogs:
  520 + :path: "../../react-native-native-dialogs"
516 RNPermissions: 521 RNPermissions:
517 :path: "../node_modules/react-native-permissions" 522 :path: "../node_modules/react-native-permissions"
518 RNQuickAction: 523 RNQuickAction:
@@ -581,6 +586,7 @@ SPEC CHECKSUMS: @@ -581,6 +586,7 @@ SPEC CHECKSUMS:
581 RNGestureHandler: 8f09cd560f8d533eb36da5a6c5a843af9f056b38 586 RNGestureHandler: 8f09cd560f8d533eb36da5a6c5a843af9f056b38
582 RNImageCropPicker: cf129d17e042ce3e96fb9ada967c28f21f977c82 587 RNImageCropPicker: cf129d17e042ce3e96fb9ada967c28f21f977c82
583 RNLocalize: b6df30cc25ae736d37874f9bce13351db2f56796 588 RNLocalize: b6df30cc25ae736d37874f9bce13351db2f56796
  589 + RNNativeDialogs: 09de1929ba1610b8aa03f021584cc0c9762eb5af
584 RNPermissions: a96580116f7894146552e92b000ac30bf1661947 590 RNPermissions: a96580116f7894146552e92b000ac30bf1661947
585 RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93 591 RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93
586 RNReanimated: 4e102df74a9674fa943e05f97f3362b6e44d0b48 592 RNReanimated: 4e102df74a9674fa943e05f97f3362b6e44d0b48
@@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
35 "react-native-gesture-handler": "^1.6.1", 35 "react-native-gesture-handler": "^1.6.1",
36 "react-native-image-crop-picker": "^0.28.0", 36 "react-native-image-crop-picker": "^0.28.0",
37 "react-native-localize": "^1.4.0", 37 "react-native-localize": "^1.4.0",
  38 + "react-native-native-dialogs": "git+ssh://git@github.com:Phecda/react-native-native-dialogs.git#v2.0.0",
38 "react-native-permissions": "^2.1.2", 39 "react-native-permissions": "^2.1.2",
39 "react-native-progress": "^4.1.2", 40 "react-native-progress": "^4.1.2",
40 "react-native-quick-actions": "https://github.com/Phecda/react-native-quick-actions#master", 41 "react-native-quick-actions": "https://github.com/Phecda/react-native-quick-actions#master",
@@ -34,6 +34,7 @@ import useQuickAction from '../utility/useQuickAction'; @@ -34,6 +34,7 @@ import useQuickAction from '../utility/useQuickAction';
34 import { useReduxState } from '../store/hooks'; 34 import { useReduxState } from '../store/hooks';
35 import LoginScreen from './Login'; 35 import LoginScreen from './Login';
36 import MeScreen from './Me'; 36 import MeScreen from './Me';
  37 +import RNDialogs from './Dialogs';
37 38
38 const MainTab = createBottomTabNavigator<MainTabParamList>(); 39 const MainTab = createBottomTabNavigator<MainTabParamList>();
39 40
@@ -152,6 +153,7 @@ const Container = () => { @@ -152,6 +153,7 @@ const Container = () => {
152 <MainStack.Screen name="RNCamera" component={CameraScreen} /> 153 <MainStack.Screen name="RNCamera" component={CameraScreen} />
153 <MainStack.Screen name="RNCode" component={ReadableCode} /> 154 <MainStack.Screen name="RNCode" component={ReadableCode} />
154 <MainStack.Screen name="ShortcutItem" component={ShortcutPage} /> 155 <MainStack.Screen name="ShortcutItem" component={ShortcutPage} />
  156 + <MainStack.Screen name="RNDialogs" component={RNDialogs} />
155 </MainStack.Navigator> 157 </MainStack.Navigator>
156 ) : ( 158 ) : (
157 <AuthStack.Navigator> 159 <AuthStack.Navigator>
  1 +import React from 'react';
  2 +import { BGScroll, Card, ListItem } from '../component/View';
  3 +import Dialogs from 'react-native-native-dialogs';
  4 +
  5 +const companies = ['Apple', 'Google', 'Facebook'];
  6 +
  7 +const RNDialogs = () => {
  8 + const [selectedItem, setSelectedItem] = React.useState<number>();
  9 + const [promptText, setPromptText] = React.useState('default string');
  10 + return (
  11 + <BGScroll>
  12 + <Card round>
  13 + <ListItem
  14 + title="ActionSheet"
  15 + onPress={() => {
  16 + Dialogs.showActionSheet({
  17 + title: 'Choose a company',
  18 + options: companies,
  19 + textAlign: 'left',
  20 + selectedIndex: selectedItem,
  21 + })
  22 + .then(setSelectedItem)
  23 + .catch(() => {});
  24 + }}
  25 + rightTitle={companies[selectedItem ?? -1]}
  26 + />
  27 + <ListItem
  28 + title="Prompt"
  29 + rightTitle={promptText}
  30 + onPress={() => {
  31 + Dialogs.showPrompt({
  32 + message: 'It is useless, trust me. :)',
  33 + title: 'Your Name?',
  34 + placeholder: 'Say something',
  35 + defaultValue: promptText,
  36 + })
  37 + .then(setPromptText)
  38 + .catch(() => {});
  39 + }}
  40 + />
  41 + </Card>
  42 + </BGScroll>
  43 + );
  44 +};
  45 +
  46 +export default RNDialogs;
@@ -47,6 +47,11 @@ const Library = ({ navigation }: MainTabScreenProps<'Library'>) => { @@ -47,6 +47,11 @@ const Library = ({ navigation }: MainTabScreenProps<'Library'>) => {
47 onPress={() => navigation.navigate('ShortcutItem')} 47 onPress={() => navigation.navigate('ShortcutItem')}
48 chevron 48 chevron
49 /> 49 />
  50 + <Divider />
  51 + <ListItem
  52 + title={'RNDialogs'}
  53 + onPress={() => navigation.navigate('RNDialogs')}
  54 + />
50 </BGScroll> 55 </BGScroll>
51 ); 56 );
52 }; 57 };
@@ -17,6 +17,7 @@ export type MainStackParamList = { @@ -17,6 +17,7 @@ export type MainStackParamList = {
17 RNCamera: undefined; 17 RNCamera: undefined;
18 RNCode: undefined; 18 RNCode: undefined;
19 ShortcutItem: { id?: string }; 19 ShortcutItem: { id?: string };
  20 + RNDialogs: undefined;
20 }; 21 };
21 22
22 export type AuthStackParamList = { 23 export type AuthStackParamList = {
@@ -7138,6 +7138,10 @@ react-native-localize@^1.4.0: @@ -7138,6 +7138,10 @@ react-native-localize@^1.4.0:
7138 resolved "https://registry.npm.taobao.org/react-native-localize/download/react-native-localize-1.4.0.tgz#4653596d066d0941c48f5404dc1c0d08b6950443" 7138 resolved "https://registry.npm.taobao.org/react-native-localize/download/react-native-localize-1.4.0.tgz#4653596d066d0941c48f5404dc1c0d08b6950443"
7139 integrity sha1-RlNZbQZtCUHEj1QE3BwNCLaVBEM= 7139 integrity sha1-RlNZbQZtCUHEj1QE3BwNCLaVBEM=
7140 7140
  7141 +"react-native-native-dialogs@git+ssh://git@github.com:Phecda/react-native-native-dialogs.git#v2.0.0":
  7142 + version "2.0.0"
  7143 + resolved "git+ssh://git@github.com:Phecda/react-native-native-dialogs.git#13686d7450665a62cc68293c8627da67bd5f918c"
  7144 +
7141 react-native-permissions@^2.1.2: 7145 react-native-permissions@^2.1.2:
7142 version "2.1.2" 7146 version "2.1.2"
7143 resolved "https://registry.npm.taobao.org/react-native-permissions/download/react-native-permissions-2.1.2.tgz#14f30a6cfa0851ecb210d7eadcc590f8823c8585" 7147 resolved "https://registry.npm.taobao.org/react-native-permissions/download/react-native-permissions-2.1.2.tgz#14f30a6cfa0851ecb210d7eadcc590f8823c8585"