Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Phecda
/
NGPlay
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Phecda
2020-05-09 14:43:28 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
33e7409ce6518949b977913e6c1ff33e98d6270b
33e7409c
1 parent
c290a4ee
feat: add RNND
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
65 additions
and
0 deletions
ios/Podfile.lock
package.json
src/screen/AppNavigationContainer.tsx
src/screen/Dialogs.tsx
src/screen/Library.tsx
src/type/Navigation.ts
yarn.lock
ios/Podfile.lock
View file @
33e7409
...
...
@@ -339,6 +339,8 @@ PODS:
- RSKImageCropper
- RNLocalize (1.4.0):
- React
- RNNativeDialogs (2.0.0):
- React
- RNPermissions (2.1.2):
- React
- RNQuickAction (0.3.13):
...
...
@@ -406,6 +408,7 @@ DEPENDENCIES:
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNImageCropPicker (from `../node_modules/react-native-image-crop-picker`)
- RNLocalize (from `../node_modules/react-native-localize`)
- RNNativeDialogs (from `../../react-native-native-dialogs`)
- RNPermissions (from `../node_modules/react-native-permissions`)
- RNQuickAction (from `../node_modules/react-native-quick-actions`)
- RNReanimated (from `../node_modules/react-native-reanimated`)
...
...
@@ -513,6 +516,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-image-crop-picker"
RNLocalize:
:path: "../node_modules/react-native-localize"
RNNativeDialogs:
:path: "../../react-native-native-dialogs"
RNPermissions:
:path: "../node_modules/react-native-permissions"
RNQuickAction:
...
...
@@ -581,6 +586,7 @@ SPEC CHECKSUMS:
RNGestureHandler: 8f09cd560f8d533eb36da5a6c5a843af9f056b38
RNImageCropPicker: cf129d17e042ce3e96fb9ada967c28f21f977c82
RNLocalize: b6df30cc25ae736d37874f9bce13351db2f56796
RNNativeDialogs: 09de1929ba1610b8aa03f021584cc0c9762eb5af
RNPermissions: a96580116f7894146552e92b000ac30bf1661947
RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93
RNReanimated: 4e102df74a9674fa943e05f97f3362b6e44d0b48
...
...
package.json
View file @
33e7409
...
...
@@ -35,6 +35,7 @@
"react-native-gesture-handler"
:
"^1.6.1"
,
"react-native-image-crop-picker"
:
"^0.28.0"
,
"react-native-localize"
:
"^1.4.0"
,
"react-native-native-dialogs"
:
"git+ssh://git@github.com:Phecda/react-native-native-dialogs.git#v2.0.0"
,
"react-native-permissions"
:
"^2.1.2"
,
"react-native-progress"
:
"^4.1.2"
,
"react-native-quick-actions"
:
"https://github.com/Phecda/react-native-quick-actions#master"
,
...
...
src/screen/AppNavigationContainer.tsx
View file @
33e7409
...
...
@@ -34,6 +34,7 @@ import useQuickAction from '../utility/useQuickAction';
import { useReduxState } from '../store/hooks';
import LoginScreen from './Login';
import MeScreen from './Me';
import RNDialogs from './Dialogs';
const MainTab = createBottomTabNavigator<MainTabParamList>();
...
...
@@ -152,6 +153,7 @@ const Container = () => {
<MainStack.Screen name="RNCamera" component={CameraScreen} />
<MainStack.Screen name="RNCode" component={ReadableCode} />
<MainStack.Screen name="ShortcutItem" component={ShortcutPage} />
<MainStack.Screen name="RNDialogs" component={RNDialogs} />
</MainStack.Navigator>
) : (
<AuthStack.Navigator>
...
...
src/screen/Dialogs.tsx
0 → 100644
View file @
33e7409
import React from 'react';
import { BGScroll, Card, ListItem } from '../component/View';
import Dialogs from 'react-native-native-dialogs';
const companies = ['Apple', 'Google', 'Facebook'];
const RNDialogs = () => {
const [selectedItem, setSelectedItem] = React.useState<number>();
const [promptText, setPromptText] = React.useState('default string');
return (
<BGScroll>
<Card round>
<ListItem
title="ActionSheet"
onPress={() => {
Dialogs.showActionSheet({
title: 'Choose a company',
options: companies,
textAlign: 'left',
selectedIndex: selectedItem,
})
.then(setSelectedItem)
.catch(() => {});
}}
rightTitle={companies[selectedItem ?? -1]}
/>
<ListItem
title="Prompt"
rightTitle={promptText}
onPress={() => {
Dialogs.showPrompt({
message: 'It is useless, trust me. :)',
title: 'Your Name?',
placeholder: 'Say something',
defaultValue: promptText,
})
.then(setPromptText)
.catch(() => {});
}}
/>
</Card>
</BGScroll>
);
};
export default RNDialogs;
...
...
src/screen/Library.tsx
View file @
33e7409
...
...
@@ -47,6 +47,11 @@ const Library = ({ navigation }: MainTabScreenProps<'Library'>) => {
onPress={() => navigation.navigate('ShortcutItem')}
chevron
/>
<Divider />
<ListItem
title={'RNDialogs'}
onPress={() => navigation.navigate('RNDialogs')}
/>
</BGScroll>
);
};
...
...
src/type/Navigation.ts
View file @
33e7409
...
...
@@ -17,6 +17,7 @@ export type MainStackParamList = {
RNCamera
:
undefined
;
RNCode
:
undefined
;
ShortcutItem
:
{
id
?:
string
};
RNDialogs
:
undefined
;
};
export
type
AuthStackParamList
=
{
...
...
yarn.lock
View file @
33e7409
...
...
@@ -7138,6 +7138,10 @@ react-native-localize@^1.4.0:
resolved "https://registry.npm.taobao.org/react-native-localize/download/react-native-localize-1.4.0.tgz#4653596d066d0941c48f5404dc1c0d08b6950443"
integrity sha1-RlNZbQZtCUHEj1QE3BwNCLaVBEM=
"react-native-native-dialogs@git+ssh://git@github.com:Phecda/react-native-native-dialogs.git#v2.0.0":
version "2.0.0"
resolved "git+ssh://git@github.com:Phecda/react-native-native-dialogs.git#13686d7450665a62cc68293c8627da67bd5f918c"
react-native-permissions@^2.1.2:
version "2.1.2"
resolved "https://registry.npm.taobao.org/react-native-permissions/download/react-native-permissions-2.1.2.tgz#14f30a6cfa0851ecb210d7eadcc590f8823c8585"
...
...
Please
register
or
login
to post a comment