about summary refs log tree commit diff
path: root/src/screens
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/Home.tsx5
-rw-r--r--src/screens/Login.tsx17
-rw-r--r--src/screens/Signup.tsx23
3 files changed, 44 insertions, 1 deletions
diff --git a/src/screens/Home.tsx b/src/screens/Home.tsx
index f4b8ffb63..a2d013abe 100644
--- a/src/screens/Home.tsx
+++ b/src/screens/Home.tsx
@@ -1,8 +1,10 @@
 import React from 'react'
 import {Text, Button, View, SafeAreaView} from 'react-native'
 import type {PrimaryTabScreenProps} from '../routes/types'
+import {useStores} from '../state'
 
-export const Home = ({navigation}: PrimaryTabScreenProps<'Home'>) => {
+export function Home({navigation}: PrimaryTabScreenProps<'Home'>) {
+  const store = useStores()
   return (
     <SafeAreaView style={{flex: 1}}>
       <View style={{flex: 1}}>
@@ -11,6 +13,7 @@ export const Home = ({navigation}: PrimaryTabScreenProps<'Home'>) => {
           title="Go to Jane's profile"
           onPress={() => navigation.navigate('Profile', {name: 'Jane'})}
         />
+        <Button title="Logout" onPress={() => store.session.setAuthed(false)} />
       </View>
     </SafeAreaView>
   )
diff --git a/src/screens/Login.tsx b/src/screens/Login.tsx
new file mode 100644
index 000000000..77580748c
--- /dev/null
+++ b/src/screens/Login.tsx
@@ -0,0 +1,17 @@
+import React from 'react'
+import {Text, Button, View, SafeAreaView} from 'react-native'
+import type {RootStackScreenProps} from '../routes/types'
+import {useStores} from '../state'
+
+export function Login({navigation}: RootStackScreenProps<'Login'>) {
+  const store = useStores()
+  return (
+    <SafeAreaView style={{flex: 1}}>
+      <View style={{flex: 1}}>
+        <Text>Welcome! Time to sign in</Text>
+        <Button title="Login" onPress={() => store.session.setAuthed(true)} />
+        <Button title="Sign Up" onPress={() => navigation.navigate('Signup')} />
+      </View>
+    </SafeAreaView>
+  )
+}
diff --git a/src/screens/Signup.tsx b/src/screens/Signup.tsx
new file mode 100644
index 000000000..bf7f8f2f8
--- /dev/null
+++ b/src/screens/Signup.tsx
@@ -0,0 +1,23 @@
+import React from 'react'
+import {Text, Button, View, SafeAreaView} from 'react-native'
+import type {RootStackScreenProps} from '../routes/types'
+import {useStores} from '../state'
+
+export function Signup({navigation}: RootStackScreenProps<'Signup'>) {
+  const store = useStores()
+  return (
+    <SafeAreaView style={{flex: 1}}>
+      <View style={{flex: 1}}>
+        <Text>Let's create your account</Text>
+        <Button
+          title="Create new account"
+          onPress={() => store.session.setAuthed(true)}
+        />
+        <Button
+          title="Log in to an existing account"
+          onPress={() => navigation.navigate('Login')}
+        />
+      </View>
+    </SafeAreaView>
+  )
+}