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(ui-tabs): add active property to tabs #1327

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

joyenjoyer
Copy link
Contributor

@joyenjoyer joyenjoyer commented Oct 18, 2023

Closes: INSTUI-3876

Add support for multiple tabs->one tab panel. This makes using React Router easier with less boilerplate code.

Test plan: check if the new example in the Tabs page works fine.

@github-actions
Copy link

Preview URL: https://1327--preview-instui.netlify.app

@joyenjoyer joyenjoyer force-pushed the INSTUI-3876_tabs_react_router branch from 5d43dfb to 05f8708 Compare October 19, 2023 20:06
@joyenjoyer joyenjoyer self-assigned this Oct 19, 2023
@joyenjoyer joyenjoyer requested review from matyasf and balzss October 19, 2023 20:09
@joyenjoyer joyenjoyer marked this pull request as ready for review October 19, 2023 20:09
Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

Looks good. While I'm not a fan of this new API (its confusing, e.g. why am I able to specify children to all tabs when 1 will be rendered anyway?) I guess we cant do more without breaking changes. In the future we should switch to a similar structure as material-ui IMO https://mui.com/material-ui/react-tabs/#experimental-api

@joyenjoyer joyenjoyer force-pushed the INSTUI-3876_tabs_react_router branch 2 times, most recently from 77cee34 to 3c4e72f Compare October 20, 2023 12:23
@joyenjoyer joyenjoyer force-pushed the INSTUI-3876_tabs_react_router branch 2 times, most recently from 4144e40 to 6d2e2f6 Compare October 20, 2023 15:00
Closes: INSTUI-3876

Add support for multiple tabs->one tab panel. This makes
using React Router easier with less boilerplate code.
@joyenjoyer joyenjoyer force-pushed the INSTUI-3876_tabs_react_router branch from 6d2e2f6 to 5389732 Compare October 23, 2023 18:32
expect(childContent).toBeNull()
})

it('should render the same content in second tab when selected', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a test as you requested. @matyasf

@joyenjoyer joyenjoyer merged commit 5037855 into master Oct 23, 2023
4 checks passed
@joyenjoyer joyenjoyer deleted the INSTUI-3876_tabs_react_router branch October 23, 2023 18:53
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.

3 participants