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(MediaCard): add top icon support #824

Merged
merged 12 commits into from
Jul 28, 2023
Merged

Conversation

@github-actions
Copy link

github-actions bot commented Jul 18, 2023

Size stats

master this branch diff
Total JS 9.39 MB 9.39 MB +667 B
JS without icons 909 kB 910 kB +667 B
Lib overhead 127 kB 127 kB 0 B
Lib overhead (gzip) 32.8 kB 32.8 kB 0 B

@github-actions
Copy link

github-actions bot commented Jul 18, 2023

Deploy preview for mistica-web ready!

✅ Preview
https://mistica-nur5a8jud-tuentisre.vercel.app

Built with commit b1d3d00.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

github-actions bot commented Jul 18, 2023

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

src/card.tsx Outdated
@@ -407,6 +407,7 @@ interface MediaCardBaseProps {
subtitle?: string;
subtitleLinesMax?: number;
description?: string;
icon?: React.ReactElement
Copy link
Contributor

Choose a reason for hiding this comment

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

In figma it was called Asset, you may need to make this switch from icon to Asset
@FernandoRRosa

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, better call "asset" will be the new name for all props that contains assets. We want to make this breaking change in the next major and rename icon to asset to be more generic → #626

In my opinion, we have to embrace the new nomenclature and use asset

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmmm... I think we should still use icon, as we do in other Card components. I agree with Yayo that we have a pending rename for this prop, but we should do that rename in all the cards at the same time. That rename will be done in a future mistica major release, not now

@@ -147,6 +147,22 @@ export const mediaCardContent = style([
},
]);

export const mediaCardIcon = style([
Copy link
Contributor

Choose a reason for hiding this comment

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

If icon get changed to Asset will need to change here too.

Copy link
Contributor

@yceballost yceballost left a comment

Choose a reason for hiding this comment

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

Could you add an asset prop to playroom Media Card snippets?

group: 'Cards',
name: 'MediaCard with Image',
code: `
<MediaCard
media={<Image src="https://picsum.photos/1200/1200" aspectRatio="16:9"/>}
headline={<Tag type="promo">Headline</Tag>}
pretitle="Pretitle"
title="Title"
subtitle="Subtitle"
description="Description"
extra={<Placeholder />}
button={
<ButtonPrimary small onPress={() => {}}>
Action
</ButtonPrimary>
}
buttonLink={<ButtonLink onPress={() => {}}>Link</ButtonLink>}
/>`,
},
{
group: 'Cards',
name: 'MediaCard with Video',
code: `
<MediaCard
media={<Video src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" aspectRatio="16:9" />}
headline={<Tag color={colors.promo}>headline</Tag>}
pretitle="Pretitle"
title="Title"
subtitle="Subtitle"
description="Description"
extra={<Placeholder />}
button={
<ButtonPrimary small onPress={() => {}}>
Action
</ButtonPrimary>
}
buttonLink={<ButtonLink onPress={() => {}}>Link</ButtonLink>}
/>`,
},

for example
asset={<Avatar size={40} src="https://source.unsplash.com/600x600/?face" />}

Copy link
Contributor

@yceballost yceballost left a comment

Choose a reason for hiding this comment

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

nice 🤩

Copy link
Collaborator

Choose a reason for hiding this comment

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

what happened here?
Please review that extra bottom padding

src/card.tsx Outdated
{asset}
</Box>
) : (
<Box paddingBottom={actions?.length || onClose ? 64 : 0} />
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not needed. It's needed in other cards like DisplayMediaCard because the asset is not absolutely positioned like here.

src/card.css.ts Outdated
Comment on lines 188 to 190
paddingLeft: 24,
paddingTop: 24,
paddingBottom: 32,
Copy link
Collaborator

Choose a reason for hiding this comment

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

@aweell, it's ok to have different paddings in desktop? I don't see this in the specs.

If these are needed, we should move them to the Box element instead of creating a new media query here @thiagoaraujo-tlf:

<Box paddingLeft={{mobile: 16, desktop: 24}} paddingTop={{mobile: 16, desktop: 24}}>

Also, I think paddingRight and paddingBottom are not needed, just left and top

Copy link
Contributor

@aweell aweell Jul 26, 2023

Choose a reason for hiding this comment

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

Yes, the asset has a spacing left and top of 16 in mobile and 24 in desktop.

Mobile:
Screenshot 2023-07-26 at 17 02 43

Desktop:
Screenshot 2023-07-26 at 17 02 46

This is intended to align the asset to the content since the padding of the content increases in desktop.

The other changes, it seems they're related the content padding? They are already working in the current component.

Mobile:
Screenshot 2023-07-26 at 17 06 17

Desktop:
Screenshot 2023-07-26 at 17 05 19

Copy link
Contributor

Choose a reason for hiding this comment

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

I just added icon padding for when it's on desktop @atabel

@github-actions
Copy link

github-actions bot commented Jul 24, 2023

Screenshot tests report

✔️ All passing

@atabel atabel changed the title feat(PTIECBC03-4665): media-card circle feat(MediaCard): add top icon support Jul 28, 2023
@atabel atabel added this pull request to the merge queue Jul 28, 2023
Merged via the queue into master with commit e9a79a3 Jul 28, 2023
@atabel atabel deleted the media-card-circle-component branch July 28, 2023 14:44
@tuentisre
Copy link
Collaborator

🎉 This PR is included in version 14.19.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

tuentisre pushed a commit that referenced this pull request Jul 28, 2023
# [14.19.0](v14.18.2...v14.19.0) (2023-07-28)

### Bug Fixes

* **ButtonLink, Title:** update alignments ([#829](#829)) ([87bd3e3](87bd3e3))
* **Cards:** CardAction type ([#831](#831)) ([6631788](6631788))

### Features

* **MediaCard:** add top icon support ([#824](#824)) ([e9a79a3](e9a79a3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants