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(Rows): simplify component's logic, implement withChevron prop and allow right with controls #1122

Merged
merged 12 commits into from
May 22, 2024

Conversation

marcoskolodny
Copy link
Collaborator

@marcoskolodny marcoskolodny commented May 9, 2024

Issues:

To do list:

  • Reimplement row's logic
  • Allow right + controls
  • Fix logic for withChevron prop
  • Make usage of role/dataAttributes/ref consistent between different use cases
  • Verify that projects using Rows are not affected by these changes:

Copy link

github-actions bot commented May 9, 2024

Accessibility report
✔️ No issues found

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

Copy link

github-actions bot commented May 9, 2024

Size stats

master this branch diff
Total JS 10.7 MB 10.7 MB -3.3 kB
JS without icons 1.93 MB 1.92 MB -3.3 kB
Lib overhead 52.1 kB 52.1 kB 0 B
Lib overhead (gzip) 14 kB 14 kB 0 B

Copy link

github-actions bot commented May 9, 2024

Deploy preview for mistica-web ready!

✅ Preview
https://mistica-mt18pd2eg-flows-projects-65bb050e.vercel.app

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

Copy link

github-actions bot commented May 9, 2024

Screenshot tests report

✔️ All passing

@@ -127,6 +127,7 @@ interface BaseProps {
bleedLeft?: boolean;
bleedRight?: boolean;
bleedY?: boolean;
role?: string;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unrelated. Added role prop to iconButton (other buttons have it)

src/list.tsx Outdated Show resolved Hide resolved
@marcoskolodny marcoskolodny changed the title feat(Rows): simplify component's logic, implement showChevron prop and allow right with controls feat(Rows): simplify component's logic, implement withChevron prop and allow right with controls May 10, 2024
const renderRight = (right: Right, centerY: boolean) => {
if (typeof right === 'function') return right?.({centerY});

return centerY ? (
<div style={{display: 'flex', alignItems: 'center', height: '100%'}}>{right}</div>
<div style={{display: 'flex', alignItems: 'center', height: '100%'}}>
<div>{right}</div>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

wrapping this inside a div, because of this case. We don't want to force display: flex in the extra content by default. By wrapping right inside an interior div, we avoid this (but we center the content).

If we try to use flexDirection: column instead of wrapping the content with a div, it will affect other scenarios, like the same one from above but replacing divs with spans.

@marcoskolodny marcoskolodny marked this pull request as ready for review May 10, 2024 17:42
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.

I don't really like the idea to have the possibility of remove chevron icon with href, but..

atabel

This comment was marked as resolved.

@atabel atabel requested a review from Marcosld May 21, 2024 14:12
@marcoskolodny
Copy link
Collaborator Author

I miss some new cases in list-type-test.tsx covering the changes in this PR

I've added some tests covering scenario of right+controls. I've also added some tests related to withChevron prop, but this is not something introduced in this PR. This prop already existed, but it had no effect in the component

@pladaria
Copy link
Member

pladaria commented May 22, 2024

Size stats

master this branch diff
Total JS 10.7 MB 10.7 MB -3.3 kB
JS without icons 1.93 MB 1.92 MB -3.3 kB
Lib overhead 52.1 kB 52.1 kB 0 B
Lib overhead (gzip) 14 kB 14 kB 0 B

that's nice!

@marcoskolodny marcoskolodny requested a review from atabel May 22, 2024 14:53
@atabel atabel added this pull request to the merge queue May 22, 2024
Merged via the queue into master with commit eb987e4 May 22, 2024
11 checks passed
@atabel atabel deleted the WEB-1827-refactor-rows branch May 22, 2024 15:27
tuentisre pushed a commit that referenced this pull request May 22, 2024
# [15.9.0](v15.8.0...v15.9.0) (2024-05-22)

### Features

* **Rows:** simplify component's logic, implement withChevron prop and allow right with controls ([#1122](#1122)) ([eb987e4](eb987e4))
@tuentisre
Copy link
Collaborator

🎉 This PR is included in version 15.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

None yet

7 participants