Skip to content

Commit

Permalink
Merge pull request #232 from CrystallizeAPI/feat-more-header-levels
Browse files Browse the repository at this point in the history
feat(react-js-components): enable h4,5,6 in the content transformers
  • Loading branch information
Plopix committed Dec 27, 2023
2 parents e5e37ad + 226347b commit a0e2318
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
always-auth: true
registry-url: 'https://registry.npmjs.org'
scope: '@crystallize'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@crystallize/reactjs-components",
"license": "MIT",
"version": "2.0.0",
"version": "2.0.1",
"author": "Crystallize <hello@crystallize.com> (https://crystallize.com)",
"contributors": [
"Håkon Krogh <hakon@crystallize.com>",
Expand Down
15 changes: 15 additions & 0 deletions src/content-transformer/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@ export const Renderers: Record<keyof Overrides, (props: NodeProps) => JSX.Elemen
<NodeContent {...props} />
</h3>
),
heading4: (props) => (
<h4>
<NodeContent {...props} />
</h4>
),
heading5: (props) => (
<h5>
<NodeContent {...props} />
</h5>
),
heading6: (props) => (
<h6>
<NodeContent {...props} />
</h6>
),
deleted: (props) => (
<del>
<NodeContent {...props} />
Expand Down
3 changes: 3 additions & 0 deletions src/content-transformer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export interface Overrides {
heading1?: Override;
heading2?: Override;
heading3?: Override;
heading4?: Override;
heading5?: Override;
heading6?: Override;
deleted?: Override;
subscripted?: Override;
superscripted?: Override;
Expand Down

0 comments on commit a0e2318

Please # to comment.