Skip to content

Commit

Permalink
Merge branch 'main' into justin/back-button-component
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 committed Apr 21, 2024
2 parents e45382d + 85549e7 commit 6fe83f9
Show file tree
Hide file tree
Showing 22 changed files with 379 additions and 170 deletions.
File renamed without changes
Binary file added assets/saved_story.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"react-native-vector-icons": "^10.0.2",
"react-scroll-to-top": "^3.0.0",
"use-debounce": "^10.0.0",
"validator": "^13.11.0"
"validator": "^13.11.0",
"expo-image": "~1.3.5"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
1 change: 1 addition & 0 deletions src/app/(tabs)/author/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ function AuthorScreen() {
{authorStoryPreview?.map(story => (
<PreviewCard
key={story.title}
storyId={story.id}
title={story.title}
image={story.featured_media}
author={story.author_name}
Expand Down
1 change: 1 addition & 0 deletions src/app/(tabs)/genre/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ function GenreScreen() {
renderItem={({ item }) => (
<PreviewCard
key={item.id}
storyId={item.id}
tags={item.genre_medium.concat(item.tone).concat(item.topic)}
author={item.author_name}
image={item.featured_media}
Expand Down
3 changes: 3 additions & 0 deletions src/app/(tabs)/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ function HomeScreen() {
{featuredStories.map(story => (
<PreviewCard
key={story.id}
storyId={story.id}
title={story.title}
image={story.featured_media}
author={story.author_name}
Expand Down Expand Up @@ -132,6 +133,7 @@ function HomeScreen() {
title={story.title}
author={story.author_name}
authorImage={story.author_image}
storyId={story.id}
pressFunction={() =>
router.push({
pathname: '/story',
Expand Down Expand Up @@ -161,6 +163,7 @@ function HomeScreen() {
title={story.title}
author={story.author_name}
authorImage={story.author_image}
storyId={story.id}
pressFunction={() =>
router.push({
pathname: '/story',
Expand Down
4 changes: 3 additions & 1 deletion src/app/(tabs)/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ function SearchScreen() {
{recentlyViewed.map(item => (
<PreviewCard
key={item.title}
storyId={item.id}
title={item.title}
image={item.featured_media}
author={item.author_name}
Expand Down Expand Up @@ -395,7 +396,8 @@ function SearchScreen() {
contentContainerStyle={styles.contentCotainerStories}
renderItem={({ item }) => (
<PreviewCard
key={item.title}
key={item.id}
storyId={item.id}
title={item.title}
image={item.featured_media}
author={item.author_name}
Expand Down
39 changes: 29 additions & 10 deletions src/app/(tabs)/story/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ function StoryScreen() {
style={styles.authorImage}
source={{ uri: story.author_image ? story.author_image : '' }}
/>
<Text style={globalStyles.subHeading1Bold}>
<Text
style={[
globalStyles.subHeading1Bold,
{ textDecorationLine: 'underline' },
]}
>
By {story.author_name}
</Text>
</View>
Expand Down Expand Up @@ -164,15 +169,29 @@ function StoryScreen() {
systemFonts={fonts}
/>

<View style={styles.author}>
<Image
style={styles.authorImage}
source={{ uri: story.author_image }}
/>
<Text style={globalStyles.subHeading1Bold}>
By {story.author_name}
</Text>
</View>
<TouchableOpacity
onPress={() => {
router.push({
pathname: '/author',
params: { author: story.author_id.toString() },
});
}}
>
<View style={styles.author}>
<Image
style={styles.authorImage}
source={{ uri: story.author_image ? story.author_image : '' }}
/>
<Text
style={[
globalStyles.subHeading1Bold,
{ textDecorationLine: 'underline' },
]}
>
By {story.author_name}
</Text>
</View>
</TouchableOpacity>

<Button
textColor="black"
Expand Down
13 changes: 8 additions & 5 deletions src/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ import { Stack } from 'expo-router';
import { SafeAreaProvider } from 'react-native-safe-area-context';

import { AuthContextProvider } from '../utils/AuthContext';
import { BooleanPubSubProvider } from '../utils/PubSubContext';
import ToastComponent from '../components/Toast/Toast';
import { Keyboard, TouchableWithoutFeedback } from 'react-native';

function StackLayout() {
return (
<SafeAreaProvider>
<AuthContextProvider>
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="auth" options={{ headerShown: false }} />
</Stack>
<BooleanPubSubProvider>
<Stack>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
<Stack.Screen name="auth" options={{ headerShown: false }} />
</Stack>
</BooleanPubSubProvider>
</AuthContextProvider>
<ToastComponent />
</SafeAreaProvider>
Expand Down
13 changes: 13 additions & 0 deletions src/app/auth/onboarding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function OnboardingScreen() {
const [pronouns, setPronouns] = useState('');
const [birthday, setBirthday] = useState('');
const [birthdayExists, setBirthdayExists] = useState(false);
const [birthdayChanged, setBirthdayChanged] = useState(false);
const [gender, setGender] = useState('');
const [raceEthnicity, setRaceEthnicity] = useState('');
const [showDatePicker, setShowDatePicker] = useState(false);
Expand Down Expand Up @@ -142,6 +143,7 @@ function OnboardingScreen() {
};

const onConfirmDate = (date: Date) => {
setBirthdayChanged(true);
setShowDatePicker(false);
setBirthday(date.toLocaleDateString());
setDisplayDate(date);
Expand Down Expand Up @@ -235,6 +237,16 @@ function OnboardingScreen() {
</View>

<View>
{birthdayChanged && (
<View style={[styles.info, styles.warning]}>
<Icon type="material" name="info-outline" color="#797979" />
<Text style={[globalStyles.subtext, styles.subtext]}>
You can only input your birthday once. Please make sure the date
is correct before saving as you will not be able to change your
birthday in the future.
</Text>
</View>
)}
<View style={styles.updateProfileButton}>
<StyledButton
text="Update profile"
Expand All @@ -248,6 +260,7 @@ function OnboardingScreen() {
}
/>
</View>

<Link
style={[globalStyles.bodyBoldUnderline, styles.skipButton]}
href="/(tabs)/home"
Expand Down
4 changes: 4 additions & 0 deletions src/app/auth/onboarding/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export default StyleSheet.create({
body1: {
marginTop: 26,
},
warning: {
marginTop: 40,
marginBottom: 24,
},
info: {
flexDirection: 'row',
marginTop: 12,
Expand Down
Loading

0 comments on commit 6fe83f9

Please sign in to comment.