Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ONYX-1294): redesign badges and urgency signals on artwork card #11005

Conversation

dariakoko
Copy link
Contributor

@dariakoko dariakoko commented Oct 23, 2024

This PR resolves ONYX-1294

Description

Increased Interest Increased Interest Artwork screen Curators' pick Curators' pick Artwork screen Limited-Time Offer Limited-Time Offer and Increased interest on the Grid Hight demand Signal in MyCollection
image image image image image image image

Redesign badges and urgency signals on artwork card

  • remove Limited-Time Offer badge from the artwork
  • add original artwork price to the Limited-Time Offer artwork
  • change the copy Expired for Limited-Time Offer artwork
  • redesign the Curators pick badge
  • redesign Increased interest badge
  • move the new badge under the artwork's metadata
  • redesign the Hight Demand indicator in MyCollection

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

  • redesign badges and urgency signals on artwork card - daria

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

@dariakoko dariakoko self-assigned this Oct 23, 2024
src/app/Components/ArtworkGrids/ArtworkGridItem.tsx Outdated Show resolved Hide resolved
src/app/Components/ArtworkGrids/ArtworkGridItem.tsx Outdated Show resolved Hide resolved
src/app/Components/ArtworkGrids/ArtworkSocialSignal.tsx Outdated Show resolved Hide resolved
src/app/Components/ArtworkRail/ArtworkRailCardMeta.tsx Outdated Show resolved Hide resolved
src/app/Components/ArtworkRail/ArtworkRailCardMeta.tsx Outdated Show resolved Hide resolved
@@ -84,7 +84,9 @@ export const saleMessageOrBidInfo = ({
}

if (collectorSignals?.partnerOffer?.isAvailable) {
return collectorSignals.partnerOffer.priceWithDiscount?.display
const salePrice = artwork.saleMessage && `~${artwork.saleMessage}~`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these ~ intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. saleMessageOrBidInfo returns a string and we display it in a Text component. For the LTO we will need to return discounted price as well as original price and the original price has to have line-through text decoration. In order to not change the returned type I came up with this solution - mark the text that has to have line-through decoration with ~ symbol and then parse the returned string. I'm not sure if this is the best approach, but it seems to work and doesn't require a lot of testing

Copy link
Member

@anandaroop anandaroop Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Should that be handled with a ternary instead of a && though?

I'm wondering if it's possible that artwork.saleMessage could be null or undefined, in which case this could render in an undesirable way with the && trick.

See what I mean…
$ node

// works ok with a valid message 

> saleMessage = "valid message"
> salePrice = saleMessage && `~${saleMessage}~` 
> `sometext${salePrice}`
'sometext~valid message~'

// could look weird with a null message

> saleMessage = null
> salePrice = saleMessage && `~${saleMessage}~` 
> `sometext${salePrice}`
'sometextnull'

// but ternary fixes it

> saleMessage = null
> salePrice = saleMessage ? `~${saleMessage}~` : ''
> `sometext${salePrice}`
'sometext'

(It is possible for an artwork sale message to be null in Gravity, under certain conditions)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I missed that 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great solution. To make it more obvious what's happening it could be good to extract the logic into a serialize and a parse function (maybe just declared within the same file). Alternatively two comments could also help to understand when reading the code.

Extracting the logic would be my favorite :)

@dariakoko dariakoko marked this pull request as ready for review October 24, 2024 14:08
@ArtsyOpenSource
Copy link
Contributor

ArtsyOpenSource commented Oct 24, 2024

This PR contains the following changes:

  • Cross-platform user-facing changes (redesign badges and urgency signals on artwork card - daria - dariakoko)

Generated by 🚫 dangerJS against ca2d19d

@dariakoko dariakoko requested review from MounirDhahri and a team and removed request for MounirDhahri October 24, 2024 15:09
@@ -84,7 +84,9 @@ export const saleMessageOrBidInfo = ({
}

if (collectorSignals?.partnerOffer?.isAvailable) {
return collectorSignals.partnerOffer.priceWithDiscount?.display
const salePrice = artwork.saleMessage && `~${artwork.saleMessage}~`
Copy link
Member

@anandaroop anandaroop Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Should that be handled with a ternary instead of a && though?

I'm wondering if it's possible that artwork.saleMessage could be null or undefined, in which case this could render in an undesirable way with the && trick.

See what I mean…
$ node

// works ok with a valid message 

> saleMessage = "valid message"
> salePrice = saleMessage && `~${saleMessage}~` 
> `sometext${salePrice}`
'sometext~valid message~'

// could look weird with a null message

> saleMessage = null
> salePrice = saleMessage && `~${saleMessage}~` 
> `sometext${salePrice}`
'sometextnull'

// but ternary fixes it

> saleMessage = null
> salePrice = saleMessage ? `~${saleMessage}~` : ''
> `sometext${salePrice}`
'sometext'

(It is possible for an artwork sale message to be null in Gravity, under certain conditions)

@dariakoko dariakoko merged commit 18cab4f into main Oct 25, 2024
7 checks passed
@dariakoko dariakoko deleted the dariakoko/ONYX-1294/redesign-badges-and-urgency-signals-on-artwork-card branch October 25, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants