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

Commit eef86e8

Browse files
committed
PR review updates to DocBlocks
1 parent 955ed18 commit eef86e8

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

components/atoms/Logo/Logo.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import Link from 'next/link'
22

3+
/**
4+
* Render the Logo component.
5+
*
6+
* @author WebDevStudios
7+
* @return {Element} The Blocks component.
8+
*/
39
// TODO: Create Storybook for this component.
4-
510
export default function Logo() {
611
return (
712
<Link href="/">

components/atoms/RichText/RichText.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@ import PropTypes from 'prop-types'
44
import React from 'react'
55
import styles from './RichText.module.css'
66

7+
/**
8+
* Render the RichText component.
9+
*
10+
* @param {object} props RichText component props.
11+
* @param {string} props.attributes Optional element attributes.
12+
* @param {string} props.children Child component(s) to render.
13+
* @param {string} props.className Optional classNames.
14+
* @param {string} props.id Optional element ID.
15+
* @param {string} props.tag The type of element to render.
16+
* @return {Element} The RichText component.
17+
*/
718
export default function RichText({attributes, children, className, id, tag}) {
819
const tagClassName = tag !== 'div' ? tag : ''
9-
1020
return React.createElement(tag, {
1121
...attributes,
1222
className: cn(styles.richtext, styles?.[tagClassName], className),

components/molecules/Blocks/Blocks.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ import displayBlock from '@/functions/displayBlock'
55
/**
66
* Render the Blocks component.
77
*
8-
* @param {array} blocks An array of blocks.
9-
* @return {Element} The Blocks component.
8+
* @author WebDevStudios
9+
* @param {object} props The component attributes as props.
10+
* @param {array} props.blocks The array of blocks.
11+
* @return {Element} The Blocks component.
1012
*/
1113
export default function Blocks({blocks}) {
1214
return (
1315
<>
1416
{
1517
// If there are blocks, loop over and display.
16-
!!blocks &&
17-
blocks.length > 0 &&
18+
!!blocks?.length &&
1819
blocks.map((block, index) => {
1920
return displayBlock(block, index)
2021
})

functions/createMarkup.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/**
22
* Handle markup that contains HTML.
33
*
4+
* @author WebDevStudios
45
* @param {Array} props Array of JSX Objects.
6+
* @return {object} HTML markup for rendering.
57
*/
68
export default function createMarkup(props) {
79
return {__html: props}

0 commit comments

Comments
 (0)