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: TET-363 tag #73

Closed
wants to merge 2 commits into from
Closed

feat: TET-363 tag #73

wants to merge 2 commits into from

Conversation

MartaKozina010
Copy link
Contributor

No description provided.

@MartaKozina010 MartaKozina010 temporarily deployed to development October 2, 2023 19:58 — with GitHub Actions Inactive
label: BaseProps;
closeButton?: BaseProps;
};
beforeComponent: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

beforeComponent should be in innerElements, and optional

src/components/Tag/Tag.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@mwleklinski mwleklinski left a comment

Choose a reason for hiding this comment

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

Looks, really good, minor comments

label: BaseProps;
closeButton?: BaseProps;
};
beforeComponent: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it should also be optional, so that when user is passing the custom prop it won't require it

state: (typeof states)[number];
}) => (
<tet.div flexBasis="120px" flexGrow="1" flexShrink="0">
<Tag
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think Tag in TagDocs should be clickable to feel more "interactive" so I would pass some empty "onClick" here

[onCloseClick],
);

const containerRef = useRef<HTMLSpanElement | null>(null);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move it before handleOnClose Click

return {
container: {
...container,
...(hasOnClick ? hasOnClickStyles : {}),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be also ...(hasOnClick && hasOnClickStyles)

onClick={handleOnCloseClick}
state={state}
{...styles.closeButton}
data-testid="tag-icon-button"
Copy link
Collaborator

Choose a reason for hiding this comment

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

tag-iconButton

size="2xSmall"
{...beforeComponent.props}
{...styles.avatar}
data-testid="tag-before-component"
Copy link
Collaborator

Choose a reason for hiding this comment

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

tag-avatar

>
{label}
</tet.p>
{!!onCloseClick && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{!!onCloseClick && (
{hasCloseButton && (

@MartaKozina010 MartaKozina010 temporarily deployed to development October 3, 2023 16:21 — with GitHub Actions Inactive
@adrian-potepa
Copy link
Collaborator

PR moved to https://github.com/VirtusLab/tetrisly-react/pull/89/files on rebased (with main) branch.

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