@@ -53,37 +53,26 @@ function PreviewCard({
53
53
const { channels, initializeChannel, publish } = usePubSub ( ) ;
54
54
55
55
const savedStoryImageComponent = useMemo ( ( ) => {
56
- return (
57
- < Image
58
- style = { { width : 30 , height : 30 } }
59
- source = { savedStoryImage }
60
- />
61
- )
62
- } , [ ] )
56
+ return < Image style = { { width : 30 , height : 30 } } source = { savedStoryImage } /> ;
57
+ } , [ ] ) ;
63
58
const saveStoryImageComponent = useMemo ( ( ) => {
64
- return (
65
- < Image
66
- style = { { width : 30 , height : 30 } }
67
- source = { saveStoryImage }
68
- />
69
- )
70
- } , [ ] )
59
+ return < Image style = { { width : 30 , height : 30 } } source = { saveStoryImage } /> ;
60
+ } , [ ] ) ;
71
61
72
62
useEffect ( ( ) => {
73
63
isStoryInReadingList ( storyId , user ?. id ) . then ( storyInReadingList => {
74
- setStoryIsSaved ( storyInReadingList )
64
+ setStoryIsSaved ( storyInReadingList ) ;
75
65
initializeChannel ( storyId ) ;
76
66
} ) ;
77
67
} , [ storyId ] ) ;
78
68
79
69
useEffect ( ( ) => {
80
70
// if another card updates this story, update it here also
81
- if ( typeof channels [ storyId ] !== " undefined" ) {
82
- setStoryIsSaved ( channels [ storyId ] )
71
+ if ( typeof channels [ storyId ] !== ' undefined' ) {
72
+ setStoryIsSaved ( channels [ storyId ] ) ;
83
73
}
84
74
} , [ channels [ storyId ] ] ) ;
85
75
86
-
87
76
useEffect ( ( ) => {
88
77
isStoryInReadingList ( storyId , user ?. id ) . then ( storyInReadingList =>
89
78
setStoryIsSaved ( storyInReadingList ) ,
@@ -108,9 +97,7 @@ function PreviewCard({
108
97
{ title }
109
98
</ Text >
110
99
< TouchableOpacity onPress = { ( ) => saveStory ( ! storyIsSaved ) } >
111
- { storyIsSaved ?
112
- savedStoryImageComponent : saveStoryImageComponent
113
- }
100
+ { storyIsSaved ? savedStoryImageComponent : saveStoryImageComponent }
114
101
</ TouchableOpacity >
115
102
</ View >
116
103
< View style = { styles . body } >
0 commit comments