From d300afea6a884f835ad16ed608c984031686311d Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Wed, 21 Jun 2023 22:59:10 -0700 Subject: [PATCH 1/2] [C-2763] Fix desktop playlist qa issues --- .../src/store/playlist-library/helpers.ts | 2 +- .../stems/src/assets/styles/animations.css | 3 ++- .../src/components/Button/Button.module.css | 4 +-- .../components/collection/desktop/Artwork.tsx | 13 +++++++++- .../desktop/CollectionHeader.module.css | 25 +++++++++---------- .../collection/desktop/FavoriteButton.tsx | 2 -- .../collection/desktop/OwnerActionButtons.tsx | 11 ++++++-- .../collection/desktop/PublishButton.tsx | 2 -- .../desktop/PublishConfirmationModal.tsx | 3 ++- .../collection/desktop/RepostButton.tsx | 2 -- .../collection/desktop/ShareButton.tsx | 3 --- .../desktop/SmartCollectionActionButtons.tsx | 9 +++++-- .../image-selection/ImageSelectionButton.js | 8 +++--- .../image-selection/ImageSelectionPopup.js | 2 ++ .../PlaylistLibrary/CollectionNavItem.tsx | 23 ++++++----------- .../PlaylistLibrary/NavItemKebabButton.tsx | 1 - .../src/components/upload/UploadArtwork.js | 5 +++- packages/web/src/pages/App.js | 10 ++++++-- .../components/ChatMessageListItem.module.css | 2 +- 19 files changed, 75 insertions(+), 55 deletions(-) diff --git a/packages/common/src/store/playlist-library/helpers.ts b/packages/common/src/store/playlist-library/helpers.ts index 5e819312eb..02e7fb6021 100644 --- a/packages/common/src/store/playlist-library/helpers.ts +++ b/packages/common/src/store/playlist-library/helpers.ts @@ -310,7 +310,7 @@ export const addFolderToLibrary = ( ): PlaylistLibrary => { return { ...(library || {}), - contents: [...(library?.contents || []), folder] + contents: [folder, ...(library?.contents || [])] } } diff --git a/packages/stems/src/assets/styles/animations.css b/packages/stems/src/assets/styles/animations.css index b20e41efcf..55313b50d3 100644 --- a/packages/stems/src/assets/styles/animations.css +++ b/packages/stems/src/assets/styles/animations.css @@ -8,5 +8,6 @@ :root, root { --quick: 0.07s ease-in-out; - --calm: 0.2s ease-in-out; + --expressive: 0.2s ease-in-out; + --calm: 0.5s ease-in-out; } diff --git a/packages/stems/src/components/Button/Button.module.css b/packages/stems/src/components/Button/Button.module.css index 046613706a..4b4f319ce5 100644 --- a/packages/stems/src/components/Button/Button.module.css +++ b/packages/stems/src/components/Button/Button.module.css @@ -59,7 +59,7 @@ } .button .icon.left.noText { - margin: 0; + margin: 0 !important; } .button .icon.right { @@ -67,7 +67,7 @@ } .button .icon.right.noText { - margin: 0; + margin: 0 !important; } .button .icon { diff --git a/packages/web/src/components/collection/desktop/Artwork.tsx b/packages/web/src/components/collection/desktop/Artwork.tsx index 4851089c66..849dc19cd6 100644 --- a/packages/web/src/components/collection/desktop/Artwork.tsx +++ b/packages/web/src/components/collection/desktop/Artwork.tsx @@ -1,6 +1,10 @@ import { ComponentType, SVGProps, useCallback, useEffect } from 'react' -import { CoverArtSizes, SquareSizes } from '@audius/common' +import { + imageBlank as placeholderArt, + CoverArtSizes, + SquareSizes +} from '@audius/common' import { Button, ButtonType, IconPencil } from '@audius/stems' import { useDispatch } from 'react-redux' @@ -54,6 +58,13 @@ export const Artwork = (props: ArtworkProps) => { ) }, [dispatch, collectionId]) + console.log({ + gradient, + imageOverride, + image, + placeholderArt + }) + return ( { text={isSaved ? messages.favorited : messages.favorite} leftIcon={} onClick={handleFavorite} - widthToHideText={BUTTON_COLLAPSE_WIDTHS.second} {...other} /> diff --git a/packages/web/src/components/collection/desktop/OwnerActionButtons.tsx b/packages/web/src/components/collection/desktop/OwnerActionButtons.tsx index b0a9112f2c..f1373e4f0b 100644 --- a/packages/web/src/components/collection/desktop/OwnerActionButtons.tsx +++ b/packages/web/src/components/collection/desktop/OwnerActionButtons.tsx @@ -27,11 +27,18 @@ export const OwnerActionButtons = (props: OwnerActionButtonProps) => { <> + - {is_private && !is_album ? ( - + ) : null} {!is_private ? ( diff --git a/packages/web/src/components/collection/desktop/PublishButton.tsx b/packages/web/src/components/collection/desktop/PublishButton.tsx index 8c62ca707a..d93926eb3d 100644 --- a/packages/web/src/components/collection/desktop/PublishButton.tsx +++ b/packages/web/src/components/collection/desktop/PublishButton.tsx @@ -15,7 +15,6 @@ import { EntityActionButton } from '../../entity-page/EntityActionButton' import styles from './CollectionHeader.module.css' import { PublishConfirmationModal } from './PublishConfirmationModal' -import { BUTTON_COLLAPSE_WIDTHS } from './utils' const { getCollection } = collectionPageSelectors const { getCollecitonHasHiddenTracks } = cacheCollectionsSelectors @@ -63,7 +62,6 @@ export const PublishButton = (props: PublishButtonProps) => { ) } onClick={_is_publishing ? undefined : toggleIsConfirming} - widthToHideText={BUTTON_COLLAPSE_WIDTHS.second} disabled={isDisabled} {...other} /> diff --git a/packages/web/src/components/collection/desktop/PublishConfirmationModal.tsx b/packages/web/src/components/collection/desktop/PublishConfirmationModal.tsx index 343a15dbe5..e98fbe08e2 100644 --- a/packages/web/src/components/collection/desktop/PublishConfirmationModal.tsx +++ b/packages/web/src/components/collection/desktop/PublishConfirmationModal.tsx @@ -40,7 +40,8 @@ export const PublishConfirmationModal = ( const handlePublish = useCallback(() => { dispatch(publishPlaylist(collectionId)) - }, [dispatch, collectionId]) + onClose() + }, [dispatch, collectionId, onClose]) return ( diff --git a/packages/web/src/components/collection/desktop/RepostButton.tsx b/packages/web/src/components/collection/desktop/RepostButton.tsx index 51a630ca5d..87331a7333 100644 --- a/packages/web/src/components/collection/desktop/RepostButton.tsx +++ b/packages/web/src/components/collection/desktop/RepostButton.tsx @@ -14,7 +14,6 @@ import { useDispatch, useSelector } from 'react-redux' import { Tooltip } from 'components/tooltip' import { EntityActionButton } from '../../entity-page/EntityActionButton' -import { BUTTON_COLLAPSE_WIDTHS } from './utils' const { getCollection } = collectionPageSelectors const { repostCollection, undoRepostCollection } = collectionsSocialActions @@ -58,7 +57,6 @@ export const RepostButton = (props: RepostButtonProps) => { text={has_current_user_reposted ? messages.reposted : messages.repost} leftIcon={} onClick={handleRepost} - widthToHideText={BUTTON_COLLAPSE_WIDTHS.third} {...other} /> diff --git a/packages/web/src/components/collection/desktop/ShareButton.tsx b/packages/web/src/components/collection/desktop/ShareButton.tsx index ebbbf5ea51..a1c6679d0a 100644 --- a/packages/web/src/components/collection/desktop/ShareButton.tsx +++ b/packages/web/src/components/collection/desktop/ShareButton.tsx @@ -13,8 +13,6 @@ import { Tooltip } from 'components/tooltip' import { EntityActionButton } from '../../entity-page/EntityActionButton' -import { BUTTON_COLLAPSE_WIDTHS } from './utils' - const { requestOpen: requestOpenShareModal } = shareModalUIActions const messages = { @@ -61,7 +59,6 @@ export const ShareButton = (props: ShareButtonProps) => { type={type ?? ButtonType.COMMON} text={messages.share} leftIcon={} - widthToHideText={BUTTON_COLLAPSE_WIDTHS.second} onClick={handleShare} {...other} /> diff --git a/packages/web/src/components/collection/desktop/SmartCollectionActionButtons.tsx b/packages/web/src/components/collection/desktop/SmartCollectionActionButtons.tsx index a9326356e7..f809756ba7 100644 --- a/packages/web/src/components/collection/desktop/SmartCollectionActionButtons.tsx +++ b/packages/web/src/components/collection/desktop/SmartCollectionActionButtons.tsx @@ -2,6 +2,7 @@ import { ID, SmartCollectionVariant } from '@audius/common' import { FavoriteButton } from './FavoriteButton' import { ShareButton } from './ShareButton' +import { BUTTON_COLLAPSE_WIDTHS } from './utils' type SmartCollectionActionButtonsProps = { collectionId: SmartCollectionVariant @@ -14,8 +15,12 @@ export const SmartCollectionActionButtons = ( const { collectionId, userId } = props return collectionId === SmartCollectionVariant.AUDIO_NFT_PLAYLIST ? ( - + ) : ( - + ) } diff --git a/packages/web/src/components/image-selection/ImageSelectionButton.js b/packages/web/src/components/image-selection/ImageSelectionButton.js index 8b2f9e773c..759f36bb3d 100644 --- a/packages/web/src/components/image-selection/ImageSelectionButton.js +++ b/packages/web/src/components/image-selection/ImageSelectionButton.js @@ -18,6 +18,7 @@ const messages = { } const ImageSelectionButton = ({ + anchorRef: anchorRefProp, wrapperClassName, buttonClassName, hasImage, @@ -32,7 +33,7 @@ const ImageSelectionButton = ({ source, defaultPopupOpen = false }) => { - const anchorRef = useRef() + const anchorRefInner = useRef() const [showModal, setShowModal] = useState(defaultPopupOpen) const closeModal = () => { @@ -65,7 +66,7 @@ const ImageSelectionButton = ({ {includePopup ? ( <>