about summary refs log tree commit diff
path: root/src/view/screens/CustomFeed.tsx
diff options
context:
space:
mode:
authorAnsh Nanda <anshnanda10@gmail.com>2023-05-15 22:39:47 -0700
committerAnsh Nanda <anshnanda10@gmail.com>2023-05-15 22:39:47 -0700
commit8071ae313d7ad94bd051ba95a96b72f543576292 (patch)
treef26488f777316273916d5b878753e9947acc5132 /src/view/screens/CustomFeed.tsx
parentc4a666c2210c2e9c14812ddc5a0f797dd538014c (diff)
downloadvoidsky-8071ae313d7ad94bd051ba95a96b72f543576292.tar.zst
like/unlike improvements WIP
Diffstat (limited to 'src/view/screens/CustomFeed.tsx')
-rw-r--r--src/view/screens/CustomFeed.tsx14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/view/screens/CustomFeed.tsx b/src/view/screens/CustomFeed.tsx
index 070db8c07..be6261ac2 100644
--- a/src/view/screens/CustomFeed.tsx
+++ b/src/view/screens/CustomFeed.tsx
@@ -1,6 +1,6 @@
 import {NativeStackScreenProps} from '@react-navigation/native-stack'
 import {usePalette} from 'lib/hooks/usePalette'
-import {HeartIcon} from 'lib/icons'
+import {HeartIcon, HeartIconSolid} from 'lib/icons'
 import {CommonNavigatorParams} from 'lib/routes/types'
 import {colors, s} from 'lib/styles'
 import {observer} from 'mobx-react-lite'
@@ -74,13 +74,21 @@ export const CustomFeed = withAuthRequired(
               <TouchableOpacity
                 accessibilityRole="button"
                 onPress={() => {
-                  currentFeed?.like()
+                  if (currentFeed?.isLiked) {
+                    currentFeed?.unlike()
+                  } else {
+                    currentFeed?.like()
+                  }
                 }}
                 style={[styles.likeButton]}>
                 <Text style={[pal.text, s.semiBold]}>
                   {currentFeed?.data.likeCount}
                 </Text>
-                <HeartIcon strokeWidth={3} size={18} style={styles.liked} />
+                {currentFeed?.isLiked ? (
+                  <HeartIconSolid size={18} style={styles.liked} />
+                ) : (
+                  <HeartIcon strokeWidth={3} size={18} style={styles.liked} />
+                )}
               </TouchableOpacity>
             </View>
           </View>