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

Add promo cards to HomeScene #4687

Merged
merged 6 commits into from
Jan 12, 2024
Merged

Add promo cards to HomeScene #4687

merged 6 commits into from
Jan 12, 2024

Conversation

Jon-edge
Copy link
Collaborator

@Jon-edge Jon-edge commented Jan 6, 2024

Pending close button functionality

Screenshot 2024-01-11 at 3 44 22 PM Screenshot 2024-01-11 at 3 44 28 PM

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

@Jon-edge Jon-edge force-pushed the jon/ui4/promo-card-int branch from 02b0d87 to 35b3150 Compare January 6, 2024 01:25
src/components/ui4/scenes/HomeSceneUi4.tsx Outdated Show resolved Hide resolved
src/components/ui4/scenes/HomeSceneUi4.tsx Outdated Show resolved Hide resolved
src/components/ui4/scenes/HomeSceneUi4.tsx Outdated Show resolved Hide resolved
src/components/ui4/scenes/HomeSceneUi4.tsx Outdated Show resolved Hide resolved
src/components/ui4/scenes/HomeSceneUi4.tsx Outdated Show resolved Hide resolved
src/components/ui4/scenes/HomeSceneUi4.tsx Outdated Show resolved Hide resolved
<EdgeAnim style={{ height: theme.rem(11.5) }} enter={{ type: 'fadeInUp', distance: 30 }}>
<CarouselUi4 height={theme.rem(10)} width={screenWidth}>
{promos.map(promoInfo => (
<PromoCardUi4 navigation={navigation} promoInfo={promoInfo} key={promoInfo.localeMessages[0]} />
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be localeMessages[language] or something like that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's just the key and we're guaranteed the first localeMessage

Copy link
Member

Choose a reason for hiding this comment

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

But we shouldn't be using the first message. We should be using the one that matches the language.

Copy link
Member

@paullinator paullinator Jan 10, 2024

Choose a reason for hiding this comment

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

We should be using the language, not the first entry. That's why we even have a localeMessage in the first place.

@Jon-edge Jon-edge force-pushed the jon/ui4/promo-card-int branch from 35b3150 to f54125a Compare January 10, 2024 03:02
@Jon-edge
Copy link
Collaborator Author

Jon-edge commented Jan 10, 2024

Close functionality is broken in that the CarouselUi4 doesn't properly handle removals from its children array.

Punted and created a spinoff task: https://app.asana.com/0/1200382638405084/1206315466361645/f

@Jon-edge Jon-edge force-pushed the jon/ui4/promo-card-int branch from 1d206b3 to 201713e Compare January 10, 2024 04:08
if (osVersions != null && osVersions.length > 0 && !osVersions.includes(osVersion.toString())) return false

// Validate date range
const startDate = startIsoDate != null && !isNaN(Date.parse(startIsoDate)) ? new Date(startIsoDate) : null
Copy link
Member

Choose a reason for hiding this comment

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

Iso dates can be lexographically compared. No need to convert with new Date. Just do

const currentIsoDate = new Date().toISOString()
if (startIsoDate > currentIsoDate) return false
if (endIsoDate < currentIsoDate) return false

Copy link
Member

@paullinator paullinator left a comment

Choose a reason for hiding this comment

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

Fix android version, use v1/rollup, use proper language

@Jon-edge Jon-edge force-pushed the jon/ui4/promo-card-int branch 4 times, most recently from 8eca0c3 to a16e808 Compare January 11, 2024 02:37
@paullinator paullinator force-pushed the jon/ui4/promo-card-int branch from a16e808 to 26d9544 Compare January 11, 2024 05:41
Copy link
Member

@paullinator paullinator left a comment

Choose a reason for hiding this comment

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

I added a commit to clean the osVersion into semver. After rebasing on develop, visuals look broken. Needs to be fixed before merge.

paullinator

This comment was marked as duplicate.

@paullinator
Copy link
Member

Broken visuals attached.

  1. Learn and Promocard do not align on the left side. Need to fix while keeping the dots centered
  2. Markets preview has totally broken spacing
  3. Not quite "broken" but the CTA button on promo card is way too big. This was always supposed to have a different button component than ButtonUi4. Something like CardMiniButton which should have its own theme entry since it will likely need a different color.
Screenshot 2024-01-10 at 22 17 40 Screenshot 2024-01-10 at 22 17 32

@Jon-edge Jon-edge force-pushed the jon/ui4/promo-card-int branch from c1bf673 to bca3f70 Compare January 11, 2024 23:27
@Jon-edge Jon-edge force-pushed the jon/ui4/promo-card-int branch 7 times, most recently from d85b635 to 60e971a Compare January 11, 2024 23:56
Clean up style logic and add mini button.

- Rename styles to make it more clear.
- Since we need different padding and height for mini buttons, make sure marginRem and paddingRem are always last in the styles list so they can continue to override built-in layouts.
Per UI4's split 0.5rem spacing expectations, roll those margins into CarouselUi4 so it always goes outside of those margins horizontally to fill up 100% of the width.
- Fixed height, accomodating a maximum of 4 lines of text. Potentially adjusted once average content length is given.
- No text shrinking for readability.
@Jon-edge Jon-edge force-pushed the jon/ui4/promo-card-int branch from 60e971a to 1425f6f Compare January 12, 2024 00:24
@Jon-edge Jon-edge enabled auto-merge January 12, 2024 00:25
@Jon-edge Jon-edge merged commit 09bcb81 into develop Jan 12, 2024
2 checks passed
@Jon-edge Jon-edge deleted the jon/ui4/promo-card-int branch January 12, 2024 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants