Commit ea0e1421 authored by Peter Skaar Nordby's avatar Peter Skaar Nordby
Browse files

Initial commit

parent e82f78e8
......@@ -3,42 +3,28 @@ import React from 'react';
import { StyleSheet, TouchableOpacity } from 'react-native';
import Colors from '../constants/Colors';
import { UserEntity } from '../store/ducks/auth/types';
import { MonoText } from './StyledText';
import { Text, View } from './Themed';
export default function EditScreenInfo({ path }: { path: string }) {
export default function ProfileInfo({ user }: { user: UserEntity }) {
return (
<View>
<View style={styles.getStartedContainer}>
<Text
style={styles.getStartedText}
style={styles.profileName}
lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)">
Open up the code for this screen:
{user.username}
</Text>
<View
style={[styles.codeHighlightContainer, styles.homeScreenFilename]}
darkColor="rgba(255,255,255,0.05)"
lightColor="rgba(0,0,0,0.05)">
<MonoText>{path}</MonoText>
</View>
<Text
style={styles.getStartedText}
lightColor="rgba(0,0,0,0.8)"
darkColor="rgba(255,255,255,0.8)">
Change any of the text, save the file, and your app will automatically update.
{user.email}
</Text>
</View>
<View style={styles.helpContainer}>
<TouchableOpacity onPress={handleHelpPress} style={styles.helpLink}>
<Text style={styles.helpLinkText} lightColor={Colors.light.tint}>
Tap here if your app doesn't automatically update after making changes
</Text>
</TouchableOpacity>
</View>
</View>
);
}
......@@ -61,6 +47,11 @@ const styles = StyleSheet.create({
borderRadius: 3,
paddingHorizontal: 4,
},
profileName: {
fontSize: 20,
lineHeight: 24,
textAlign: 'center',
},
getStartedText: {
fontSize: 17,
lineHeight: 24,
......
......@@ -15,7 +15,7 @@ import useColorScheme from '../hooks/useColorScheme';
import ModalScreen from '../screens/ModalScreen';
import NotFoundScreen from '../screens/NotFoundScreen';
import TabOneScreen from '../screens/TabOneScreen';
import TabTwoScreen from '../screens/TabTwoScreen';
import Profile from '../screens/Profile';
import { RootStackParamList, RootTabParamList, RootTabScreenProps } from '../types';
import LinkingConfiguration from './LinkingConfiguration';
......@@ -85,10 +85,10 @@ function BottomTabNavigator() {
})}
/>
<BottomTab.Screen
name="TabTwo"
component={TabTwoScreen}
name="Profile"
component={Profile}
options={{
title: 'Tab Two',
title: 'Profile',
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
}}
/>
......
......@@ -2,7 +2,7 @@ import { StatusBar } from 'expo-status-bar';
import * as React from 'react';
import { Platform, StyleSheet } from 'react-native';
import EditScreenInfo from '../components/EditScreenInfo';
import ProfileInfo from '../components/ProfileInfo';
import { Text, View } from '../components/Themed';
export default function ModalScreen() {
......
import * as React from 'react';
import { StyleSheet } from 'react-native';
import { useSelector } from 'react-redux';
import EditScreenInfo from '../components/EditScreenInfo';
import ProfileInfo from '../components/ProfileInfo';
import { Text, View } from '../components/Themed';
import { AuthState } from '../store/ducks/auth/types';
import { ApplicationState } from '../store/interface';
export default function TabTwoScreen() {
const auth: AuthState = useSelector(({ auth }: ApplicationState) => auth);
export default function Profile() {
return (
<View style={styles.container}>
<Text style={styles.title}>Tab Two</Text>
<Text style={styles.title}>{user.username}</Text>
<View style={styles.separator} lightColor="#eee" darkColor="rgba(255,255,255,0.1)" />
<EditScreenInfo path="/screens/TabTwoScreen.tsx" />
<ProfileInfo user={user} />
</View>
);
}
......
import * as React from 'react';
import { StyleSheet } from 'react-native';
import EditScreenInfo from '../components/EditScreenInfo';
import ProfileInfo from '../components/ProfileInfo';
import { Text, View } from '../components/Themed';
import { RootTabScreenProps } from '../types';
......@@ -10,7 +10,6 @@ export default function TabOneScreen({ navigation }: RootTabScreenProps<'TabOne'
<View style={styles.container}>
<Text style={styles.title}>Tab One</Text>
<View style={styles.separator} lightColor="#eee" darkColor="rgba(255,255,255,0.1)" />
<EditScreenInfo path="/screens/TabOneScreen.tsx" />
</View>
);
}
......
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"jsx": "react",
"strict": true
}
}
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment