Skip to content

Commit

Permalink
Fix upload prompt modal learn more url (#3091)
Browse files Browse the repository at this point in the history
Co-authored-by: Saliou Diallo <saliou@audius.co>
  • Loading branch information
sddioulde and Saliou Diallo authored Mar 23, 2023
1 parent c9024ad commit 44435b5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { flexRowCentered, makeStyles } from 'app/styles'
import { useColor } from 'app/utils/theme'

const LEARN_MORE_URL =
'https://blog.audius.co/guide-to-audius-availability-settings'
'https://blog.audius.co/article/guide-to-audius-availability-settings'

const messages = {
title: 'NEW UPDATE!',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const GATED_CONTENT_UPLOAD_PROMPT_MODAL_SEEN_KEY =
'gated_content_upload_prompt_modal_seen'

const LEARN_MORE_URL =
'https://blog.audius.co/guide-to-audius-availability-settings'
'https://blog.audius.co/article/guide-to-audius-availability-settings'

type GatedContentUploadPromptModalProps = {
onSubmit: () => void
Expand Down
59 changes: 21 additions & 38 deletions packages/web/src/pages/track-page/components/mobile/TrackHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
formatDate,
OverflowAction,
imageBlank as placeholderArt,
FeatureFlags,
PremiumConditions,
Nullable
} from '@audius/common'
Expand All @@ -40,7 +39,6 @@ import TrackBannerIcon, {
TrackBannerIconType
} from 'components/track/TrackBannerIcon'
import UserBadges from 'components/user-badges/UserBadges'
import { useFlag } from 'hooks/useRemoteConfig'
import { useTrackCoverArt } from 'hooks/useTrackCoverArt'
import { moodMap } from 'utils/moods'
import { isDarkMode, isMatrix } from 'utils/theme/theme'
Expand Down Expand Up @@ -173,11 +171,7 @@ const TrackHeader = ({
goToFavoritesPage,
goToRepostsPage
}: TrackHeaderProps) => {
const { isEnabled: isGatedContentEnabled } = useFlag(
FeatureFlags.GATED_CONTENT_ENABLED
)
const showSocials =
!isUnlisted && (!isGatedContentEnabled || doesUserHaveAccess)
const showSocials = !isUnlisted && doesUserHaveAccess

const image = useTrackCoverArt(
trackId,
Expand Down Expand Up @@ -234,9 +228,7 @@ const TrackHeader = ({
: isSaved
? OverflowAction.UNFAVORITE
: OverflowAction.FAVORITE,
!isGatedContentEnabled || !isPremium
? OverflowAction.ADD_TO_PLAYLIST
: null,
!isPremium ? OverflowAction.ADD_TO_PLAYLIST : null,
isFollowing
? OverflowAction.UNFOLLOW_ARTIST
: OverflowAction.FOLLOW_ARTIST,
Expand Down Expand Up @@ -319,10 +311,7 @@ const TrackHeader = ({

const renderCornerTag = () => {
const showPremiumCornerTag =
isGatedContentEnabled &&
!isLoading &&
premiumConditions &&
(isOwner || !doesUserHaveAccess)
!isLoading && premiumConditions && (isOwner || !doesUserHaveAccess)
const cornerTagIconType = showPremiumCornerTag
? isOwner
? premiumConditions.nft_collection
Expand All @@ -343,7 +332,7 @@ const TrackHeader = ({
}

const renderHeaderText = () => {
if (isGatedContentEnabled && isPremium) {
if (isPremium) {
return (
<div className={cn(styles.typeLabel, styles.premiumContentLabel)}>
{premiumConditions?.nft_collection ? (
Expand Down Expand Up @@ -388,10 +377,7 @@ const TrackHeader = ({
/>
</div>
<div className={styles.buttonSection}>
{isGatedContentEnabled &&
!doesUserHaveAccess &&
premiumConditions &&
trackId ? (
{!doesUserHaveAccess && premiumConditions && trackId ? (
<PremiumTrackSection
isLoading={false}
trackId={trackId}
Expand All @@ -403,7 +389,7 @@ const TrackHeader = ({
buttonClassName={styles.premiumTrackSectionButton}
/>
) : null}
{!isGatedContentEnabled || doesUserHaveAccess ? (
{doesUserHaveAccess ? (
<PlayButton playing={isPlaying} onPlay={onPlay} />
) : null}
<ActionButtonRow
Expand All @@ -422,24 +408,21 @@ const TrackHeader = ({
darkMode={isDarkMode()}
/>
</div>
{isGatedContentEnabled &&
doesUserHaveAccess &&
premiumConditions &&
trackId && (
<PremiumTrackSection
isLoading={false}
trackId={trackId}
premiumConditions={premiumConditions}
doesUserHaveAccess={doesUserHaveAccess}
isOwner={isOwner}
wrapperClassName={cn(
styles.premiumTrackSectionWrapper,
styles.unlockedSection
)}
className={styles.premiumTrackSection}
buttonClassName={styles.premiumTrackSectionButton}
/>
)}
{doesUserHaveAccess && premiumConditions && trackId && (
<PremiumTrackSection
isLoading={false}
trackId={trackId}
premiumConditions={premiumConditions}
doesUserHaveAccess={doesUserHaveAccess}
isOwner={isOwner}
wrapperClassName={cn(
styles.premiumTrackSectionWrapper,
styles.unlockedSection
)}
className={styles.premiumTrackSection}
buttonClassName={styles.premiumTrackSectionButton}
/>
)}
{coSign && (
<div className={styles.coSignInfo}>
<HoverInfo
Expand Down

0 comments on commit 44435b5

Please sign in to comment.