From 798622b307220a8634a911afabea3864a812aa64 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 17 Jan 2023 12:35:47 -0600 Subject: [PATCH] Refer to upvotes as 'likes' in the UI (will change in the protocol soon) --- src/view/com/notifications/FeedItem.tsx | 12 +++--- src/view/com/post-thread/PostThreadItem.tsx | 4 +- src/view/com/util/LoadingPlaceholder.tsx | 4 +- src/view/com/util/PostCtrls.tsx | 22 +++++++---- src/view/lib/icons.tsx | 42 +++++++++++++++++++++ src/view/routes.ts | 2 +- src/view/screens/PostUpvotedBy.tsx | 4 +- 7 files changed, 69 insertions(+), 21 deletions(-) diff --git a/src/view/com/notifications/FeedItem.tsx b/src/view/com/notifications/FeedItem.tsx index ca3f3c57..c374b144 100644 --- a/src/view/com/notifications/FeedItem.tsx +++ b/src/view/com/notifications/FeedItem.tsx @@ -8,7 +8,7 @@ import {NotificationsViewItemModel} from '../../../state/models/notifications-vi import {PostThreadViewModel} from '../../../state/models/post-thread-view' import {s, colors} from '../../lib/styles' import {ago, pluralize} from '../../../lib/strings' -import {UpIconSolid} from '../../lib/icons' +import {HeartIconSolid} from '../../lib/icons' import {Text} from '../util/text/Text' import {UserAvatar} from '../util/UserAvatar' import {ImageHorzList} from '../util/images/ImageHorzList' @@ -72,11 +72,11 @@ export const FeedItem = observer(function FeedItem({ } let action = '' - let icon: Props['icon'] | 'UpIconSolid' + let icon: Props['icon'] | 'HeartIconSolid' let iconStyle: Props['style'] = [] if (item.isUpvote) { - action = 'upvoted your post' - icon = 'UpIconSolid' + action = 'liked your post' + icon = 'HeartIconSolid' iconStyle = [s.red3, {position: 'relative', top: -4}] } else if (item.isRepost) { action = 'reposted your post' @@ -132,8 +132,8 @@ export const FeedItem = observer(function FeedItem({ noFeedback> - {icon === 'UpIconSolid' ? ( - + {icon === 'HeartIconSolid' ? ( + ) : ( { const urip = new AtUri(item.post.uri) return `/profile/${item.post.author.handle}/post/${urip.rkey}/reposted-by` @@ -209,7 +209,7 @@ export const PostThreadItem = observer(function PostThreadItem({ {item.post.upvoteCount} {' '} - {pluralize(item.post.upvoteCount, 'upvote')} + {pluralize(item.post.upvoteCount, 'like')} ) : ( diff --git a/src/view/com/util/LoadingPlaceholder.tsx b/src/view/com/util/LoadingPlaceholder.tsx index 76e3c495..587e2928 100644 --- a/src/view/com/util/LoadingPlaceholder.tsx +++ b/src/view/com/util/LoadingPlaceholder.tsx @@ -1,7 +1,7 @@ import React from 'react' import {StyleSheet, StyleProp, View, ViewStyle} from 'react-native' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' -import {UpIcon} from '../../lib/icons' +import {HeartIcon} from '../../lib/icons' import {s} from '../../lib/styles' import {useTheme} from '../../lib/ThemeContext' import {usePalette} from '../../lib/hooks/usePalette' @@ -70,7 +70,7 @@ export function PostLoadingPlaceholder({ /> - @@ -167,15 +170,18 @@ export function PostCtrls(opts: PostCtrlsOpts) { onPress={onPressToggleUpvoteWrapper}> {opts.isUpvoted ? ( - ) : ( - )} diff --git a/src/view/lib/icons.tsx b/src/view/lib/icons.tsx index b061f308..e972a79d 100644 --- a/src/view/lib/icons.tsx +++ b/src/view/lib/icons.tsx @@ -225,6 +225,48 @@ export function UserGroupIcon({ ) } +// Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. +export function HeartIcon({ + style, + size = 24, + strokeWidth = 1.5, +}: { + style?: StyleProp + size?: string | number + strokeWidth: number +}) { + return ( + + + + ) +} + +// Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. +export function HeartIconSolid({ + style, + size = 24, +}: { + style?: StyleProp + size?: string | number +}) { + return ( + + + + ) +} + export function UpIcon({ style, size, diff --git a/src/view/routes.ts b/src/view/routes.ts index 7d5a06ac..908036a4 100644 --- a/src/view/routes.ts +++ b/src/view/routes.ts @@ -55,7 +55,7 @@ export const routes: Route[] = [ ], [ PostUpvotedBy, - 'Upvoted by', + 'Liked by', 'heart', r('/profile/(?[^/]+)/post/(?[^/]+)/upvoted-by'), ], diff --git a/src/view/screens/PostUpvotedBy.tsx b/src/view/screens/PostUpvotedBy.tsx index 2794d529..7379b852 100644 --- a/src/view/screens/PostUpvotedBy.tsx +++ b/src/view/screens/PostUpvotedBy.tsx @@ -13,13 +13,13 @@ export const PostUpvotedBy = ({navIdx, visible, params}: ScreenParams) => { useEffect(() => { if (visible) { - store.nav.setTitle(navIdx, 'Upvoted by') + store.nav.setTitle(navIdx, 'Liked by') } }, [store, visible]) return ( - + )