From 1fbc4cf1f2279cf4cf6804ff02616515e82d2a38 Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Tue, 8 Nov 2022 12:14:51 -0600
Subject: Finish the upvote/downvote implementation

---
 src/view/com/post-thread/PostLikedBy.tsx | 117 -------------------------------
 1 file changed, 117 deletions(-)
 delete mode 100644 src/view/com/post-thread/PostLikedBy.tsx

(limited to 'src/view/com/post-thread/PostLikedBy.tsx')

diff --git a/src/view/com/post-thread/PostLikedBy.tsx b/src/view/com/post-thread/PostLikedBy.tsx
deleted file mode 100644
index 87829955e..000000000
--- a/src/view/com/post-thread/PostLikedBy.tsx
+++ /dev/null
@@ -1,117 +0,0 @@
-import React, {useState, useEffect} from 'react'
-import {observer} from 'mobx-react-lite'
-import {ActivityIndicator, FlatList, StyleSheet, Text, View} from 'react-native'
-import {
-  LikedByViewModel,
-  LikedByViewItemModel,
-} from '../../../state/models/liked-by-view'
-import {Link} from '../util/Link'
-import {UserAvatar} from '../util/UserAvatar'
-import {useStores} from '../../../state'
-import {s, colors} from '../../lib/styles'
-
-export const PostLikedBy = observer(function PostLikedBy({uri}: {uri: string}) {
-  const store = useStores()
-  const [view, setView] = useState<LikedByViewModel | undefined>()
-
-  useEffect(() => {
-    if (view?.params.uri === uri) {
-      console.log('Liked by doing nothing')
-      return // no change needed? or trigger refresh?
-    }
-    console.log('Fetching Liked by', uri)
-    const newView = new LikedByViewModel(store, {uri})
-    setView(newView)
-    newView.setup().catch(err => console.error('Failed to fetch liked by', err))
-  }, [uri, view?.params.uri, store])
-
-  // loading
-  // =
-  if (
-    !view ||
-    (view.isLoading && !view.isRefreshing) ||
-    view.params.uri !== uri
-  ) {
-    return (
-      <View>
-        <ActivityIndicator />
-      </View>
-    )
-  }
-
-  // error
-  // =
-  if (view.hasError) {
-    return (
-      <View>
-        <Text>{view.error}</Text>
-      </View>
-    )
-  }
-
-  // loaded
-  // =
-  const renderItem = ({item}: {item: LikedByViewItemModel}) => (
-    <LikedByItem item={item} />
-  )
-  return (
-    <View>
-      <FlatList
-        data={view.likedBy}
-        keyExtractor={item => item._reactKey}
-        renderItem={renderItem}
-      />
-    </View>
-  )
-})
-
-const LikedByItem = ({item}: {item: LikedByViewItemModel}) => {
-  return (
-    <Link
-      style={styles.outer}
-      href={`/profile/${item.handle}`}
-      title={item.handle}>
-      <View style={styles.layout}>
-        <View style={styles.layoutAvi}>
-          <UserAvatar
-            size={40}
-            displayName={item.displayName}
-            handle={item.handle}
-          />
-        </View>
-        <View style={styles.layoutContent}>
-          <Text style={[s.f15, s.bold]}>{item.displayName}</Text>
-          <Text style={[s.f14, s.gray5]}>@{item.handle}</Text>
-        </View>
-      </View>
-    </Link>
-  )
-}
-
-const styles = StyleSheet.create({
-  outer: {
-    marginTop: 1,
-    backgroundColor: colors.white,
-  },
-  layout: {
-    flexDirection: 'row',
-  },
-  layoutAvi: {
-    width: 60,
-    paddingLeft: 10,
-    paddingTop: 10,
-    paddingBottom: 10,
-  },
-  avi: {
-    width: 40,
-    height: 40,
-    borderRadius: 20,
-    resizeMode: 'cover',
-  },
-  layoutContent: {
-    flex: 1,
-    paddingRight: 10,
-    paddingTop: 10,
-    paddingBottom: 10,
-  },
-})
-- 
cgit 1.4.1

