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-04-18 14:14:54 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
557b3ee6f4fd7f0b008b08ea343aae385cf73919
557b3ee6
1 parent
d9f6a568
refactor: move third-party modules out from SystemInfo to Library
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
32 deletions
src/screen/AppNavigationContainer.tsx
src/screen/Library.tsx
src/screen/SystemInfo.tsx
src/type/Navigation.ts
src/screen/AppNavigationContainer.tsx
View file @
557b3ee
...
...
@@ -21,6 +21,7 @@ import { Platform } from 'react-native';
import RNLocalize from './RNLocalize';
import { useI18nStrings } from '../i18n';
import CameraScreen from './CameraScreen';
import Library from './Library';
const MainTab = createBottomTabNavigator<MainTabParamList>();
...
...
@@ -64,6 +65,14 @@ const Home = () => {
name={'ios-color-palette'}
/>
);
case 'Library':
return (
<Ionicons
size={size}
color={color}
name={focused ? 'ios-list-box' : 'ios-list'}
/>
);
default:
break;
}
...
...
@@ -71,6 +80,7 @@ const Home = () => {
};
}}
>
<MainTab.Screen name="Library" component={Library} />
<MainTab.Screen name="SystemInfo" component={SystemInfo} />
<MainTab.Screen name="DesignList" component={DesignList} />
</MainTab.Navigator>
...
...
src/screen/Library.tsx
0 → 100644
View file @
557b3ee
import React from 'react';
import { BGList, BGScroll, ListItem, Divider } from '../component/View';
import { MainTabScreenProps } from '../type/Navigation';
import { useI18nStrings } from '../i18n';
const Library = ({ navigation }: MainTabScreenProps<'Library'>) => {
const strings = useI18nStrings();
return (
<BGScroll>
<ListItem
title="RNDeviceInfo"
onPress={() => navigation.navigate('RNDeviceInfoList')}
chevron
/>
<Divider />
<ListItem
title={'RNCWebview'}
onPress={() =>
navigation.navigate('WebviewScreen', {
uri: 'https://www.baidu.com',
})
}
chevron
/>
<Divider />
<ListItem
title={'RNLocalize'}
onPress={() => navigation.navigate('RNLocalize')}
rightTitle={strings.name}
chevron
/>
<Divider />
<ListItem
title={'RNCamera'}
onPress={() => navigation.navigate('RNCamera')}
chevron
/>
</BGScroll>
);
};
export default Library;
...
...
src/screen/SystemInfo.tsx
View file @
557b3ee
...
...
@@ -4,7 +4,6 @@ import { screensEnabled } from 'react-native-screens';
import { useNetInfo } from '@react-native-community/netinfo';
import { ListItem, BGScroll, Card, Divider } from '../component/View';
import { MainTabScreenProps } from '../type/Navigation';
import { useI18nStrings } from '../i18n';
declare var global: { HermesInternal: null | {} };
...
...
@@ -12,7 +11,6 @@ const SystemInfo = ({
navigation,
route,
}: MainTabScreenProps<'SystemInfo'>) => {
const strings = useI18nStrings();
const netInfo = useNetInfo();
const { width, height, fontScale, scale } = useWindowDimensions();
return (
...
...
@@ -61,36 +59,6 @@ const SystemInfo = ({
rightTitle={JSON.stringify(netInfo.details)}
/>
</Card>
<Card shadow>
<ListItem
title="RNDeviceInfo"
onPress={() => navigation.navigate('RNDeviceInfoList')}
chevron
/>
<Divider />
<ListItem
title={'RNCWebview'}
onPress={() =>
navigation.navigate('WebviewScreen', {
uri: 'https://www.baidu.com',
})
}
chevron
/>
<Divider />
<ListItem
title={'RNLocalize'}
onPress={() => navigation.navigate('RNLocalize')}
rightTitle={strings.name}
chevron
/>
<Divider />
<ListItem
title={'Camera'}
onPress={() => navigation.navigate('RNCamera')}
chevron
/>
</Card>
</BGScroll>
);
};
...
...
src/type/Navigation.ts
View file @
557b3ee
...
...
@@ -3,6 +3,7 @@ import { BottomTabNavigationProp } from '@react-navigation/bottom-tabs';
import
{
StackNavigationProp
}
from
'@react-navigation/stack'
;
export
type
MainTabParamList
=
{
Library
:
undefined
;
SystemInfo
:
undefined
;
DesignList
:
undefined
;
};
...
...
Please
register
or
login
to post a comment