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

Refactor the mode toggle into own component #177

Merged
merged 2 commits into from
Aug 16, 2024

Conversation

sergei-maertens
Copy link
Member

Required for #175, which needs a similar mode toggle.

The existing duplication is now captured in a single, re-usable component.

Currently there are 'display' mode toggles in the component preview
side panel and the columns preview (desktop vs mobile). The full form
preview will also have a toggle mode between 'structure' and 'webform',
so instead of copying over the same implementation, this is extracted
as its own re-usable component.

Added the implementation, type integration and Storybook story + docs.
The preview toggle is re-implemented based on the toggle mode component
so that it can be re-used in the preview panel and the content edit
form.

The component is moved to its own component file to declutter and make
it more clear where each component is implemented.

The ComponentPreview is cleaned up to make use of the new component,
and the same applies for the Content edit form.
@sergei-maertens sergei-maertens merged commit 4a175fa into main Aug 16, 2024
13 checks passed
@sergei-maertens sergei-maertens deleted the refactor/mode-toggle branch August 16, 2024 13:00
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.

1 participant