Skip to content

Commit

Permalink
feat: remove theme option for Callout and CallToAction
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiazom committed Sep 19, 2024
1 parent 52fdfa9 commit a3c802f
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 43 deletions.
5 changes: 1 addition & 4 deletions src/components/sections/callToAction/CallToAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ interface CallToActionProps {
}

const CallToAction = ({ callToAction }: CallToActionProps) => {
const theme =
callToAction.theme === "primary" ? styles.primary : styles.secondary;

return (
<article className={`${styles.article} ${theme}`} id={callToAction._key}>
<article className={`${styles.article}`} id={callToAction._key}>
<Text type="h2">{callToAction?.basicTitle}</Text>
<ul className={styles.list}>
{callToAction?.callToActions?.map((cta, index) => (
Expand Down
9 changes: 1 addition & 8 deletions src/components/sections/callToAction/callToAction.module.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
.primary {
background: var(--secondary-gradient-pink);
}

.secondary {
background-color: var(--secondary-yellow-1);
}

.article {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
gap: 1.5rem;
padding: 5rem 2rem;
background: var(--secondary-gradient-pink);

@media (min-width: 640px) {
padding: 5rem 3rem;
Expand Down
3 changes: 1 addition & 2 deletions src/components/sections/callout/Callout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ const myPortableTextComponents: Partial<PortableTextReactComponents> = {
};

const Callout = ({ callout }: CalloutProps) => {
const theme = callout.theme == "primary" ? styles.primary : styles.secondary;
return (
callout.richText && (
<article className={`${styles.shared} ${theme}`} id={callout._key}>
<article className={`${styles.shared}`} id={callout._key}>
<div className={styles.callout}>
<PortableText
value={callout.richText}
Expand Down
7 changes: 0 additions & 7 deletions src/components/sections/callout/callout.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@
flex-direction: column;
justify-content: center;
align-items: center;
}

.primary {
background: var(--secondary-yellow1);
}

.secondary {
background: var(--primary-white-bright);
}

.callout {
composes: shared;
width: -webkit-fill-available;
Expand Down
4 changes: 0 additions & 4 deletions studio/lib/interfaces/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { Slug } from "./global";
import { IImage, ImageExtendedProps } from "./media";
import { ILink } from "./navigation";

export type ThemeType = "primary" | "secondary";

export interface HeroSection {
_key: string;
_type: string;
Expand Down Expand Up @@ -37,15 +35,13 @@ export interface CalloutSection {
_type: string;
richText?: PortableTextBlock[];
link?: ILink;
theme?: ThemeType;
}

export interface CallToActionSection {
_key: string;
_type: string;
basicTitle?: string;
callToActions?: ILink[];
theme?: ThemeType;
}

export interface TestimonialsSection {
Expand Down
14 changes: 0 additions & 14 deletions studio/schemas/fields/theme.ts

This file was deleted.

2 changes: 0 additions & 2 deletions studio/schemas/objects/sections/callToAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { defineField } from "sanity";

import callToActionField from "studio/schemas/fields/callToActionFields";
import { title } from "studio/schemas/fields/text";
import { theme } from "studio/schemas/fields/theme";

export const callToActionSectionID = "ctaSection";

Expand All @@ -11,7 +10,6 @@ export const callToAction = defineField({
title: "Call to Action",
type: "object",
fields: [
theme,
{
...title,
description:
Expand Down
3 changes: 1 addition & 2 deletions studio/schemas/objects/sections/callout.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { defineField } from "sanity";

import { richText, richTextID } from "studio/schemas/fields/text";
import { theme } from "studio/schemas/fields/theme";
import { link } from "studio/schemas/objects/link";

export const calloutID = "callout";
Expand All @@ -10,7 +9,7 @@ export const callout = defineField({
name: calloutID,
title: "Callout",
type: "object",
fields: [theme, richText, link],
fields: [richText, link],
initialValue: {
theme: "primary",
},
Expand Down

0 comments on commit a3c802f

Please sign in to comment.