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

Commit

Permalink
Merge branch 'main' of github.com:WebDevStudios/nextjs-wordpress-star…
Browse files Browse the repository at this point in the history
…ter into hotfix/383-update-todos
  • Loading branch information
johnrobertmcc committed Feb 23, 2022
2 parents 9caa8ba + 9b81a38 commit 874fcef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion components/atoms/Columns/Columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import styles from './Columns.module.css'
* @param {object} props.children React children.
* @param {object} props.style Custom columns styles.
* @param {string} props.verticalAlignment Vertical alignment of columns.
* @param {boolean} props.isStackedOnMobile Checks if the columns are stacked.
* @return {Element} The Columns component.
*/
export default function Columns({
Expand All @@ -21,13 +22,15 @@ export default function Columns({
columnCount,
children,
style,
verticalAlignment
verticalAlignment,
isStackedOnMobile
}) {
return (
<div
id={id || null}
className={cn(
styles.columns,
isStackedOnMobile && styles.columnStacked,
columnCount && styles[`columns-${columnCount}`],
className,
verticalAlignment === 'center' ? styles.alignCenter : null,
Expand Down
8 changes: 6 additions & 2 deletions components/atoms/Columns/Columns.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.columns {
@apply flex flex-row gap-8;
@apply flex gap-8;

&.columnStacked {
@apply flex-col md:flex-row;
}

&.alignCenter {
& .column {
Expand All @@ -18,7 +22,7 @@
}

& .column {
@apply flex flex-col;
@apply flex flex-col w-full;

&.hasBackground {
@apply p-4;
Expand Down
7 changes: 5 additions & 2 deletions components/blocks/core/BlockColumns/BlockColumns.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import PropTypes from 'prop-types'
* @param {object} props.innerBlocks The array of inner blocks to display.
* @param {object} props.style The style attributes.
* @param {string} props.textColorHex The text color hex value.
* @param {boolean} props.isStackedOnMobile Checks if the columns are stacked.
* @param {string} props.verticalAlignment Vertical alignment of columns.
* @return {Element} The Columns component.
*/
Expand All @@ -28,7 +29,8 @@ export default function BlockColumns({
innerBlocks,
style,
textColorHex,
verticalAlignment
verticalAlignment,
isStackedOnMobile
}) {
const columnsStyle = getBlockStyles({
backgroundColorHex,
Expand All @@ -46,14 +48,15 @@ export default function BlockColumns({
columnCount={innerBlocks?.length}
style={columnsStyle}
verticalAlignment={verticalAlignment}
isStackedOnMobile={isStackedOnMobile}
>
{innerBlocks.map(({attributes, innerBlocks}, index) => {
const columnStyle = getBlockStyles({
backgroundColorHex: attributes?.backgroundColorHex,
gradientHex: attributes?.gradientHex,
textColorHex: attributes?.textColorHex,
style: attributes?.style,
width: attributes?.width || '50%'
width: attributes?.width
})

return (
Expand Down

0 comments on commit 874fcef

Please sign in to comment.