Skip to content

Commit

Permalink
Merge branch 'main' into search-colour-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
isaaclombardssw authored Oct 7, 2024
2 parents a699d2b + 37a4de4 commit fade88b
Show file tree
Hide file tree
Showing 17 changed files with 169 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
Expand Down
123 changes: 62 additions & 61 deletions components/blocks/CarouselFeature.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React, { useState, useEffect, useRef } from 'react';
import Link from 'next/link';
import type { TinaTemplate } from '@tinacms/cli';
import { Container } from './Container';
import GradGlow from '../../public/svg/grad-glow.svg';
import React, { useEffect, useRef, useState } from 'react';
import { tinaField } from 'tinacms/dist/react';
import { sanitizeLabel } from 'utils/sanitizeLabel';
import { Actions } from './ActionsButton';
import GradGlow from '../../public/svg/grad-glow.svg';
import { icons } from '../ui/IconPickerIcons';
import { Actions } from './ActionsButton';
import { Container } from './Container';

const CarouselItem = ({
data,
Expand Down Expand Up @@ -36,66 +34,64 @@ const CarouselItem = ({
(isSmallOrMediumScreen && button);

return (
<div
className={`${
isHovered && !isSmallOrMediumScreen
? 'group block bg-gradient-to-br from-white/25 via-white/50 to-white/75 shadow-2xl pl-6 pr-8 md:py-9 md:pr-11 lg:pb-8 lg:pt-8 lg:pr-4 rounded-2xl'
: nonHoveredStyles
} ${commonStyles}`}
onClick={() => onClick(index)}
style={{ textDecoration: 'none', overflow: 'visible' }}
>
<div
className={`${
isHovered && !isSmallOrMediumScreen
? 'group block bg-gradient-to-br from-white/25 via-white/50 to-white/75 shadow-2xl pl-6 pr-8 md:py-9 md:pr-11 lg:pb-8 lg:pt-8 lg:pr-4 rounded-2xl'
: nonHoveredStyles
} ${commonStyles}`}
onClick={() => onClick(index)}
style={{ textDecoration: 'none', overflow: 'visible' }}
data-tina-field={tinaField(data, 'headline')}
className="flex flex-col"
>
<div className="block lg:hidden pb-5">
{renderMedia && renderMedia(index)}
</div>
<div className="flex items-center mb-2 pl-1">
{IconComponent && (
<IconComponent
className={`text-xl ${
isHovered && !isSmallOrMediumScreen
? 'text-orange-500/90 md:text-3xl pb-1'
: 'text-black md:text-2xl pb-1'
}`}
/>
)}
{headline && (
<h3
className={` md:text-3xl text-2xl font-tuner leading-tight cursor-pointer pl-4 ${
isHovered && !isSmallOrMediumScreen
? 'text-transparent lg:text-3xl bg-gradient-to-br from-orange-400 cursor-default via-orange-500 to-orange-600 bg-clip-text'
: 'text-black lg:text-xl'
}`}
>
{headline}
</h3>
)}
</div>
<div
data-tina-field={tinaField(data, 'headline')}
className="flex flex-col"
className={`transition-all duration-250 ${
textDisplayCondition
? 'scale-y-100 opacity-100'
: 'scale-y-75 opacity-0'
}`}
>
<div className="block lg:hidden pb-5">
{renderMedia && renderMedia(index)}
</div>
<div className="flex items-center mb-2 pl-1">
{IconComponent && (
<IconComponent
className={`text-xl ${
isHovered && !isSmallOrMediumScreen
? 'text-orange-500/90 md:text-3xl pb-1'
: 'text-black md:text-2xl pb-1'
}`}
/>
)}
{headline && (
<h3
className={` md:text-3xl text-2xl font-tuner leading-tight cursor-pointer pl-4 ${
isHovered && !isSmallOrMediumScreen
? 'text-transparent lg:text-3xl bg-gradient-to-br from-orange-400 cursor-default via-orange-500 to-orange-600 bg-clip-text'
: 'text-black lg:text-xl'
}`}
>
{headline}
</h3>
)}
</div>
<div
className={`transition-all duration-250 ${
textDisplayCondition
? 'scale-y-100 opacity-100'
: 'scale-y-75 opacity-0'
}`}
>
{textDisplayCondition && (
<p
className={`md:pl-12 lg:pl-9 text-lg font-medium slide-up`}
>
{text}
</p>
)}
{buttonDisplayCondition && (
<div className={`md:pl-6 lg:pl-7 slide-up`}>
<Actions items={actionsArray} />
</div>
)}
</div>
{textDisplayCondition && (
<p className={`md:pl-12 lg:pl-9 text-lg font-medium slide-up`}>
{text}
</p>
)}
{buttonDisplayCondition && (
<div className={`md:pl-6 lg:pl-7 slide-up`}>
<Actions items={actionsArray} />
</div>
)}
</div>
</div>
</div>
);
};

Expand Down Expand Up @@ -147,7 +143,12 @@ export function CarouselFeatureBlock({ data, index }) {
};

useEffect(() => {
if (!isPaused && isLargeScreen && data?.items?.length > 0 && !isUserInteracted) {
if (
!isPaused &&
isLargeScreen &&
data?.items?.length > 0 &&
!isUserInteracted
) {
startAutoTicking();
}
return () => clearInterval(intervalRef.current);
Expand Down
6 changes: 3 additions & 3 deletions components/blocks/Columns.template.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { TinaTemplate } from 'tinacms'
import type { Template } from 'tinacms'
import { actionsButtonTemplate } from './ActionsButton.template'
import { socialTemplate } from './Social.template'
import { newsletterTemplate } from './Newsletter.template'
import { socialTemplate } from './Social.template'

export const columnsTemplate: TinaTemplate = {
export const columnsTemplate: Template = {
label: 'Columns',
name: 'columns',
ui: {
Expand Down
36 changes: 30 additions & 6 deletions components/blocks/CompareBox.template.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { TinaTemplate } from 'tinacms';
import type { Template } from 'tinacms';

export const compareBoxTemplate: TinaTemplate = {
export const compareBoxTemplate: Template = {
label: 'Compare Box',
name: 'CompareBox',
fields: [
Expand All @@ -17,7 +17,14 @@ export const compareBoxTemplate: TinaTemplate = {
},
fields: [
{ name: 'criteria', label: 'Criteria', type: 'string' },
{ name: 'description', label: 'Description', ui: { component: 'textarea' }, type: 'string', description: 'The text inside the description will NOT be displayed anywhere, this is just to elaborate on the criteria itself for our own users.' },
{
name: 'description',
label: 'Description',
ui: { component: 'textarea' },
type: 'string',
description:
'The text inside the description will NOT be displayed anywhere, this is just to elaborate on the criteria itself for our own users.',
},
],
},
{
Expand All @@ -35,9 +42,26 @@ export const compareBoxTemplate: TinaTemplate = {
{ name: 'headline', label: 'Headline', type: 'string' },
{ name: 'logoColour', label: 'Logo Link (Colour)', type: 'string' },
{ name: 'logoWhite', label: 'Logo Link (White)', type: 'string' },
{ name: 'active', label: 'Active', type: 'boolean', description: 'Toggle to highlight which company is BY DEFAULT active' },
{ name: 'isHidden', label: 'Hidden', type: 'boolean', description: 'Toggle will hide the company item from the list of clickable companies - it will also ensure it cannot be turned off.' },
{ name: 'backgroundColor', label: 'Background Color', type: 'string', ui: { component: 'color' }, description: 'Choose a background color for the company' },
{
name: 'active',
label: 'Active',
type: 'boolean',
description: 'Toggle to highlight which company is BY DEFAULT active',
},
{
name: 'isHidden',
label: 'Hidden',
type: 'boolean',
description:
'Toggle will hide the company item from the list of clickable companies - it will also ensure it cannot be turned off.',
},
{
name: 'backgroundColor',
label: 'Background Color',
type: 'string',
ui: { component: 'color' },
description: 'Choose a background color for the company',
},
{ name: 'criteria1', label: 'Criteria 1', type: 'boolean' },
{ name: 'criteria2', label: 'Criteria 2', type: 'boolean' },
{ name: 'criteria3', label: 'Criteria 3', type: 'boolean' },
Expand Down
12 changes: 6 additions & 6 deletions components/blocks/Content.template.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TinaTemplate } from 'tinacms'
import { Template } from 'tinacms';

import { newsletterTemplate } from './Newsletter.template'
import { actionsButtonTemplate } from './ActionsButton.template'
import { socialTemplate } from './Social.template'
import { actionsButtonTemplate } from './ActionsButton.template';
import { newsletterTemplate } from './Newsletter.template';
import { socialTemplate } from './Social.template';

export const contentTemplate: TinaTemplate = {
export const contentTemplate: Template = {
label: 'Content',
name: 'content',
ui: {
Expand Down Expand Up @@ -74,4 +74,4 @@ export const contentTemplate: TinaTemplate = {
],
},
],
}
};
6 changes: 3 additions & 3 deletions components/blocks/FAQ.template.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { TinaTemplate } from 'tinacms'
import type { Template } from 'tinacms';

export const faqTemplate: TinaTemplate = {
export const faqTemplate: Template = {
label: 'FAQ',
name: 'faq',
ui: {
Expand Down Expand Up @@ -54,4 +54,4 @@ export const faqTemplate: TinaTemplate = {
],
},
],
}
};
10 changes: 5 additions & 5 deletions components/blocks/FeatureGrid.template.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { TinaTemplate } from 'tinacms'
import { actionsButtonTemplate } from './ActionsButton.template'
import { cardTemplate } from './Pricing.template'
import type { Template } from 'tinacms';
import { actionsButtonTemplate } from './ActionsButton.template';
import { cardTemplate } from './Pricing.template';

export const featureGridTemplate: TinaTemplate = {
export const featureGridTemplate: Template = {
label: 'Feature Grid',
name: 'featureGrid',
ui: {
Expand Down Expand Up @@ -39,4 +39,4 @@ export const featureGridTemplate: TinaTemplate = {
],
},
],
}
};
12 changes: 6 additions & 6 deletions components/blocks/Flying.template.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Template, TinaTemplate } from 'tinacms'
import { actionsButtonTemplate } from './ActionsButton.template'
import { modalButtonTemplate } from './ModalButton.template'
import { codeButtonTemplate } from './CodeButton.template'
import type { Template } from 'tinacms';
import { actionsButtonTemplate } from './ActionsButton.template';
import { codeButtonTemplate } from './CodeButton.template';
import { modalButtonTemplate } from './ModalButton.template';

export const flyingTemplate: TinaTemplate = {
export const flyingTemplate: Template = {
name: 'flying',
label: 'Flying',
ui: {
Expand Down Expand Up @@ -32,4 +32,4 @@ export const flyingTemplate: TinaTemplate = {
],
},
],
}
};
12 changes: 6 additions & 6 deletions components/blocks/Hero.template.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Template, TinaTemplate } from 'tinacms'
import { actionsButtonTemplate } from './ActionsButton.template'
import { modalButtonTemplate } from './ModalButton.template'
import { codeButtonTemplate } from './CodeButton.template'
import type { Template } from 'tinacms';
import { actionsButtonTemplate } from './ActionsButton.template';
import { codeButtonTemplate } from './CodeButton.template';
import { modalButtonTemplate } from './ModalButton.template';

export const heroTemplate: TinaTemplate = {
export const heroTemplate: Template = {
label: 'Hero',
name: 'hero',
ui: {
Expand Down Expand Up @@ -99,4 +99,4 @@ export const heroTemplate: TinaTemplate = {
],
},
],
}
};
9 changes: 5 additions & 4 deletions components/blocks/LogoGrid.template.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { TinaTemplate } from 'tinacms'
import type { Template } from 'tinacms';

export const logoGridTemplate: TinaTemplate = {
export const logoGridTemplate: Template = {
label: 'Logo Grid',
name: 'logoGrid',
ui: {
Expand Down Expand Up @@ -34,11 +34,12 @@ export const logoGridTemplate: TinaTemplate = {
name: 'link',
label: 'Link',
type: 'string',
description: 'The URL to link to when the logo is clicked. Should be either (1) an internal link (e.g. /showcase#unity) or (2) an external link (e.g. https://ndcconferences.com/).',
description:
'The URL to link to when the logo is clicked. Should be either (1) an internal link (e.g. /showcase#unity) or (2) an external link (e.g. https://ndcconferences.com/).',
},
{ name: 'logo', label: 'Logo Image', type: 'image' },
{ name: 'size', label: 'Size', type: 'number' },
],
},
],
}
};
12 changes: 6 additions & 6 deletions components/blocks/Quote.template.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { TinaTemplate } from 'tinacms'
import type { Template } from 'tinacms';

export const quoteTemplate: TinaTemplate = {
export const quoteTemplate: Template = {
label: 'Quote',
name: 'quote',
ui: {
Expand All @@ -10,19 +10,19 @@ export const quoteTemplate: TinaTemplate = {
{
label: 'Title',
name: 'title2',
ui: { component: "textarea" },
ui: { component: 'textarea' },
type: 'string',
},
{
label: 'Sub Text',
name: 'subtext',
ui: { component: "textarea" },
ui: { component: 'textarea' },
type: 'string',
},
{
label: 'logo',
name: 'logo',
type: 'image',
}
},
],
}
};
8 changes: 4 additions & 4 deletions components/blocks/RoadmapGrid.template.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TinaTemplate } from '@tinacms/cli'
import { actionsButtonTemplate } from './ActionsButton.template'
import type { Template } from 'tinacms';
import { actionsButtonTemplate } from './ActionsButton.template';

export const roadmapGridTemplate: TinaTemplate = {
export const roadmapGridTemplate: Template = {
label: 'Roadmap Grid',
name: 'roadmapGrid',
ui: {
Expand Down Expand Up @@ -42,4 +42,4 @@ export const roadmapGridTemplate: TinaTemplate = {
],
},
],
}
};
Loading

0 comments on commit fade88b

Please sign in to comment.