Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kylezryr committed Mar 16, 2024
1 parent 7f3aef2 commit 5f856f2
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 7 deletions.
5 changes: 0 additions & 5 deletions src/app/(tabs)/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ function HomeScreen() {
<Text style={globalStyles.h2}>
{username ? `Welcome, ${username}` : 'Welcome!'}
</Text>
<Pressable onPress={() => router.push('/settings')}>
<View>
<Icon type="settings_gear" />
</View>
</Pressable>
</View>
{featuredStories.length > 0 && (
<View>
Expand Down
2 changes: 2 additions & 0 deletions src/app/(tabs)/library/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ function StackLayout() {
return (
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="favoritesList" options={{ headerShown: false }} />
<Stack.Screen name="readingList" options={{ headerShown: false }} />
</Stack>
);
}
Expand Down
11 changes: 11 additions & 0 deletions src/app/(tabs)/library/favoritesList/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Stack } from 'expo-router';

function StackLayout() {
return (
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
</Stack>
);
}

export default StackLayout;
Empty file.
5 changes: 5 additions & 0 deletions src/app/(tabs)/library/favoritesList/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { StyleSheet } from 'react-native';

const styles = StyleSheet.create({});

export default styles;
7 changes: 5 additions & 2 deletions src/app/(tabs)/library/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { Text } from 'react-native';
import { Text, View } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';

import globalStyles from '../../../styles/globalStyles';
import LibraryHeader from '../../../components/LibraryHeader/LibraryHeader';

function LibraryScreen() {
return (
<SafeAreaView style={globalStyles.container}>
<Text style={globalStyles.h1}>Library</Text>
<View style={{ flex: 1 }}>
<LibraryHeader />
</View>
</SafeAreaView>
);
}
Expand Down
11 changes: 11 additions & 0 deletions src/app/(tabs)/library/readingList/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Stack } from 'expo-router';

function StackLayout() {
return (
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
</Stack>
);
}

export default StackLayout;
Empty file.
5 changes: 5 additions & 0 deletions src/app/(tabs)/library/readingList/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { StyleSheet } from 'react-native';

const styles = StyleSheet.create({});

export default styles;
47 changes: 47 additions & 0 deletions src/components/LibraryHeader/LibraryHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { View, Text, Image, Pressable } from 'react-native';
import { router } from 'expo-router';
import { useEffect, useState } from 'react';
import Icon from '../../../assets/icons';

import styles from './styles';
import globalStyles from '../../styles/globalStyles';
import colors from '../../styles/colors';
import { useSession } from '../../utils/AuthContext';

export default function LibraryHeader() {
const { user } = useSession();
const [username, setUsername] = useState('');

return (
<View style={styles.container}>
<View style={styles.horizontal}>
<View style={styles.textContainer}>
<Image
style={styles.image}
source={require('../../../assets/logo.png')}
/>
<View style={styles.username}>
<Text style={globalStyles.h1}>
{' '}
{user?.user_metadata.username}{' '}
</Text>
</View>
</View>

<View>
<Pressable onPress={() => router.push('/settings')}>
<View>
<Icon type="settings_gear" />
</View>
</Pressable>
</View>
</View>

<View style={{ flex: 1 }}>
<Pressable>
<Text>favorites</Text>
</Pressable>
</View>
</View>
);
}
31 changes: 31 additions & 0 deletions src/components/LibraryHeader/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { StyleSheet } from 'react-native';
import colors from '../../styles/colors';

const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'column',
marginLeft: 0,
paddingRight: 0,
},
image: {
height: 51,
width: 51,
borderRadius: 4,
marginBottom: 12,
},
textContainer: {
flexDirection: 'row',
},
username: {
paddingLeft: 12,
},
horizontal: {
flex: 1,
flexGrow: 1,
flexDirection: 'row',
justifyContent: 'space-between',
},
});

export default styles;

0 comments on commit 5f856f2

Please sign in to comment.