-
) => {
- const url = event.currentTarget.innerText
-
- if (isAudiusUrl(url)) {
- const path = getPathFromAudiusUrl(url)
- event.nativeEvent.preventDefault()
- onInternalLinkClick(path ?? '/')
- } else {
- onExternalLinkClick(event)
- }
- }
- },
- target: (href, type, tokens) => {
- return isAudiusUrl(href) ? '' : '_blank'
- }
- }}
+
-
- {squashNewLines(bio)}
-
-
+ {bio}
+
{isCollapsed ? (
diff --git a/packages/web/src/pages/profile-page/components/desktop/ProfilePage.module.css b/packages/web/src/pages/profile-page/components/desktop/ProfilePage.module.css
index 9a93c96049..cae5a2af40 100644
--- a/packages/web/src/pages/profile-page/components/desktop/ProfilePage.module.css
+++ b/packages/web/src/pages/profile-page/components/desktop/ProfilePage.module.css
@@ -87,7 +87,6 @@
margin-bottom: 14px;
}
-.info .description,
.info .location,
.info .joined {
color: var(--neutral);
@@ -97,12 +96,12 @@
user-select: none;
}
-.info .description {
- margin-bottom: 16px;
- white-space: pre-line;
+.description {
+ margin-bottom: var(--unit-4);
overflow: hidden;
text-overflow: ellipsis;
}
+
/* truncates the content at a maximum of 4 lines */
/* works on modern browsers */
.truncated {
@@ -113,13 +112,11 @@
line-clamp: 4;
-webkit-box-orient: vertical;
}
-.info .description > a {
- color: var(--primary);
-}
.socials {
display: flex;
flex-direction: column;
+ row-gap: var(--unit-4);
padding-bottom: var(--unit-2);
}
.info .socialsTruncated {
diff --git a/packages/web/src/pages/profile-page/components/mobile/ProfileHeader.module.css b/packages/web/src/pages/profile-page/components/mobile/ProfileHeader.module.css
index b33a77891d..4252925da4 100644
--- a/packages/web/src/pages/profile-page/components/mobile/ProfileHeader.module.css
+++ b/packages/web/src/pages/profile-page/components/mobile/ProfileHeader.module.css
@@ -190,25 +190,14 @@
}
.bio {
- flex: 1;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
- white-space: pre-line;
+ text-align: left;
width: 100%;
- margin-top: 14px;
- color: var(--neutral-light-2);
- font-family: var(--font-family);
- font-size: var(--font-s);
+ margin-top: var(--unit-2);
transition: all 0.07s ease-in-out;
- font-weight: var(--font-medium);
- line-height: 20px;
- text-align: left;
-}
-
-.bio > a {
- color: var(--primary);
}
.bio:not(.bioExpanded) {
diff --git a/packages/web/src/pages/profile-page/components/mobile/ProfileHeader.tsx b/packages/web/src/pages/profile-page/components/mobile/ProfileHeader.tsx
index 93ae99e2ae..1ce73f9801 100644
--- a/packages/web/src/pages/profile-page/components/mobile/ProfileHeader.tsx
+++ b/packages/web/src/pages/profile-page/components/mobile/ProfileHeader.tsx
@@ -1,4 +1,4 @@
-import { useState, useRef, useCallback, useEffect } from 'react'
+import { useState, useRef, useCallback, useEffect, MouseEvent } from 'react'
import {
ID,
@@ -8,7 +8,6 @@ import {
WidthSizes,
SquareSizes,
formatCount,
- squashNewLines,
imageCoverPhotoBlank
} from '@audius/common'
import {
@@ -22,10 +21,10 @@ import {
IconTikTok
} from '@audius/stems'
import cn from 'classnames'
-import Linkify from 'linkify-react'
import { ReactComponent as BadgeArtist } from 'assets/img/badgeArtist.svg'
import { make, useRecord } from 'common/store/analytics/actions'
+import { Icon } from 'components/Icon'
import { ArtistRecommendationsDropdown } from 'components/artist-recommendations/ArtistRecommendationsDropdown'
import DynamicImage from 'components/dynamic-image/DynamicImage'
import { FollowButton } from 'components/follow-button/FollowButton'
@@ -34,6 +33,7 @@ import SubscribeButton from 'components/subscribe-button/SubscribeButton'
import FollowsYouBadge from 'components/user-badges/FollowsYouBadge'
import ProfilePageBadge from 'components/user-badges/ProfilePageBadge'
import UserBadges from 'components/user-badges/UserBadges'
+import { UserGeneratedText } from 'components/user-generated-text'
import { useUserCoverPhoto } from 'hooks/useUserCoverPhoto'
import { useUserProfilePicture } from 'hooks/useUserProfilePicture'
import { FOLLOWING_USERS_ROUTE, FOLLOWERS_USERS_ROUTE } from 'utils/route'
@@ -244,18 +244,6 @@ const ProfileHeader = ({
)
}, [record, tikTokHandle, handle])
- const onExternalLinkClick = useCallback(
- (event: { target: { href: string } }) => {
- record(
- make(Name.LINK_CLICKING, {
- url: event.target.href,
- source: 'profile page' as const
- })
- )
- },
- [record]
- )
-
const onGoToFollowersPage = () => {
setFollowersUserId(userId)
goToRoute(FOLLOWERS_USERS_ROUTE)
@@ -281,11 +269,12 @@ const ProfileHeader = ({
)
}
- const onDonationLinkClick = useCallback(
- (event: { target: { href: string } }) => {
+ const handleClickDonationLink = useCallback(
+ (event: MouseEvent) => {
record(
make(Name.PROFILE_PAGE_CLICK_DONATION, {
handle,
+ // @ts-expect-error
donation: event.target.href
})
)
@@ -415,60 +404,57 @@ const ProfileHeader = ({
/>
{twitterHandle ? (
}
/>
) : null}
{instagramHandle ? (
}
/>
) : null}
{tikTokHandle ? (
}
/>
) : null}
+
{bio ? (
-
-
- {squashNewLines(bio)}
-
-
+
+ {bio}
+
) : null}
{hasEllipsis && !isDescriptionMinimized && (website || donation) && (
{website && (
-
+
{website}
)}
{donation && (
-
-
-
- {donation}
-
-
+
+
+ {donation}
+
)}
diff --git a/packages/web/src/pages/profile-page/components/mobile/SocialLink.tsx b/packages/web/src/pages/profile-page/components/mobile/SocialLink.tsx
index 7b0ad57a06..fad8c2c32f 100644
--- a/packages/web/src/pages/profile-page/components/mobile/SocialLink.tsx
+++ b/packages/web/src/pages/profile-page/components/mobile/SocialLink.tsx
@@ -6,7 +6,7 @@ import styles from './ProfileHeader.module.css'
type SocialLinkProps = {
onClick: () => void
- href: string
+ to: string
icon: ReactElement
}
diff --git a/packages/web/src/pages/track-page/TrackPageProvider.tsx b/packages/web/src/pages/track-page/TrackPageProvider.tsx
index 411fa46090..a10f7c5854 100644
--- a/packages/web/src/pages/track-page/TrackPageProvider.tsx
+++ b/packages/web/src/pages/track-page/TrackPageProvider.tsx
@@ -383,9 +383,7 @@ class TrackPageProvider extends Component<
buffering,
userId,
pause,
- downloadTrack,
- onExternalLinkClick,
- onInternalLinkClick
+ downloadTrack
} = this.props
const heroPlaying =
playing &&
@@ -476,9 +474,7 @@ class TrackPageProvider extends Component<
isPlaying: playing,
isBuffering: buffering,
play: this.onMoreByArtistTracksPlay,
- pause,
- onExternalLinkClick,
- onInternalLinkClick
+ pause
}
return (
@@ -608,16 +604,6 @@ function mapDispatchToProps(dispatch: Dispatch) {
dispatch(setRepost(trackId, RepostType.TRACK)),
setFavoriteTrackId: (trackId: ID) =>
dispatch(setFavorite(trackId, FavoriteType.TRACK)),
- onInternalLinkClick: (route: string) => {
- dispatch(pushRoute(route))
- },
- onExternalLinkClick: (event: any) => {
- const trackEvent: TrackEvent = make(Name.LINK_CLICKING, {
- url: event.target.href,
- source: 'track page' as const
- })
- dispatch(trackEvent)
- },
record: (event: TrackEvent) => dispatch(event),
setRepostUsers: (trackID: ID) =>
dispatch(
diff --git a/packages/web/src/pages/track-page/components/desktop/TrackPage.tsx b/packages/web/src/pages/track-page/components/desktop/TrackPage.tsx
index f39447110b..8db2fb5a03 100644
--- a/packages/web/src/pages/track-page/components/desktop/TrackPage.tsx
+++ b/packages/web/src/pages/track-page/components/desktop/TrackPage.tsx
@@ -63,8 +63,6 @@ export type OwnProps = {
isBuffering: boolean
play: (uid?: string) => void
pause: () => void
- onExternalLinkClick: (event: React.MouseEvent
) => void
- onInternalLinkClick: (url: string) => void
}
const TrackPage = ({
@@ -89,8 +87,6 @@ const TrackPage = ({
onUnfollow,
onDownloadTrack,
makePublic,
- onExternalLinkClick,
- onInternalLinkClick,
onClickReposts,
onClickFavorites,
@@ -152,8 +148,6 @@ const TrackPage = ({
}
isSaved={isSaved}
badge={badge}
- onExternalLinkClick={onExternalLinkClick}
- onInternalLinkClick={onInternalLinkClick}
isUnlisted={defaults.isUnlisted}
isPremium={defaults.isPremium}
premiumConditions={defaults.premiumConditions}
diff --git a/packages/web/src/pages/track-page/components/mobile/TrackHeader.module.css b/packages/web/src/pages/track-page/components/mobile/TrackHeader.module.css
index ee94c46754..eae718e380 100644
--- a/packages/web/src/pages/track-page/components/mobile/TrackHeader.module.css
+++ b/packages/web/src/pages/track-page/components/mobile/TrackHeader.module.css
@@ -84,19 +84,19 @@
width: 100%;
}
+.withSectionDivider {
+ width: 100%;
+ padding-top: var(--unit-4);
+ border-top: 1px solid var(--neutral-light-9);
+}
+
.description {
- color: var(--neutral);
+ composes: withSectionDivider;
text-align: left;
white-space: pre-line;
- text-overflow: ellipsis;
- overflow: hidden;
width: 100%;
}
-.description > a {
- color: var(--primary);
-}
-
/* Moible Toast */
.mobileToast {
top: 56px !important;
@@ -264,9 +264,3 @@
display: flex;
justify-content: center;
}
-
-.withSectionDivider {
- width: 100%;
- padding-top: var(--unit-4);
- border-top: 1px solid var(--neutral-light-9);
-}
diff --git a/packages/web/src/pages/track-page/components/mobile/TrackHeader.tsx b/packages/web/src/pages/track-page/components/mobile/TrackHeader.tsx
index f34944a0f1..1eef0d63dd 100644
--- a/packages/web/src/pages/track-page/components/mobile/TrackHeader.tsx
+++ b/packages/web/src/pages/track-page/components/mobile/TrackHeader.tsx
@@ -2,12 +2,10 @@ import { useCallback } from 'react'
import {
ID,
- Name,
SquareSizes,
CoverArtSizes,
FieldVisibility,
Remix,
- squashNewLines,
getCanonicalName,
formatSeconds,
formatDate,
@@ -30,10 +28,8 @@ import {
IconSpecialAccess
} from '@audius/stems'
import cn from 'classnames'
-import Linkify from 'linkify-react'
import { ReactComponent as IconRobot } from 'assets/img/robot.svg'
-import { make, useRecord } from 'common/store/analytics/actions'
import CoSign from 'components/co-sign/CoSign'
import HoverInfo from 'components/co-sign/HoverInfo'
import { Size } from 'components/co-sign/types'
@@ -45,7 +41,7 @@ import { SearchTag } from 'components/search/SearchTag'
import { AiTrackSection } from 'components/track/AiTrackSection'
import Badge from 'components/track/Badge'
import { PremiumTrackSection } from 'components/track/PremiumTrackSection'
-import typeStyles from 'components/typography/typography.module.css'
+import { UserGeneratedText } from 'components/user-generated-text'
import { useTrackCoverArt } from 'hooks/useTrackCoverArt'
import { moodMap } from 'utils/Moods'
import { isDarkMode } from 'utils/theme/theme'
@@ -224,19 +220,6 @@ const TrackHeader = ({
{ label: 'Credit', value: credits }
].filter(({ isHidden, value }) => !isHidden && !!value)
- const record = useRecord()
- const onExternalLinkClick = useCallback(
- (event: { target: { href: string } }) => {
- record(
- make(Name.LINK_CLICKING, {
- url: event.target.href,
- source: 'track page' as const
- })
- )
- },
- [record]
- )
-
const onClickOverflow = () => {
const overflowActions = [
isOwner || !showSocials
@@ -470,18 +453,12 @@ const TrackHeader = ({
/>
) : null}
{description ? (
-
-
- {squashNewLines(description)}
-
-
+
+ {description}
+
) : null}
{renderTrackLabels()}