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: added mediaView for image and theme for button in banner block #794

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

VitaliiDC8
Copy link
Contributor

No description provided.

@VitaliiDC8
Copy link
Contributor Author

#787

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@@ -20,4 +20,7 @@ import * as BannerStories from './Banner.stories.tsx';
`color?: string` — Background color

`button: Button` — Button

`mediaView?: full | fit` — full is default value, the media content covers all widht and height. Fit - media content has real sizes and locates in the middle
Copy link
Collaborator

Choose a reason for hiding this comment

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

typos in width word

@@ -143,7 +143,8 @@ export interface BannerCardProps {
disableCompress?: boolean;
color?: ThemeSupporting<string>;
theme?: TextTheme;
button: Pick<ButtonProps, 'text' | 'url' | 'target'>;
button: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;
mediaView?: 'fit' | 'full';
Copy link
Collaborator

Choose a reason for hiding this comment

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

You are configuring object-fit, it can have the values 'contain', 'cover', etc. I think they should be used as values for this prop. And create modifiers for these values, in your case only contain

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but in header we are using the same format. I want to keep consistence view

Copy link
Collaborator

Choose a reason for hiding this comment

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

We have a lot of settings in the header besides "object-fit".

In the case of the header, I would suggest using "contain", etc. as a value ,but I have not reviewed this code before

@gorgeousvlad what do you think ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

if we wanna get it same in Header and Banner, suppose we should create type, type MediaView = 'fit' | 'full' to use for both and keep same values.
In case we want to make them different (use contain in Banner) lets name theme different

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added MediaView type

@VitaliiDC8 VitaliiDC8 requested a review from NikitaCG February 1, 2024 10:05
@VitaliiDC8 VitaliiDC8 merged commit 4be4bc9 into main Feb 2, 2024
3 checks passed
@VitaliiDC8 VitaliiDC8 deleted the feat/add-mediaView-and-theme-button-for-banner branch February 2, 2024 09:10
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.

4 participants