Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapawar1 committed Apr 18, 2024
1 parent ace4f89 commit 251df8a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/app/(tabs)/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ function HomeScreen() {
{featuredStories.length > 0 && (
<View>
<Text style={globalStyles.h3}>Featured Stories</Text>
{featuredStoriesDescription.length > 0 &&
{featuredStoriesDescription.length > 0 && (
<Text style={[globalStyles.body1, styles.featuredDescription]}>
{featuredStoriesDescription}
</Text>
}
)}
<View style={{ marginRight: 24, marginTop: 16 }}>
{featuredStories.map(story => (
<PreviewCard
Expand Down
24 changes: 14 additions & 10 deletions src/app/(tabs)/library/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ function LibraryScreen() {
</View>
</View>

<View style={{ width: "100%", flex: 1, marginBottom: 100 }}>
{favoritesSelected &&
<View style={{ width: '100%', flex: 1, marginBottom: 100 }}>
{favoritesSelected && (
<FlatList
data={favoriteStories}
renderItem={({ item }) => {
Expand All @@ -99,7 +99,9 @@ function LibraryScreen() {
author={item.author_name}
authorImage={item.author_image}
excerpt={item.excerpt}
tags={item.genre_medium.concat(item.tone).concat(item.topic)}
tags={item.genre_medium
.concat(item.tone)
.concat(item.topic)}
pressFunction={() =>
router.push({
pathname: '/story',
Expand All @@ -108,12 +110,12 @@ function LibraryScreen() {
}
/>
</View>
)
);
}}
/>
}
)}

{readingSelected &&
{readingSelected && (
<FlatList
data={readingListStories}
renderItem={({ item }) => {
Expand All @@ -128,7 +130,9 @@ function LibraryScreen() {
author={item.author_name}
authorImage={item.author_image}
excerpt={item.excerpt}
tags={item.genre_medium.concat(item.tone).concat(item.topic)}
tags={item.genre_medium
.concat(item.tone)
.concat(item.topic)}
pressFunction={() =>
router.push({
pathname: '/story',
Expand All @@ -137,12 +141,12 @@ function LibraryScreen() {
}
/>
</View>
)
);
}}
/>
}
)}
</View>
</View >
</View>
);
}

Expand Down
7 changes: 5 additions & 2 deletions src/components/PreviewCard/PreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type PreviewCardProps = {
storyId: number;
author: string;
authorImage: string;
defaultSavedStoriesState?: boolean
defaultSavedStoriesState?: boolean;
excerpt: { html: string };
tags: string[];
pressFunction: (event: GestureResponderEvent) => void;
Expand All @@ -48,7 +48,10 @@ function PreviewCard({
</Text>
<TouchableOpacity style={{ alignSelf: 'flex-end' }}>
<View>
<SaveStoryButton storyId={storyId} defaultState={defaultSavedStoriesState} />
<SaveStoryButton
storyId={storyId}
defaultState={defaultSavedStoriesState}
/>
</View>
</TouchableOpacity>
</View>
Expand Down
7 changes: 5 additions & 2 deletions src/components/SaveStoryButton/SaveStoryButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ import { TouchableOpacity } from 'react-native-gesture-handler';

type SaveStoryButtonProps = {
storyId: number;
defaultState?: boolean
defaultState?: boolean;
};

const saveStoryImage = require('../../../assets/save_story.png');
const savedStoryImage = require('../../../assets/saved_story.png');

export default function SaveStoryButton({ storyId, defaultState = false }: SaveStoryButtonProps) {
export default function SaveStoryButton({
storyId,
defaultState = false,
}: SaveStoryButtonProps) {
const { user } = useSession();
const [storyIsSaved, setStoryIsSaved] = useState(defaultState);
const { channels, initializeChannel, publish } = usePubSub();
Expand Down

0 comments on commit 251df8a

Please sign in to comment.