Skip to content

Commit

Permalink
tweak logic to return null if there is only one variation (the default).
Browse files Browse the repository at this point in the history
  • Loading branch information
richtabor committed May 29, 2024
1 parent 830a5ea commit 72354fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import Variation from './variation';
export default function ColorVariations( { title, gap = 2 } ) {
const colorVariations = useColorVariations();

if ( ! colorVariations?.length <= 1 ) {
// Return null if there is only one variation (the default).
if ( colorVariations?.length <= 1 ) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import Subtitle from '../subtitle';
export default function TypographyVariations( { title, gap = 2 } ) {
const typographyVariations = useTypographyVariations();

if ( ! typographyVariations?.length <= 1 ) {
// Return null if there is only one variation (the default).
if ( typographyVariations?.length <= 1 ) {
return null;
}

Expand Down

0 comments on commit 72354fe

Please sign in to comment.