File tree Expand file tree Collapse file tree 11 files changed +109
-18
lines changed
Expand file tree Collapse file tree 11 files changed +109
-18
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { AuthContextProvider } from '@app/context';
22import {
33 AuthLoadingScreen ,
44 CategoryScreen ,
5- ChangelogScreen ,
65 LoginScreen ,
76 StorybookScreen ,
87} from '@app/screens' ;
@@ -22,6 +21,10 @@ import {
2221 DevToolsParamList ,
2322 DevToolsStackNavigator ,
2423} from './DevToolsStackNavigator' ;
24+ import {
25+ OtherStackNavigator ,
26+ OtherStackParamList ,
27+ } from './OtherStackNavigator' ;
2528import {
2629 PreferenceStackNavigator ,
2730 PreferenceStackParamList ,
@@ -65,9 +68,6 @@ export type AppStackParamList = {
6568 // login screen
6669 Login : undefined ;
6770
68- // changelog
69- Changelog : undefined ;
70-
7171 // sb
7272 Storybook : undefined ;
7373
@@ -76,6 +76,9 @@ export type AppStackParamList = {
7676
7777 // dev-tools
7878 DevTools : NavigatorScreenParams < DevToolsParamList > ;
79+
80+ // other
81+ Other : NavigatorScreenParams < OtherStackParamList > ;
7982} ;
8083
8184/**
@@ -117,7 +120,7 @@ const AppStack = () => {
117120 < Stack . Screen name = "Login" component = { LoginScreen } />
118121
119122 { /* Changelog */ }
120- < Stack . Screen name = "Changelog " component = { ChangelogScreen } />
123+ < Stack . Screen name = "Other " component = { OtherStackNavigator } />
121124
122125 { /* sb */ }
123126 < Stack . Screen name = "Storybook" component = { StorybookScreen } />
Original file line number Diff line number Diff line change 1+ import { ChangelogScreen } from '@app/screens' ;
2+ import { AboutScreen , FaqScreen } from '@app/screens/Other' ;
3+ import { createNativeStackNavigator } from '@react-navigation/native-stack' ;
4+ import { StackScreenProps } from '@react-navigation/stack' ;
5+
6+ export type OtherStackParamList = {
7+ About : undefined ;
8+ Changelog : undefined ;
9+ Faq : undefined ;
10+ } ;
11+
12+ const Stack = createNativeStackNavigator < OtherStackParamList > ( ) ;
13+
14+ export type OtherStackScreenProps < T extends keyof OtherStackParamList > =
15+ StackScreenProps < OtherStackParamList , T > ;
16+
17+ export function OtherStackNavigator ( ) {
18+ return (
19+ < Stack . Navigator >
20+ < Stack . Screen
21+ name = "About"
22+ component = { AboutScreen }
23+ options = { { headerShown : false } }
24+ />
25+ < Stack . Screen
26+ name = "Changelog"
27+ component = { ChangelogScreen }
28+ options = { { headerShown : false } }
29+ />
30+ < Stack . Screen
31+ name = "Faq"
32+ component = { FaqScreen }
33+ options = { { headerShown : false } }
34+ />
35+ </ Stack . Navigator >
36+ ) ;
37+ }
Original file line number Diff line number Diff line change @@ -20,5 +20,5 @@ export const BaseConfig: ConfigBaseProps = {
2020 * This is a list of all the route names that will exit the app if the back button
2121 * is pressed while in that screen. Only affects Android.
2222 */
23- exitRoutes : [ 'AuthLoadingScreen ' ] ,
23+ exitRoutes : [ '' ] ,
2424} ;
Original file line number Diff line number Diff line change @@ -7,3 +7,4 @@ export * from './config';
77export * from './BackButton' ;
88export * from './PreferenceStackNavigator' ;
99export * from './DevToolsStackNavigator' ;
10+ export * from './OtherStackNavigator' ;
Original file line number Diff line number Diff line change 1- import { Spinner , Typography } from '@app/components' ;
21import { useAuthContext } from '@app/context' ;
32import { useAppNavigation } from '@app/hooks' ;
43import { useEffect } from 'react' ;
5- import { View } from 'react-native' ;
64
75export function AuthLoadingScreen ( ) {
86 const { populateAuthState, authState } = useAuthContext ( ) ;
97 const { navigate } = useAppNavigation ( ) ;
108 useEffect ( ( ) => {
11- // todo - expose if we're anon or logged in an redirect to the following screen if we have an account
129 populateAuthState ( ) . then ( ( ) => {
1310 if ( authState ?. isLoggedIn ) {
14- console . log ( 'isAuth true' ) ;
1511 navigate ( 'Tabs' , {
1612 screen : 'Following' ,
1713 } ) ;
1814 }
1915
2016 if ( authState ?. isAnonAuth ) {
21- console . log ( 'isAnonAuth true' ) ;
2217 navigate ( 'Tabs' , {
2318 screen : 'Top' ,
2419 } ) ;
@@ -27,10 +22,5 @@ export function AuthLoadingScreen() {
2722 // eslint-disable-next-line react-hooks/exhaustive-deps
2823 } , [ ] ) ;
2924
30- return (
31- < View style = { { flex : 1 , padding : 16 , justifyContent : 'center' } } >
32- < Typography > Auth loading...</ Typography >
33- < Spinner />
34- </ View >
35- ) ;
25+ return null ;
3626}
Original file line number Diff line number Diff line change 1+ import { Screen , Typography } from '@app/components' ;
2+ import { useAppNavigation , useHeader } from '@app/hooks' ;
3+
4+ export function AboutScreen ( ) {
5+ const { goBack } = useAppNavigation ( ) ;
6+
7+ useHeader ( {
8+ title : 'About' ,
9+ leftIcon : 'arrow-left' ,
10+ onLeftPress : ( ) => goBack ( ) ,
11+ } ) ;
12+ return (
13+ < Screen >
14+ < Typography > About</ Typography >
15+ </ Screen >
16+ ) ;
17+ }
File renamed without changes.
Original file line number Diff line number Diff line change 1+ import { Screen , Typography } from '@app/components' ;
2+ import { useAppNavigation , useHeader } from '@app/hooks' ;
3+
4+ export function FaqScreen ( ) {
5+ const { goBack } = useAppNavigation ( ) ;
6+
7+ useHeader ( {
8+ title : 'Faq' ,
9+ leftIcon : 'arrow-left' ,
10+ onLeftPress : ( ) => goBack ( ) ,
11+ } ) ;
12+ return (
13+ < Screen >
14+ < Typography > FAQ</ Typography >
15+ </ Screen >
16+ ) ;
17+ }
Original file line number Diff line number Diff line change 1+ export * from './AboutScreen' ;
2+ export * from './ChangelogScreen' ;
3+ export * from './FaqScreen' ;
Original file line number Diff line number Diff line change @@ -150,6 +150,29 @@ export function SettingsScreen() {
150150 } ,
151151 ] ,
152152 } ,
153+ {
154+ title : 'Other' ,
155+ data : [
156+ {
157+ title : 'About the app' ,
158+ iconName : '' ,
159+ description : 'Learn more about the app' ,
160+ onPress : ( ) => navigate ( 'Other' , { screen : 'About' } ) ,
161+ } ,
162+ {
163+ title : 'Changelog' ,
164+ description : 'release notes' ,
165+ iconName : '' ,
166+ onPress : ( ) => navigate ( 'Other' , { screen : 'Changelog' } ) ,
167+ } ,
168+ {
169+ title : 'FAQ' ,
170+ description : 'Questions and answers' ,
171+ iconName : '' ,
172+ onPress : ( ) => navigate ( 'Other' , { screen : 'Faq' } ) ,
173+ } ,
174+ ] ,
175+ } ,
153176 ] ;
154177
155178 const bottomSheetSections : NavigationSectionListData = [
You can’t perform that action at this time.
0 commit comments