Skip to content

Commit

Permalink
🐛💄 Homepage - sizing between components (tinacms#2766)
Browse files Browse the repository at this point in the history
make full screen optional
  • Loading branch information
joshbermanssw authored Jan 21, 2025
1 parent 29c592d commit 3c76d74
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
11 changes: 11 additions & 0 deletions components/blocks/Features/Features.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ export const featuresTemplate: Template = {
},
],
},
{
name: 'isFullScreen',
label: 'Should the feature blocks be set to a full screen?',
description: 'use this for large bold stand alone items',
type: 'boolean',
ui: {
component: 'toggle',
parse: (value) => !!value,
format: (value) => !!value,
},
},
{
name: 'isReversed',
label: 'Text on Right?',
Expand Down
5 changes: 3 additions & 2 deletions components/blocks/Features/Features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Container } from '../Container';

export function FeatureBlock({ data, index }) {
const isReversed = data.isReversed;
const isFullScreen = data.isFullScreen
const isBackgroundEnabled = data.imageBackground;
const isVideo = data.media && data.media[0] && data.media[0].src;

Expand All @@ -32,7 +33,7 @@ export function FeatureBlock({ data, index }) {
<>
<div
key={'feature-' + index}
className={`relative w-full flex flex-col-reverse items-center lg:justify-center lg:min-h-[70vh] perspective ${
className={`relative w-full flex flex-col-reverse items-center lg:justify-center ${isFullScreen ? 'lg:min-h-[70vh]' : ''} perspective ${
isReversed ? 'lg:flex-row-reverse' : 'lg:flex-row'
}`}
>
Expand Down Expand Up @@ -223,7 +224,7 @@ export function FeaturesBlock({ data, index }) {
className={'py-12 lg:py-16 last:pb-20 last:lg:pb-32'}
>
<Container width="wide">
<div className="flex flex-col gap-16 w-full">
<div className="flex flex-col gap-32 lg:gap-48 w-full">
{/* TODO: why is there a type error here */}
{/* @ts-ignore */}
{data.features &&
Expand Down
1 change: 1 addition & 0 deletions content/blocksPages/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"_template": "video"
}
],
"isFullScreen": true,
"isReversed": false,
"imageBackground": false
}
Expand Down
2 changes: 1 addition & 1 deletion tina/tina-lock.json

Large diffs are not rendered by default.

0 comments on commit 3c76d74

Please sign in to comment.