diff --git a/packages/mobile/src/components/feed-tip-tile/FeedTipTile.tsx b/packages/mobile/src/components/feed-tip-tile/FeedTipTile.tsx index c67e3d95ea..9eebcaa9ca 100644 --- a/packages/mobile/src/components/feed-tip-tile/FeedTipTile.tsx +++ b/packages/mobile/src/components/feed-tip-tile/FeedTipTile.tsx @@ -1,7 +1,6 @@ import { useCallback, useEffect } from 'react' import type { User } from '@audius/common' -import { FeatureFlags } from '@audius/common' import { getAccountUser } from 'audius-client/src/common/store/account/selectors' import { getUsers } from 'audius-client/src/common/store/cache/users/selectors' import { @@ -14,7 +13,6 @@ import { View } from 'react-native' import IconRemove from 'app/assets/images/iconRemove.svg' import { Tile } from 'app/components/core' import { useDispatchWeb } from 'app/hooks/useDispatchWeb' -import { useFeatureFlag } from 'app/hooks/useRemoteConfig' import { useSelectorWeb } from 'app/hooks/useSelectorWeb' import { MessageType } from 'app/message/types' import { @@ -72,9 +70,6 @@ export const FeedTipTile = () => { const usersMap = useSelectorWeb((state) => getUsers(state, { ids: tipToDisplay ? tipperIds : [] }) ) - const { isEnabled: isTippingEnabled } = useFeatureFlag( - FeatureFlags.TIPPING_ENABLED - ) useEffect(() => { const fetchRecentTipsAsync = async () => { @@ -102,7 +97,7 @@ export const FeedTipTile = () => { } }, [dispatchWeb, account, tipToDisplay]) - if (!isTippingEnabled || !showTip) { + if (!showTip) { return null } diff --git a/packages/mobile/src/screens/profile-screen/ExpandableBio.tsx b/packages/mobile/src/screens/profile-screen/ExpandableBio.tsx deleted file mode 100644 index ecc4425c89..0000000000 --- a/packages/mobile/src/screens/profile-screen/ExpandableBio.tsx +++ /dev/null @@ -1,127 +0,0 @@ -import { useCallback, useEffect, useState } from 'react' - -import type { LayoutChangeEvent } from 'react-native' -import { Pressable, View, Text, LayoutAnimation } from 'react-native' -import { useToggle } from 'react-use' - -import { Hyperlink } from 'app/components/core' -import { makeStyles } from 'app/styles/makeStyles' - -import { Sites } from './Sites' -import { useSelectProfile } from './selectors' -import { squashNewLines } from './utils' - -const messages = { - showMore: 'show more', - showLess: 'show less' -} - -const useStyles = makeStyles(({ palette, typography, spacing }) => ({ - root: { - marginTop: spacing(3) - }, - bioContainer: { - overflow: 'hidden' - }, - bioText: { - ...typography.body, - color: palette.neutralLight2 - }, - expandButton: { - // Flex start so the bounding box around the button is not full-width - alignSelf: 'flex-start', - marginTop: spacing(2) - }, - expandText: { - ...typography.h4, - color: palette.primary, - textTransform: 'capitalize' - } -})) - -export const ExpandableBio = () => { - const { bio, website, donation } = useSelectProfile([ - 'bio', - 'website', - 'donation' - ]) - const styles = useStyles() - const [fullBioHeight, setFullBioHeight] = useState(0) - const hasSites = Boolean(website || donation) - const [shouldShowMore, setShouldShowMore] = useState(hasSites) - const [isHeightCalculationDone, setIsHeightCalculationDone] = useState(false) - const [isExpanded, setIsExpanded] = useToggle(false) - - const handleBioLayout = useCallback( - (event: LayoutChangeEvent) => { - const { height } = event.nativeEvent.layout - - if (!fullBioHeight) { - setFullBioHeight(height) - } else { - if (fullBioHeight > height) { - setShouldShowMore(true) - } - setIsHeightCalculationDone(true) - } - }, - [fullBioHeight] - ) - - const handleToggleExpanded = useCallback(() => { - LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut) - setIsExpanded(!isExpanded) - }, [isExpanded, setIsExpanded]) - - /* - * hasSites isn't always correct on first render, this effect waits for - * a potential change - */ - useEffect(() => { - if (hasSites) { - setShouldShowMore(true) - } - }, [hasSites]) - - if (!bio && !hasSites) return null - - return ( - - - {bio ? ( - - {!isHeightCalculationDone || (shouldShowMore && !isExpanded) ? ( - - {squashNewLines(bio)} - - ) : ( - - )} - - ) : null} - {hasSites && isExpanded ? : null} - - {shouldShowMore ? ( - - - {isExpanded ? messages.showLess : messages.showMore} - - - ) : null} - - ) -} diff --git a/packages/mobile/src/screens/profile-screen/ProfileBadge.tsx b/packages/mobile/src/screens/profile-screen/ProfileBadge.tsx deleted file mode 100644 index ecfb3e73ad..0000000000 --- a/packages/mobile/src/screens/profile-screen/ProfileBadge.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import { useCallback } from 'react' - -import { setVisibility } from 'audius-client/src/common/store/ui/modals/slice' -import { View, Text } from 'react-native' - -import { IconAudioBadge, TierText } from 'app/components/audio-rewards' -import { MODAL_NAME } from 'app/components/audio-rewards/TiersExplainerDrawer' -import { Tile } from 'app/components/core' -import { useDispatchWeb } from 'app/hooks/useDispatchWeb' -import { useSelectTierInfo } from 'app/hooks/useSelectTierInfo' -import { makeStyles } from 'app/styles/makeStyles' - -import { useSelectProfile } from './selectors' - -const messages = { - tier: 'tier' -} - -const useStyles = makeStyles(({ spacing, typography, palette }) => ({ - root: { - width: 200, - marginRight: spacing(8) - }, - content: { - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', - paddingVertical: spacing(1) - }, - badge: { - marginRight: spacing(3) - }, - tierNumber: { - fontSize: 16, - fontFamily: typography.fontByWeight.bold, - textTransform: 'uppercase', - color: palette.neutralLight6 - }, - tierText: { - fontSize: 22, - fontFamily: typography.fontByWeight.heavy, - textTransform: 'uppercase' - } -})) - -export const ProfileBadge = () => { - const profile = useSelectProfile(['user_id']) - const styles = useStyles() - - const { tier, tierNumber } = useSelectTierInfo(profile.user_id) - - const dispatchWeb = useDispatchWeb() - - const handlePress = useCallback(() => { - dispatchWeb(setVisibility({ modal: MODAL_NAME, visible: true })) - }, [dispatchWeb]) - - if (tier === 'none') return null - - return ( - - - - - {messages.tier} {tierNumber} - - - {tier} - - - - ) -} diff --git a/packages/mobile/src/screens/profile-screen/ProfileHeader.tsx b/packages/mobile/src/screens/profile-screen/ProfileHeader.tsx deleted file mode 100644 index 6c1fbc21ca..0000000000 --- a/packages/mobile/src/screens/profile-screen/ProfileHeader.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { useCallback } from 'react' - -import { getUserId } from 'audius-client/src/common/store/account/selectors' -import type { Animated } from 'react-native' -import { LayoutAnimation, View } from 'react-native' -import { useToggle } from 'react-use' - -import { useSelectorWeb } from 'app/hooks/useSelectorWeb' -import { makeStyles } from 'app/styles' - -import { ArtistRecommendations } from './ArtistRecommendations' -import { CoverPhoto } from './CoverPhoto' -import { ExpandableBio } from './ExpandableBio' -import { ProfileInfo } from './ProfileInfo' -import { ProfileMetrics } from './ProfileMetrics' -import { ProfilePicture } from './ProfilePicture' -import { ProfileSocials } from './ProfileSocials' -import { UploadTrackButton } from './UploadTrackButton' -import { useSelectProfileRoot } from './selectors' - -const useStyles = makeStyles(({ palette, spacing }) => ({ - header: { - backgroundColor: palette.neutralLight10, - paddingTop: spacing(8), - paddingHorizontal: spacing(3), - paddingBottom: spacing(3) - }, - profilePicture: { - position: 'absolute', - top: 37, - left: 11, - zIndex: 100 - } -})) - -type ProfileHeaderProps = { - scrollY: Animated.Value -} - -export const ProfileHeader = (props: ProfileHeaderProps) => { - const { scrollY } = props - const styles = useStyles() - const profile = useSelectProfileRoot(['user_id', 'does_current_user_follow']) - const accountId = useSelectorWeb(getUserId) - const isOwner = profile?.user_id === accountId - const [hasUserFollowed, setHasUserFollowed] = useToggle(false) - - const handleFollow = useCallback(() => { - if (!profile?.does_current_user_follow) { - LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut) - setHasUserFollowed(true) - } - }, [setHasUserFollowed, profile]) - - const handleCloseArtistRecs = useCallback(() => { - LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut) - setHasUserFollowed(false) - }, [setHasUserFollowed]) - - return ( - // Box-none gets us scrolling on the non-touchable parts of the header - // See scroll on header documentation: - // https://github.com/PedroBern/react-native-collapsible-tab-view/tree/v2#scroll-on-header - // And also known drawbacks: - // https://github.com/PedroBern/react-native-collapsible-tab-view/pull/30 - <> - - - - - - - - {!hasUserFollowed ? null : ( - - )} - {isOwner ? : null} - - - ) -} diff --git a/packages/mobile/src/screens/profile-screen/ProfileHeaderV2/Bio.tsx b/packages/mobile/src/screens/profile-screen/ProfileHeader/Bio.tsx similarity index 100% rename from packages/mobile/src/screens/profile-screen/ProfileHeaderV2/Bio.tsx rename to packages/mobile/src/screens/profile-screen/ProfileHeader/Bio.tsx diff --git a/packages/mobile/src/screens/profile-screen/ProfileHeaderV2/CollapsedSection.tsx b/packages/mobile/src/screens/profile-screen/ProfileHeader/CollapsedSection.tsx similarity index 100% rename from packages/mobile/src/screens/profile-screen/ProfileHeaderV2/CollapsedSection.tsx rename to packages/mobile/src/screens/profile-screen/ProfileHeader/CollapsedSection.tsx diff --git a/packages/mobile/src/screens/profile-screen/ProfileHeaderV2/ExpandHeaderToggleButton.tsx b/packages/mobile/src/screens/profile-screen/ProfileHeader/ExpandHeaderToggleButton.tsx similarity index 100% rename from packages/mobile/src/screens/profile-screen/ProfileHeaderV2/ExpandHeaderToggleButton.tsx rename to packages/mobile/src/screens/profile-screen/ProfileHeader/ExpandHeaderToggleButton.tsx diff --git a/packages/mobile/src/screens/profile-screen/ProfileHeaderV2/ExpandedSection.tsx b/packages/mobile/src/screens/profile-screen/ProfileHeader/ExpandedSection.tsx similarity index 86% rename from packages/mobile/src/screens/profile-screen/ProfileHeaderV2/ExpandedSection.tsx rename to packages/mobile/src/screens/profile-screen/ProfileHeader/ExpandedSection.tsx index 3de15baa77..e9519d64b0 100644 --- a/packages/mobile/src/screens/profile-screen/ProfileHeaderV2/ExpandedSection.tsx +++ b/packages/mobile/src/screens/profile-screen/ProfileHeader/ExpandedSection.tsx @@ -56,7 +56,13 @@ const SupportingSectionTitle = () => { } export const ExpandedSection = () => { - const { supporting_count, user_id } = useSelectProfile(['supporting_count']) + const { supporting_count, user_id, current_user_followee_follow_count } = + useSelectProfile([ + 'supporting_count', + 'user_id', + + 'current_user_followee_follow_count' + ]) const accountId = useSelectorWeb(getUserId) const isOwner = user_id === accountId @@ -66,7 +72,9 @@ export const ExpandedSection = () => { - {isOwner ? null : } + {isOwner || current_user_followee_follow_count === 0 ? null : ( + + )} {supporting_count > 0 ? ( <> diff --git a/packages/mobile/src/screens/profile-screen/ProfileHeaderV2/ProfileHeaderV2.tsx b/packages/mobile/src/screens/profile-screen/ProfileHeader/ProfileHeader.tsx similarity index 97% rename from packages/mobile/src/screens/profile-screen/ProfileHeaderV2/ProfileHeaderV2.tsx rename to packages/mobile/src/screens/profile-screen/ProfileHeader/ProfileHeader.tsx index 93172f9320..06f9328917 100644 --- a/packages/mobile/src/screens/profile-screen/ProfileHeaderV2/ProfileHeaderV2.tsx +++ b/packages/mobile/src/screens/profile-screen/ProfileHeader/ProfileHeader.tsx @@ -39,11 +39,11 @@ const useStyles = makeStyles(({ palette, spacing }) => ({ bottomDivider: { marginTop: spacing(2), marginHorizontal: -12 } })) -type ProfileHeaderV2Props = { +type ProfileHeaderProps = { scrollY: Animated.Value } -export const ProfileHeaderV2 = (props: ProfileHeaderV2Props) => { +export const ProfileHeader = (props: ProfileHeaderProps) => { const { scrollY } = props const styles = useStyles() const profile = useSelectProfileRoot(['user_id', 'does_current_user_follow']) diff --git a/packages/mobile/src/screens/profile-screen/ProfileHeaderV2/ProfileMutualsButton.tsx b/packages/mobile/src/screens/profile-screen/ProfileHeader/ProfileMutualsButton.tsx similarity index 94% rename from packages/mobile/src/screens/profile-screen/ProfileHeaderV2/ProfileMutualsButton.tsx rename to packages/mobile/src/screens/profile-screen/ProfileHeader/ProfileMutualsButton.tsx index 0c2b100c6d..e697776664 100644 --- a/packages/mobile/src/screens/profile-screen/ProfileHeaderV2/ProfileMutualsButton.tsx +++ b/packages/mobile/src/screens/profile-screen/ProfileHeader/ProfileMutualsButton.tsx @@ -44,7 +44,7 @@ export const ProfileMutualsButton = () => { return ( 0 ? handlePress : undefined} + onPress={handlePress} > { const [isRefreshing, setIsRefreshing] = useState(false) const { neutralLight4, accentOrange } = useThemeColors() const navigation = useNavigation() - const { isEnabled: isTippingEnabled } = useFeatureFlag( - FeatureFlags.TIPPING_ENABLED - ) const handlePressSettings = useCallback(() => { navigation.push({ @@ -129,13 +124,10 @@ export const ProfileScreen = () => { const scrollY = useRef(new Animated.Value(0)).current - const renderHeader = useCallback(() => { - return isTippingEnabled ? ( - - ) : ( - - ) - }, [isTippingEnabled, scrollY]) + const renderHeader = useCallback( + () => , + [scrollY] + ) return ( diff --git a/packages/mobile/src/screens/profile-screen/ProfileSocials.tsx b/packages/mobile/src/screens/profile-screen/ProfileSocials.tsx deleted file mode 100644 index 4c0daf248e..0000000000 --- a/packages/mobile/src/screens/profile-screen/ProfileSocials.tsx +++ /dev/null @@ -1,127 +0,0 @@ -import type { ReactElement } from 'react' -import { useCallback } from 'react' - -import { View } from 'react-native' - -import IconInstagram from 'app/assets/images/iconInstagram.svg' -import IconTikTok from 'app/assets/images/iconTikTokInverted.svg' -import IconTwitterBird from 'app/assets/images/iconTwitterBird.svg' -import { IconButton, useLink } from 'app/components/core' -import Skeleton from 'app/components/skeleton' -import { makeStyles } from 'app/styles/makeStyles' -import { EventNames } from 'app/types/analytics' -import { make, track } from 'app/utils/analytics' - -import { ProfileBadge } from './ProfileBadge' -import { useSelectProfile } from './selectors' - -const useStyles = makeStyles(({ palette, spacing }) => ({ - socials: { - display: 'flex', - flexDirection: 'row', - alignItems: 'center' - }, - icon: { - height: 20, - width: 20, - marginRight: spacing(4), - fill: palette.neutral - } -})) - -export const ProfileSocials = () => { - const { handle, twitter_handle, instagram_handle, tiktok_handle } = - useSelectProfile([ - 'handle', - 'twitter_handle', - 'instagram_handle', - 'tiktok_handle' - ]) - - const styles = useStyles() - const sanitizedHandle = handle.replace('@', '') - - const { onPress: onPressTwitter } = useLink( - `https://twitter.com/${twitter_handle}` - ) - - const { onPress: onPressInstagram } = useLink( - `https://instagram.com/${instagram_handle}` - ) - - const { onPress: onPressTikTok } = useLink( - `https://tiktok.com/@${tiktok_handle}` - ) - - const handlePressTwitter = useCallback(() => { - track( - make({ - eventName: EventNames.PROFILE_PAGE_CLICK_TWITTER, - handle: sanitizedHandle, - twitterHandle: twitter_handle as string - }) - ) - onPressTwitter() - }, [onPressTwitter, sanitizedHandle, twitter_handle]) - - const handlePressInstagram = useCallback(() => { - track( - make({ - eventName: EventNames.PROFILE_PAGE_CLICK_INSTAGRAM, - handle: sanitizedHandle, - instagramHandle: instagram_handle as string - }) - ) - onPressInstagram() - }, [onPressInstagram, sanitizedHandle, instagram_handle]) - - const handlePressTikTok = useCallback(() => { - track( - make({ - eventName: EventNames.PROFILE_PAGE_CLICK_TIKTOK, - handle: sanitizedHandle, - tikTokHandle: tiktok_handle as string - }) - ) - onPressTikTok() - }, [onPressTikTok, sanitizedHandle, tiktok_handle]) - - const renderSocial = ( - handle: string | undefined | null, - socialElement: ReactElement - ) => { - if (handle === undefined) return - if (handle === null || handle === '') return null - return socialElement - } - - return ( - - - {renderSocial( - twitter_handle, - - )} - {renderSocial( - instagram_handle, - - )} - {renderSocial( - tiktok_handle, - - )} - - ) -} diff --git a/packages/mobile/src/screens/user-list-screen/MutualsScreen.tsx b/packages/mobile/src/screens/user-list-screen/MutualsScreen.tsx index a90fc499e7..97c74602b3 100644 --- a/packages/mobile/src/screens/user-list-screen/MutualsScreen.tsx +++ b/packages/mobile/src/screens/user-list-screen/MutualsScreen.tsx @@ -4,7 +4,7 @@ import { setMutuals } from 'audius-client/src/common/store/user-list/mutuals/act import { getUserList } from 'audius-client/src/common/store/user-list/mutuals/selectors' import { USER_LIST_TAG } from 'audius-client/src/common/store/user-list/mutuals/types' -import IconTrophy from 'app/assets/images/iconTrophy.svg' +import IconFollowing from 'app/assets/images/iconFollowing.svg' import { useDispatchWeb } from 'app/hooks/useDispatchWeb' import { useProfileRoute } from 'app/hooks/useRoute' @@ -25,7 +25,7 @@ export const MutualsScreen = () => { }, [dispatchWeb, userId]) return ( - + - followerCount === 1 ? 'Follower' : 'Followers', - follow: 'Follow', - following: 'Following' -} - -const useStyles = makeStyles(({ spacing, typography, palette }) => ({ - root: { - flexDirection: 'row', - justifyContent: 'space-between', - padding: spacing(3), - backgroundColor: palette.white - }, - details: { flexDirection: 'row', flex: 1 }, - userInfo: { flex: 1, marginRight: spacing(4) }, - photo: { height: 42, width: 42, marginRight: spacing(2) }, - nameRoot: { flexDirection: 'row' }, - name: { ...typography.h3, color: palette.neutral }, - followers: { ...typography.h4, color: palette.neutral } -})) - -type UserChipProps = { - user: User - currentUserId: Nullable -} - -export const UserChip = (props: UserChipProps) => { - const { user, currentUserId } = props - const { handle, name, follower_count } = user - const styles = useStyles() - - const navigation = useNavigation() - - const handlePress = useCallback(() => { - navigation.push({ - native: { screen: 'Profile', params: { handle } }, - web: { route: handle } - }) - }, [navigation, handle]) - - return ( - - - - - - - {name} - - - - - {formatCount(follower_count)} {messages.followers(follower_count)} - - - - {user.user_id === currentUserId ? null : ( - - )} - - ) -} diff --git a/packages/mobile/src/screens/user-list-screen/UserList.tsx b/packages/mobile/src/screens/user-list-screen/UserList.tsx index f9287732f8..363ac4d965 100644 --- a/packages/mobile/src/screens/user-list-screen/UserList.tsx +++ b/packages/mobile/src/screens/user-list-screen/UserList.tsx @@ -1,10 +1,8 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' -import { FeatureFlags } from '@audius/common' import type { ID, User } from '@audius/common' import { useFocusEffect, useIsFocused } from '@react-navigation/native' import type { CommonState } from 'audius-client/src/common/store' -import { getUserId } from 'audius-client/src/common/store/account/selectors' import { getUsers } from 'audius-client/src/common/store/cache/users/selectors' import { loadMore, @@ -19,11 +17,9 @@ import type { Selector } from 'react-redux' import { Divider, FlatList } from 'app/components/core' import LoadingSpinner from 'app/components/loading-spinner' import { useDispatchWeb } from 'app/hooks/useDispatchWeb' -import { useFeatureFlag } from 'app/hooks/useRemoteConfig' import { isEqual, useSelectorWeb } from 'app/hooks/useSelectorWeb' import { makeStyles } from 'app/styles' -import { UserChip } from './UserChip' import { UserListItem } from './UserListItem' const useStyles = makeStyles(({ spacing }) => ({ @@ -73,7 +69,6 @@ export const UserList = (props: UserListProps) => { tag }) const optimisticUserIds: ID[] = useSelectorWeb(getOptimisticUserIds) - const currentUserId = useSelectorWeb(getUserId) const usersMap = useSelectorWeb( (state) => getUsers(state, { ids: optimisticUserIds }), isEqual @@ -86,10 +81,6 @@ export const UserList = (props: UserListProps) => { [usersMap, optimisticUserIds] ) - const { isEnabled: isTippingEnabled } = useFeatureFlag( - FeatureFlags.TIPPING_ENABLED - ) - useFocusEffect( useCallback(() => { setIsRefreshing(true) @@ -146,15 +137,9 @@ export const UserList = (props: UserListProps) => { - isTippingEnabled ? ( - - ) : ( - - ) - } + renderItem={({ item }) => } keyExtractor={(item) => item.user_id.toString()} - ItemSeparatorComponent={isTippingEnabled ? Divider : undefined} + ItemSeparatorComponent={Divider} onEndReached={handleEndReached} ListFooterComponent={loading || isRefreshing ? loadingSpinner : footer} /> diff --git a/packages/mobile/src/screens/user-list-screen/UserListScreen.tsx b/packages/mobile/src/screens/user-list-screen/UserListScreen.tsx index ffd8621630..6d05448150 100644 --- a/packages/mobile/src/screens/user-list-screen/UserListScreen.tsx +++ b/packages/mobile/src/screens/user-list-screen/UserListScreen.tsx @@ -1,11 +1,9 @@ import type { ComponentType, ReactElement, ReactNode } from 'react' import { useCallback } from 'react' -import { FeatureFlags } from '@audius/common' import type { SvgProps } from 'react-native-svg' import { Screen } from 'app/components/core' -import { useFeatureFlag } from 'app/hooks/useRemoteConfig' import { UserListTitle } from './UserListTitle' @@ -17,9 +15,6 @@ type UserListScreenProps = { export const UserListScreen = (props: UserListScreenProps) => { const { title, titleIcon, children } = props - const { isEnabled: isTippingEnabled } = useFeatureFlag( - FeatureFlags.TIPPING_ENABLED - ) const headerTitle = useCallback(() => { if (!titleIcon) { @@ -29,12 +24,7 @@ export const UserListScreen = (props: UserListScreenProps) => { }, [titleIcon, title]) return ( - + {children} ) diff --git a/packages/mobile/src/services/fingerprint.ts b/packages/mobile/src/services/fingerprint.ts index cdc48eb087..30c1b87e35 100644 --- a/packages/mobile/src/services/fingerprint.ts +++ b/packages/mobile/src/services/fingerprint.ts @@ -1,4 +1,4 @@ -import { FingerprintClient } from 'audius-client/src/common/services/fingerprint' +import { FingerprintClient } from 'common/services/fingerprint' import Config from 'react-native-config' const apiKey = Config.FINGERPRINT_PUBLIC_API_KEY || '' diff --git a/packages/web/src/components/artist/ArtistCard.tsx b/packages/web/src/components/artist/ArtistCard.tsx index 74c5e81402..7b19ed79a3 100644 --- a/packages/web/src/components/artist/ArtistCard.tsx +++ b/packages/web/src/components/artist/ArtistCard.tsx @@ -1,13 +1,12 @@ import { MouseEventHandler, useCallback, useMemo } from 'react' -import { FollowSource, User, FeatureFlags } from '@audius/common' +import { FollowSource, User } from '@audius/common' import { useDispatch } from 'react-redux' import { setNotificationSubscription } from 'common/store/pages/profile/actions' import { followUser, unfollowUser } from 'common/store/social/users/actions' import FollowButton from 'components/follow-button/FollowButton' import Stats, { StatProps } from 'components/stats/Stats' -import { getFeatureEnabled } from 'services/remote-config/featureFlagHelpers' import styles from './ArtistCard.module.css' import { ArtistCardCover } from './ArtistCardCover' @@ -32,7 +31,6 @@ export const ArtistCard = (props: ArtistCardProps) => { const dispatch = useDispatch() const isArtist = track_count > 0 - const isTippingEnabled = getFeatureEnabled(FeatureFlags.TIPPING_ENABLED) const handleClick: MouseEventHandler = useCallback((event) => { event.stopPropagation() @@ -96,12 +94,7 @@ export const ArtistCard = (props: ArtistCardProps) => {
- {isTippingEnabled ? ( - - ) : null} +
{bio}
{ const MAX_WIDTH_FOR_SHORT_TIP_BUTTON = 884 export const FeedTipTile = () => { - const isTippingEnabled = getFeatureEnabled(FeatureFlags.TIPPING_ENABLED) - const { isMatch: useShortButtonFormat } = useMediaQueryListener( `(max-width: ${MAX_WIDTH_FOR_SHORT_TIP_BUTTON}px)` ) @@ -214,7 +211,7 @@ export const FeedTipTile = () => { } }, [dispatch, usersMap, tipToDisplay]) - if (!isTippingEnabled || !showTip) { + if (!showTip) { return null } diff --git a/packages/web/src/pages/profile-page/components/desktop/ProfileLeftNav.tsx b/packages/web/src/pages/profile-page/components/desktop/ProfileLeftNav.tsx index c867232a6f..b324d9236f 100644 --- a/packages/web/src/pages/profile-page/components/desktop/ProfileLeftNav.tsx +++ b/packages/web/src/pages/profile-page/components/desktop/ProfileLeftNav.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react' -import { ID, Name, FeatureFlags } from '@audius/common' +import { ID, Name } from '@audius/common' import cn from 'classnames' import { animated } from 'react-spring' @@ -17,7 +17,6 @@ import ProfilePageBadge from 'components/user-badges/ProfilePageBadge' import { Type } from 'pages/profile-page/components/SocialLink' import SocialLinkInput from 'pages/profile-page/components/SocialLinkInput' import { ProfileTags } from 'pages/profile-page/components/desktop/ProfileTags' -import { getFeatureEnabled } from 'services/remote-config/featureFlagHelpers' import { make, useRecord } from 'store/analytics/actions' import { UPLOAD_PAGE } from 'utils/route' @@ -94,7 +93,6 @@ export const ProfileLeftNav = (props: ProfileLeftNavProps) => { } = props const record = useRecord() - const isTippingEnabled = getFeatureEnabled(FeatureFlags.TIPPING_ENABLED) const accountUser = useSelector(getAccountUser) const onClickUploadChip = useCallback(() => { @@ -201,12 +199,11 @@ export const ProfileLeftNav = (props: ProfileLeftNavProps) => { instagramHandle={instagramHandle} tikTokHandle={tikTokHandle} /> - {isTippingEnabled && - (!accountUser || accountUser.user_id !== userId) ? ( + {!accountUser || accountUser.user_id !== userId ? ( ) : null} - {isTippingEnabled && } - {isTippingEnabled && } + + {isArtist ? : null} {isOwner && !isArtist && ( diff --git a/packages/web/src/pages/profile-page/sagas.js b/packages/web/src/pages/profile-page/sagas.js index a22b2af0cb..cc4b21aabc 100644 --- a/packages/web/src/pages/profile-page/sagas.js +++ b/packages/web/src/pages/profile-page/sagas.js @@ -2,7 +2,6 @@ import { DefaultSizes, Kind, DoubleKeys, - FeatureFlags, makeUid, makeKindId } from '@audius/common' @@ -37,7 +36,6 @@ import { apiClient } from 'services/audius-api-client' import { fetchCID } from 'services/audius-backend' import { audiusBackendInstance } from 'services/audius-backend/audius-backend-instance' import OpenSeaClient from 'services/opensea-client/OpenSeaClient' -import { getFeatureEnabled } from 'services/remote-config/featureFlagHelpers' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' import SolanaClient from 'services/solana-client/SolanaClient' import * as confirmerActions from 'store/confirmer/actions' @@ -152,10 +150,6 @@ export function* fetchSolanaCollectibles(user) { function* fetchSupportersAndSupporting(userId) { yield call(waitForRemoteConfig) - const isTippingEnabled = getFeatureEnabled(FeatureFlags.TIPPING_ENABLED) - if (!isTippingEnabled) { - return - } /** * If the profile is that of the logged in user, then diff --git a/packages/web/src/store/tipping/sagas.ts b/packages/web/src/store/tipping/sagas.ts index 15073c19bc..c3a133588d 100644 --- a/packages/web/src/store/tipping/sagas.ts +++ b/packages/web/src/store/tipping/sagas.ts @@ -9,8 +9,7 @@ import { User, BNWei, StringWei, - Nullable, - FeatureFlags + Nullable } from '@audius/common' import BN from 'bn.js' import { @@ -69,7 +68,6 @@ import { UserTipRequest } from 'services/audius-backend/Tipping' import { UpdateTipsStorageMessage } from 'services/native-mobile-interface/tipping' -import { getFeatureEnabled } from 'services/remote-config/featureFlagHelpers' import { remoteConfigInstance } from 'services/remote-config/remote-config-instance' import walletClient from 'services/wallet-client/WalletClient' import { make } from 'store/analytics/actions' @@ -206,10 +204,6 @@ function* overrideSupportersForUser({ function* sendTipAsync() { yield call(waitForRemoteConfig) - const isTippingEnabled = getFeatureEnabled(FeatureFlags.TIPPING_ENABLED) - if (!isTippingEnabled) { - return - } const sender = yield* select(getAccountUser) if (!sender) {