-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into rj-cf-relay-client
- Loading branch information
Showing
15 changed files
with
155 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"version": "0.6.81", | ||
"version": "0.6.82", | ||
"service": "content-node" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/common/src/store/ui/modals/album-track-remove-confirmation-modal.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { ID } from '~/models' | ||
|
||
import { createModal } from './createModal' | ||
|
||
export type AlbumTrackRemoveConfirmationModalState = { | ||
trackId: ID | undefined | ||
playlistId: ID | undefined | ||
uid: string | undefined | ||
timestamp: number | undefined | ||
} | ||
|
||
const albumTrackRemoveConfirmationModal = | ||
createModal<AlbumTrackRemoveConfirmationModalState>({ | ||
reducerPath: 'AlbumTrackRemoveConfirmation', | ||
initialState: { | ||
isOpen: false, | ||
trackId: undefined, | ||
playlistId: undefined, | ||
uid: undefined, | ||
timestamp: undefined | ||
}, | ||
sliceSelector: (state) => state.ui.modals | ||
}) | ||
|
||
export const { | ||
hook: useAlbumTrackRemoveConfirmationModal, | ||
reducer: albumTrackRemoveConfirmationModalReducer, | ||
actions: albumTrackRemoveConfirmationModalActions | ||
} = albumTrackRemoveConfirmationModal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"version": "0.6.81", | ||
"version": "0.6.82", | ||
"service": "discovery-node" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
...rc/components/album-track-remove-confirmation-modal/AlbumTrackRemoveConfirmationModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { useCallback } from 'react' | ||
|
||
import { Kind } from '@audius/common/models' | ||
import { | ||
useAlbumTrackRemoveConfirmationModal, | ||
collectionPageLineupActions, | ||
cacheCollectionsActions | ||
} from '@audius/common/store' | ||
import { | ||
Button, | ||
Modal, | ||
ModalContent, | ||
ModalContentText, | ||
ModalHeader, | ||
ModalTitle, | ||
ModalFooter | ||
} from '@audius/harmony' | ||
import { useDispatch } from 'react-redux' | ||
|
||
const messages = { | ||
title: 'Remove Track', | ||
description1: 'Are you sure you want to remove this track from your album?', | ||
description2: | ||
'By default, fans who have purchased your album will still have access to your track.', | ||
cancel: 'Cancel', | ||
release: 'Remove Track From Album' | ||
} | ||
|
||
export const AlbumTrackRemoveConfirmationModal = () => { | ||
const { | ||
isOpen, | ||
onClose, | ||
data: { trackId, playlistId, uid, timestamp } | ||
} = useAlbumTrackRemoveConfirmationModal() | ||
|
||
const dispatch = useDispatch() | ||
|
||
const handleConfirm = useCallback(() => { | ||
if (trackId && playlistId && uid && timestamp) { | ||
dispatch( | ||
cacheCollectionsActions.removeTrackFromPlaylist( | ||
trackId, | ||
playlistId, | ||
timestamp | ||
) | ||
) | ||
dispatch(collectionPageLineupActions.remove(Kind.TRACKS, uid)) | ||
} | ||
onClose() | ||
}, [dispatch, onClose, playlistId, timestamp, trackId, uid]) | ||
|
||
return ( | ||
<Modal isOpen={isOpen} onClose={onClose} size='medium'> | ||
<ModalHeader> | ||
<ModalTitle title={messages.title} /> | ||
</ModalHeader> | ||
<ModalContent css={{ textAlign: 'center' }}> | ||
<ModalContentText>{messages.description1}</ModalContentText> | ||
<ModalContentText>{messages.description2}</ModalContentText> | ||
</ModalContent> | ||
<ModalFooter> | ||
<Button fullWidth variant='secondary' onClick={onClose}> | ||
{messages.cancel} | ||
</Button> | ||
<Button variant='destructive' fullWidth onClick={handleConfirm}> | ||
{messages.release} | ||
</Button> | ||
</ModalFooter> | ||
</Modal> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters