-
Notifications
You must be signed in to change notification settings - Fork 10
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
create HeadingComponent #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
components/HeadingComponent.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format the file. Tip: turn on format on save
components/HeadingComponent.tsx
Outdated
|
||
function HeadingComponent({text, textAlign}: HeadingComponentProps){ | ||
return ( | ||
<div style={{padding: 64}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this padding needed, or is there a way to use the margin and min-height on the h1 tag?
components/HeadingComponent.tsx
Outdated
textAlign: any, | ||
}; | ||
|
||
function HeadingComponent({text, textAlign}: HeadingComponentProps){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, make sure the component is export default.
puck.config.tsx
Outdated
</div> | ||
), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you created the component can you please also remove the HeadingBlock component here. It's no longer needed.
components/HeadingComponent.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also think about what this component does. How can you add different heading levels, like h1, h2 or h3?
I suggest we add a level
prop to this component and make the user choose it.
# Conflicts: # puck.config.tsx
solves #6