diff --git a/src/app/(tabs)/library/index.tsx b/src/app/(tabs)/library/index.tsx index e8bc738..77069ec 100644 --- a/src/app/(tabs)/library/index.tsx +++ b/src/app/(tabs)/library/index.tsx @@ -84,7 +84,7 @@ function LibraryScreen() { - + {favoritesSelected && void; @@ -35,6 +36,7 @@ function PreviewCard({ authorImage, excerpt, tags, + defaultSavedStoriesState = false, pressFunction, }: PreviewCardProps) { return ( @@ -46,7 +48,7 @@ function PreviewCard({ - + diff --git a/src/components/SaveStoryButton/SaveStoryButton.tsx b/src/components/SaveStoryButton/SaveStoryButton.tsx index c4d4331..e1dd720 100644 --- a/src/components/SaveStoryButton/SaveStoryButton.tsx +++ b/src/components/SaveStoryButton/SaveStoryButton.tsx @@ -11,14 +11,15 @@ import { TouchableOpacity } from 'react-native-gesture-handler'; type SaveStoryButtonProps = { storyId: number; + defaultState?: boolean }; const saveStoryImage = require('../../../assets/save_story.png'); const savedStoryImage = require('../../../assets/saved_story.png'); -export default function SaveStoryButton({ storyId }: SaveStoryButtonProps) { +export default function SaveStoryButton({ storyId, defaultState = false }: SaveStoryButtonProps) { const { user } = useSession(); - const [storyIsSaved, setStoryIsSaved] = useState(false); + const [storyIsSaved, setStoryIsSaved] = useState(defaultState); const { channels, initializeChannel, publish } = usePubSub(); useEffect(() => {