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: add document styles in Builder #562

Merged
merged 9 commits into from
Mar 6, 2023
Merged

Conversation

codeofmochi
Copy link
Contributor

@codeofmochi codeofmochi commented Feb 18, 2023

Closes #509

Implements document styles (as Alert components).

This PR also refactors ItemContent with better typing: the item is first checked against its typed, and each item type now has a corresponding content component. This allows only invoking hooks only when they are actually needed, and the item extras are now correctly typed according to their discriminated union type (thanks to @spaenleh's work). It also provides cleaner loading and error handling logic, since they are scoped to however the item type behaves / fails.

Kapture.2023-02-20.at.17.01.18.webm

@codeofmochi codeofmochi added the feature New feature or request label Feb 18, 2023
@codeofmochi codeofmochi self-assigned this Feb 18, 2023
@codeofmochi codeofmochi marked this pull request as ready for review February 24, 2023 15:18
Copy link
Contributor

@pyphilia pyphilia left a comment

Choose a reason for hiding this comment

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

LGTM 🧈

src/components/item/ItemContent.tsx Show resolved Hide resolved
src/components/item/form/DocumentForm.tsx Outdated Show resolved Hide resolved
@codeofmochi codeofmochi changed the title feat: add document style flavors feat: add document style in Builder Mar 6, 2023
@codeofmochi codeofmochi changed the title feat: add document style in Builder feat: add document styles in Builder Mar 6, 2023
@codeofmochi codeofmochi merged commit 747f95c into main Mar 6, 2023
@codeofmochi codeofmochi deleted the 509-document-flavor branch March 6, 2023 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add document box styles
2 participants