diff options
| author | Husam Salhab <47015061+hsalhab@users.noreply.github.com> | 2020-06-26 12:53:50 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-26 12:53:50 -0400 |
| commit | cdbf153a09e20b3483926bf2cd80d600105fbeae (patch) | |
| tree | 48cc1d99384455af3e8a4c688ca42666c47e1a8f /src/screens | |
| parent | 36a6781faad4380e7c401f32506707c0e48a15f5 (diff) | |
| parent | 69bc5a72f72e847f42d8486ad29161f1e21239d3 (diff) | |
Merge pull request #7 from leonyjiang/tma58-react-navigation-setup
[TMA-58] Cleanup file structure & add react-navigation
Diffstat (limited to 'src/screens')
| -rw-r--r-- | src/screens/Login.tsx | 27 | ||||
| -rw-r--r-- | src/screens/Registration.tsx | 14 | ||||
| -rw-r--r-- | src/screens/index.ts | 2 |
3 files changed, 43 insertions, 0 deletions
diff --git a/src/screens/Login.tsx b/src/screens/Login.tsx new file mode 100644 index 00000000..0305b907 --- /dev/null +++ b/src/screens/Login.tsx @@ -0,0 +1,27 @@ +import React from 'react'; +import {RouteProp} from '@react-navigation/native'; +import {StackNavigationProp} from '@react-navigation/stack'; +import {View, Text, Button} from 'react-native'; + +import {RootStackParams} from '../routes'; + +type LoginScreenRouteProp = RouteProp<RootStackParams, 'Login'>; +type LoginScreenNavigationProp = StackNavigationProp<RootStackParams, 'Login'>; + +interface LoginProps { + route: LoginScreenRouteProp; + navigation: LoginScreenNavigationProp; +} +const Login = ({navigation}: LoginProps) => { + return ( + <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}> + <Text style={{fontSize: 18}}>Welcome to Tagg! Login page goes here.</Text> + <Button + title="Register" + onPress={() => navigation.navigate('Registration')} + /> + </View> + ); +}; + +export default Login; diff --git a/src/screens/Registration.tsx b/src/screens/Registration.tsx new file mode 100644 index 00000000..44658591 --- /dev/null +++ b/src/screens/Registration.tsx @@ -0,0 +1,14 @@ +import React from 'react'; +import {View, Text} from 'react-native'; + +interface RegistrationProps {} + +const Registration: React.FC<RegistrationProps> = ({}) => { + return ( + <View style={{flex: 1, alignSelf: 'center', justifyContent: 'center'}}> + <Text style={{fontSize: 18}}>Registration sequence begins here!</Text> + </View> + ); +}; + +export default Registration; diff --git a/src/screens/index.ts b/src/screens/index.ts new file mode 100644 index 00000000..60b26b4c --- /dev/null +++ b/src/screens/index.ts @@ -0,0 +1,2 @@ +export {default as Login} from './Login'; +export {default as Registration} from './Registration'; |
