Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 35ff541

Browse files
committed
Adding list component
1 parent 221ecdb commit 35ff541

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

components/blocks/BlockHeadings/BlockHeadings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ BlockHeadings.propTypes = {
4141
align: PropTypes.string,
4242
className: PropTypes.string,
4343
content: PropTypes.string,
44-
level: PropTypes.string
44+
level: PropTypes.number
4545
}
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import RichText from '@/components/atoms/RichText'
12
import PropTypes from 'prop-types'
23

34
/**
@@ -6,20 +7,23 @@ import PropTypes from 'prop-types'
67
* The core List block from Gutenberg.
78
*
89
* @author WebDevStudios
9-
* @param {object} props The component attributes as props.
10+
* @param {string} className Optional classnames.
11+
* @param {string} ordered Is this an ordered list.
12+
* @param {string} anchor Optional anchor/id.
13+
* @param {string} values The content of the block.
14+
* @return {Element} The RichText component.
1015
*/
11-
export default function BlockList({props}) {
12-
const {className, ordered, anchor, values} = props
13-
16+
export default function BlockList({className, ordered, anchor, values}) {
1417
return (
15-
<pre>{JSON.stringify({className, ordered, anchor, values}, null, 2)}</pre>
18+
<RichText tag={ordered ? 'ol' : 'ul'} className={className} id={anchor}>
19+
{values}
20+
</RichText>
1621
)
1722
}
1823

1924
BlockList.propTypes = {
20-
props: PropTypes.object.isRequired,
2125
anchor: PropTypes.string,
22-
ordered: PropTypes.string,
26+
ordered: PropTypes.boolen,
2327
className: PropTypes.string,
2428
values: PropTypes.string
2529
}

0 commit comments

Comments
 (0)