diff --git a/ui/component/claimList/view.jsx b/ui/component/claimList/view.jsx index 456c23e0f..3531e4d59 100644 --- a/ui/component/claimList/view.jsx +++ b/ui/component/claimList/view.jsx @@ -78,8 +78,6 @@ export default function ClaimList(props: Props) { noEmpty, } = props; - console.log('noempty', noEmpty); - const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW); // Exclude prefix uris in these results variables. We don't want to show diff --git a/ui/component/claimPreview/collection-buttons.jsx b/ui/component/claimPreview/collection-buttons.jsx new file mode 100644 index 000000000..2fe51f927 --- /dev/null +++ b/ui/component/claimPreview/collection-buttons.jsx @@ -0,0 +1,118 @@ +// @flow +import React from 'react'; +import Button from 'component/button'; +import * as ICONS from 'constants/icons'; +type Props = { + collectionIndex?: number, + editCollection: (string, CollectionEditParams) => void, + listId?: string, + lastCollectionIndex?: number, + claim: ?Claim, +}; + +function CollectionButtons(props: Props) { + const { collectionIndex, editCollection, listId, lastCollectionIndex, claim } = props; + const [confirmDelete, setConfirmDelete] = React.useState(false); + return ( +
+
+
+
+
+ {!confirmDelete && ( +
+
+ )} + {confirmDelete && ( +
+
+ )} +
+ ); +} + +export default CollectionButtons; diff --git a/ui/component/claimPreview/view.jsx b/ui/component/claimPreview/view.jsx index f5735efcd..8903c28c2 100644 --- a/ui/component/claimPreview/view.jsx +++ b/ui/component/claimPreview/view.jsx @@ -25,8 +25,7 @@ import ClaimMenuList from 'component/claimMenuList'; import ClaimPreviewLoading from './claim-preview-loading'; import ClaimPreviewHidden from './claim-preview-no-mature'; import ClaimPreviewNoContent from './claim-preview-no-content'; -import Button from 'component/button'; -import * as ICONS from 'constants/icons'; +import CollectionEditButtons from './collection-buttons'; import AbandonedChannelPreview from 'component/abandonedChannelPreview'; @@ -151,7 +150,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { } = props; const isCollection = claim && claim.value_type === 'collection'; const collectionClaimId = isCollection && claim && claim.claim_id; - const listId = collectionId || collectionClaimId; + const listId = collectionId || collectionClaimId || null; const WrapperElement = wrapperElement || 'li'; const shouldFetch = claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending); @@ -347,8 +346,18 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { 'claim-preview--channel': isChannelUri, 'claim-preview--visited': !isChannelUri && !claimIsMine && hasVisitedUri, 'claim-preview--pending': pending, + 'claim-preview--collection-mine': isMyCollection && listId && type === 'listview', })} > + {isMyCollection && listId && type === 'listview' && ( + + )} {isChannelUri && claim ? ( @@ -396,58 +405,6 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { {!pending && ( <> {renderActions && claim && renderActions(claim)} - {Boolean(isMyCollection && listId) && ( - <> -
-
-
-
-
-
- - )} {shouldHideActions || renderActions ? null : actions !== undefined ? ( actions ) : ( diff --git a/ui/component/collectionEdit/view.jsx b/ui/component/collectionEdit/view.jsx index 9a0fa3b98..108e21493 100644 --- a/ui/component/collectionEdit/view.jsx +++ b/ui/component/collectionEdit/view.jsx @@ -358,7 +358,12 @@ function CollectionForm(props: Props) { - + ), - [ICONS.UP]: buildIcon(), + [ICONS.UP]: buildIcon( + + + + ), + [ICONS.UP_TOP]: buildIcon( + + + + ), + [ICONS.DOWN_BOTTOM]: buildIcon( + + + + ), [ICONS.DOWN]: buildIcon(), [ICONS.FULLSCREEN]: buildIcon( diff --git a/ui/component/fileDescription/view.jsx b/ui/component/fileDescription/view.jsx index 4b045822e..9d20526c7 100644 --- a/ui/component/fileDescription/view.jsx +++ b/ui/component/fileDescription/view.jsx @@ -27,7 +27,7 @@ function FileDescription(props: Props) { const { uri, claim, metadata, pendingAmount, doOpenModal, claimIsMine, expandOverride } = props; const [expanded, setExpanded] = React.useState(false); const [showCreditDetails, setShowCreditDetails] = React.useState(false); - const amount = parseFloat(claim.amount) + parseFloat(pendingAmount || claim.meta.support_amount); + const amount = claim ? parseFloat(claim.amount) + parseFloat(pendingAmount || claim.meta.support_amount) : undefined; const formattedAmount = formatCredits(amount, 2, true); const hasSupport = claim && claim.meta && claim.meta.support_amount && Number(claim.meta.support_amount) > 0; diff --git a/ui/constants/icons.js b/ui/constants/icons.js index e707d3adb..c0a4e05d6 100644 --- a/ui/constants/icons.js +++ b/ui/constants/icons.js @@ -65,7 +65,9 @@ export const OPTIONS = 'Sliders'; export const YES = 'ThumbsUp'; export const NO = 'ThumbsDown'; export const UP = 'ChevronUp'; +export const UP_TOP = 'ChevronUpTop'; export const DOWN = 'ChevronDown'; +export const DOWN_BOTTOM = 'ChevronDownBottom'; export const SECURE = 'Lock'; export const MENU = 'Menu'; export const BACKUP = 'Database'; diff --git a/ui/page/collection/view.jsx b/ui/page/collection/view.jsx index eb173f7c4..994620cb6 100644 --- a/ui/page/collection/view.jsx +++ b/ui/page/collection/view.jsx @@ -188,7 +188,7 @@ export default function CollectionPage(props: Props) {
{info} - +
); diff --git a/ui/scss/component/_button.scss b/ui/scss/component/_button.scss index 7f32e6929..18e03e756 100644 --- a/ui/scss/component/_button.scss +++ b/ui/scss/component/_button.scss @@ -604,30 +604,55 @@ svg + .button__label { } } -.button-collection-order { - height: 100%; +.button-collection-manage { font-size: var(--font-base); border-left-width: 0; - border-radius: 0; margin: 0; - color: var(--color-text); + width: 100%; button { - padding: var(--spacing-xs); + padding: var(--spacing-xxs); + } + + .button__content { + display: unset; + } + line-height: 1.2; + font-weight: var(--font-weight-bold); + height: 100%; + background-color: var(--color-button-alt-bg); + color: var(--color-button-alt-text); + text-align: center; + &:hover { + background-color: var(--color-button-alt-bg-hover); + } + + @media (max-width: $breakpoint-small) { + font-size: var(--font-small); } @media (max-width: $breakpoint-small) { padding: var(--spacing-s) var(--spacing-s); } - &:first-of-type { - border-left-width: 1px; + &.top-right { + border-top-right-radius: var(--border-radius); + } + &.top-left { border-top-left-radius: var(--border-radius); + } + &.bottom-right { + border-bottom-right-radius: var(--border-radius); + } + &.bottom-left { border-bottom-left-radius: var(--border-radius); } - &:last-of-type { - border-top-right-radius: var(--border-radius); - border-bottom-right-radius: var(--border-radius); + &.button-collection-delete-confirm { + background-color: green; + } + + &.button-collection-delete-cancel { + background-color: red; } } diff --git a/ui/scss/component/_claim-list.scss b/ui/scss/component/_claim-list.scss index 8aed6c484..4d9a27057 100644 --- a/ui/scss/component/_claim-list.scss +++ b/ui/scss/component/_claim-list.scss @@ -215,6 +215,11 @@ } } +.claim-preview--collection-mine { + padding-left: 7rem; + position: relative; +} + .claim-preview--pending { opacity: 0.6; } diff --git a/ui/scss/component/_collection.scss b/ui/scss/component/_collection.scss index eac2afc07..0aa72987d 100644 --- a/ui/scss/component/_collection.scss +++ b/ui/scss/component/_collection.scss @@ -86,22 +86,27 @@ } .collection-preview__edit-buttons { - display: flex; - flex-direction: row; - margin-top: var(--spacing-xs); - margin-bottom: var(--spacing-xs); + position: absolute; + left: 0; + top: calc(-1 * var(--spacing-m)); + bottom: calc(-1 * var(--spacing-m)); + padding-left: 0; + padding-top: var(--spacing-m); + padding-bottom: var(--spacing-m); + display: grid; + grid-template-columns: 1fr 1fr 1fr; + align-items: center; } .collection-preview__edit-group { - &:not(:last-of-type) { - margin-right: var(--spacing-s); - } - margin-right: var(--spacing-s); - button { - @media (max-width: $breakpoint-small) { - padding: var(--spacing-s) var(--spacing-s); - } - } + height: 100%; + display: flex; + flex-direction: column; + width: 2rem; + align-items: center; + justify-content: center; + align-items: stretch; + flex-grow: 4; } .collection-edit__header { diff --git a/ui/scss/component/_media.scss b/ui/scss/component/_media.scss index 06bd1c822..c5efb2124 100644 --- a/ui/scss/component/_media.scss +++ b/ui/scss/component/_media.scss @@ -75,7 +75,7 @@ .media__info-text--contracted { margin-top: var(--spacing-m); - max-height: 5rem; + max-height: 3rem; overflow: hidden; } @@ -90,7 +90,7 @@ } .media__info-text--fade { - -webkit-mask-image: -webkit-gradient(linear, left 55%, left bottom, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0))); + -webkit-mask-image: -webkit-gradient(linear, left 30%, left bottom, from(rgba(0, 0, 0, 1)), to(rgba(0, 0, 0, 0))); overflow-wrap: anywhere; }