Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/web/src/components/alt-button/ShareButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ const ShareButton = ({
})}
aria-label={messages.share}
onClick={(e) => {
onClick(e)
stopPropagation && e.stopPropagation()
onClick(e)
}}
>
<div
Expand Down
10 changes: 7 additions & 3 deletions packages/web/src/components/track/desktop/CollectionTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,13 @@ export const CollectionTile = ({
isFeed
])

const onClickShare = useCallback(() => {
shareCollection(id)
}, [shareCollection, id])
const onClickShare = useCallback(
(e?: MouseEvent) => {
e?.stopPropagation()
shareCollection(id)
},
[shareCollection, id]
)

const hasStreamAccess = !!access?.stream

Expand Down
10 changes: 7 additions & 3 deletions packages/web/src/components/track/desktop/TrackTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,13 @@ export const TrackTile = ({
}
}, [handleRepostTrack, handleUndoRepostTrack, trackId, isReposted, isFeed])

const onClickShare = useCallback(() => {
shareTrack(trackId)
}, [shareTrack, trackId])
const onClickShare = useCallback(
(e?: MouseEvent) => {
e?.stopPropagation()
shareTrack(trackId)
},
[shareTrack, trackId]
)

const onClickTitle = useCallback(
(e: MouseEvent) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/track/mobile/BottomButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type BottomButtonsProps = {
toggleSave: () => void
toggleRepost: () => void
onClickOverflow: () => void
onShare: () => void
onShare: (e?: MouseEvent) => void
onClickGatedUnlockPill?: (e: MouseEvent) => void
isLoading: boolean
isOwner: boolean
Expand Down
10 changes: 7 additions & 3 deletions packages/web/src/components/track/mobile/CollectionTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,13 @@ export const CollectionTile = ({
[goToRoute, getRoute]
)

const onShare = useCallback(() => {
shareCollection(collection.playlist_id)
}, [shareCollection, collection.playlist_id])
const onShare = useCallback(
(e?: MouseEvent) => {
e?.stopPropagation()
shareCollection(collection.playlist_id)
},
[shareCollection, collection.playlist_id]
)

const onClickOverflow = useCallback(() => {
const overflowActions = [
Expand Down
26 changes: 15 additions & 11 deletions packages/web/src/components/track/mobile/TrackTile.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useEffect } from 'react'
import { MouseEvent, useCallback, useEffect } from 'react'

import {
useToggleFavoriteTrack,
Expand Down Expand Up @@ -298,16 +298,20 @@ export const TrackTile = ({

const onToggleRepost = useCallback(() => toggleRepost(id), [toggleRepost, id])

const onClickShare = useCallback(() => {
if (!trackId) return
dispatch(
requestOpenShareModal({
type: 'track',
trackId,
source: ShareSource.TILE
})
)
}, [dispatch, trackId])
const onClickShare = useCallback(
(e?: MouseEvent) => {
e?.stopPropagation()
if (!trackId) return
dispatch(
requestOpenShareModal({
type: 'track',
trackId,
source: ShareSource.TILE
})
)
},
[dispatch, trackId]
)

const onClickOverflowMenu = useCallback(
() => onClickOverflow && onClickOverflow(id),
Expand Down