Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into marcos/fetch-reactions2
  • Loading branch information
Marcos Hernandez committed Apr 19, 2024
2 parents 05ec265 + 85549e7 commit 1901b68
Show file tree
Hide file tree
Showing 23 changed files with 507 additions and 203 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.
48 changes: 48 additions & 0 deletions package-lock.json

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

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@
"expo-status-bar": "~1.6.0",
"html-entities": "^2.4.0",
"react": "18.2.0",
"react-apple-emojis": "^2.2.1",
"react-native": "0.72.10",
"react-native-dom-parser": "^1.5.3",
"react-native-element-dropdown": "^2.10.0",
"react-native-elements": "^3.4.3",
"react-native-emoji": "^1.8.0",
"react-native-emojicon": "^1.0.0",
"react-native-gesture-handler": "~2.12.0",
"react-native-htmlview": "^0.16.0",
"react-native-ionicons": "^4.6.5",
Expand All @@ -65,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 @@ -133,6 +134,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 @@ -163,6 +165,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
3 changes: 3 additions & 0 deletions src/app/(tabs)/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,12 @@ function SettingsScreen() {
options={[
'American Indian/Alaska Native',
'Asian',
'Hispanic/Latinx',
'Middle Eastern',
'Black or African American',
'Native Hawaiian or other Pacific Islander',
'White',
'Not Listed Here',
'Prefer Not to Disclose',
]}
label="Race/Ethnicity"
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 @@ -89,7 +89,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 @@ -161,15 +166,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
16 changes: 16 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 @@ -219,9 +221,12 @@ function OnboardingScreen() {
options={[
'American Indian/Alaska Native',
'Asian',
'Hispanic/Latinx',
'Middle Eastern',
'Black or African American',
'Native Hawaiian or other Pacific Islander',
'White',
'Not Listed Here',
'Prefer Not to Disclose',
]}
label="Race/Ethnicity"
Expand All @@ -232,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 @@ -245,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 1901b68

Please sign in to comment.