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(EmptyState): new component #1514

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YossiSaadi
Copy link
Contributor

@YossiSaadi YossiSaadi commented Aug 31, 2023

@YossiSaadi YossiSaadi requested a review from a team August 31, 2023 07:12
@YossiSaadi YossiSaadi force-pushed the feat/yossi/EmptySate---new-component-5075443870 branch from 7eaaa0d to a67ccbc Compare August 31, 2023 07:21
export interface EmptyStateProps extends VibeComponentProps {
imgSrc: string;
title: string;
body: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if body is the best name for it... Maybe just text, message or smth else?

Copy link
Contributor

Choose a reason for hiding this comment

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

content?

Comment on lines +15 to +22
imgSrc: string;
title: string;
body: string;
onPrimaryActionClick?: () => void;
primaryActionLabel?: string;
onSecondaryActionClick?: () => void;
secondaryActionLabel?: string;
imgClassName?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Some description comments would be nice

<img src={imgSrc} alt={title} className={cx(styles.image, imgClassName)} />
<Flex direction={Flex.directions.COLUMN} gap={Flex.gaps.SMALL} align={Flex.align.CENTER}>
<Heading type={Heading.types.H2}>{title}</Heading>
<Text type={Text.types.TEXT1}>{body}</Text>
Copy link
Contributor

Choose a reason for hiding this comment

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

Always one line here by design?

Copy link
Contributor

Choose a reason for hiding this comment

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

I have a concern about what's gonna happen if people put a lot of text here - attaching screenshots to demonstrate
image
image
image

We should think about some max-width limitations, so the text will just go ellipsis with a tooltip when it's reaching the limits

Comment on lines +62 to +67
{secondaryActionLabel && (
<Button kind={Button.kinds.TERTIARY} onClick={onSecondaryActionClick}>
{secondaryActionLabel}
</Button>
)}
{primaryActionLabel && <Button onClick={onPrimaryActionClick}>{primaryActionLabel}</Button>}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, but people might use secondaryButton without the primary one, which won't be good. Perhaps, we can protect from this from the beginning

@SergeyRoyt
Copy link
Contributor

Maybe also worth adding RelatedComponents, if u can think of any - just to be consistent

@SergeyRoyt
Copy link
Contributor

I'd also consider what's needed to be done here (same story in LegacyHeading also)
image

Maybe we can just add some text and reference the new component there

@YossiSaadi
Copy link
Contributor Author

Maybe also worth adding RelatedComponents, if u can think of any - just to be consistent

great suggestion, for the meantime Yael and I agreed that since we need to "run" with it quick, the story would be very minimal

Copy link
Contributor

@shlomitc shlomitc left a comment

Choose a reason for hiding this comment

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

worth adding also an example in the Table component page and see it in a real use case

export interface EmptyStateProps extends VibeComponentProps {
imgSrc: string;
title: string;
body: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

content?

import Button from "../Button/Button";

export interface EmptyStateProps extends VibeComponentProps {
imgSrc: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

an empty state would also need support SVG, Lottie and maybe at some point different assets. why not keep this as a general node? this would also make imgClassName redundant

Comment on lines +58 to +59
<Heading type={Heading.types.H2}>{title}</Heading>
<Text type={Text.types.TEXT1}>{body}</Text>
Copy link
Contributor

Choose a reason for hiding this comment

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

general suggestion - apply Heading and Text only when string type is passed, so in cases where other content will be passed, it will not always be wrapped with the typography component constaraints

Comment on lines +58 to +59
<Heading type={Heading.types.H2}>{title}</Heading>
<Text type={Text.types.TEXT1}>{body}</Text>
Copy link
Contributor

Choose a reason for hiding this comment

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

this would apply ellipsis by default if I understand correctly, not sure this is the expected behavior for the empty state

Comment on lines +18 to +19
onPrimaryActionClick?: () => void;
primaryActionLabel?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the abstraction to have very simple actionable button props, but take into consideration that if in the future some a11y props will be needed, we might want to pass the entire props easily primaryActionProps

@YossiSaadi
Copy link
Contributor Author

@shlomitc @SergeyRoyt you had great suggestions, I'll go over the content/design-related also with Yael/Meirav
Thanks! :)

@YossiSaadi YossiSaadi marked this pull request as draft September 6, 2023 06:50
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.

3 participants