From 7d45d7c100ca5701c65c5b9eea6101f24d672625 Mon Sep 17 00:00:00 2001 From: "Mr. Singleton" Date: Mon, 16 Oct 2023 12:01:41 -0400 Subject: [PATCH] add business contact reference --- src/common/sanityIo/Types.ts | 3 +- .../static-pages/cmsStaticPagesClient.ts | 3 +- .../footer/FooterMenuContainer.tsx | 8 ++--- .../mackenzies-mind/pages/PageMux.tsx | 2 +- .../dev-footer/WebDevFooterMenuContainer.tsx | 8 ++--- src/stories/data/ThwHomePageData.ts | 31 +++++++++++++++---- .../SocialMediaBlock.stories.tsx | 14 ++++----- 7 files changed, 45 insertions(+), 24 deletions(-) diff --git a/src/common/sanityIo/Types.ts b/src/common/sanityIo/Types.ts index 46b6b9e3..6c745293 100644 --- a/src/common/sanityIo/Types.ts +++ b/src/common/sanityIo/Types.ts @@ -1,6 +1,7 @@ import {SanityImageSource} from "@sanity/asset-utils"; import {SanityImageAsset, ThwServiceItemNoRefType} from "../../components/BlockContentTypes"; import {Slug} from "@sanity/types"; +import BusinessContact from "../../../sanityIo/schemas/businessContact"; export type SanitySlug = Slug @@ -57,7 +58,7 @@ export type SanityTransformHwHomePage = { metaImage?: SanityImageSource businessCardImageSrc?: SanityImageSource slug?: any - businessContact: SanityBusinessContact + businessContact?: SanityBusinessContact theme?: SanityMuiTheme headerContent?: any footerContent?: any diff --git a/src/components/block-content-ui/static-pages/cmsStaticPagesClient.ts b/src/components/block-content-ui/static-pages/cmsStaticPagesClient.ts index 52997649..ce295a51 100644 --- a/src/components/block-content-ui/static-pages/cmsStaticPagesClient.ts +++ b/src/components/block-content-ui/static-pages/cmsStaticPagesClient.ts @@ -1,13 +1,14 @@ import imageUrlBuilder from '@sanity/image-url' import sanityClient from '../../../sanityClient' import {SanityImageAsset, SanityImageSource} from "@sanity/asset-utils"; -import {SanityMenuGroup, SanitySlug} from "../../../common/sanityIo/Types"; +import {SanityBusinessContact, SanityMenuGroup, SanitySlug} from "../../../common/sanityIo/Types"; const builder = imageUrlBuilder(sanityClient) export type SanityHomePage = { slug?: SanitySlug, heroImage?: SanityHeroImageWithText, + businessContact?: SanityBusinessContact, introduction?: string specializationsMenuGroup?: SanityMenuGroup, weWorkWithSection?: SanityWeWorkWith, diff --git a/src/components/mackenzies-mind/footer/FooterMenuContainer.tsx b/src/components/mackenzies-mind/footer/FooterMenuContainer.tsx index a7986a62..98864944 100644 --- a/src/components/mackenzies-mind/footer/FooterMenuContainer.tsx +++ b/src/components/mackenzies-mind/footer/FooterMenuContainer.tsx @@ -78,21 +78,21 @@ const FooterMenuContainer: FunctionComponent = (props: IProps) => { {pageContext.page?.businessContact.address} + gutterBottom>{pageContext.page?.businessContact?.address} {pageContext.page?.businessContact.phone} + variant='subtitle1'>{pageContext.page?.businessContact?.phone} { - {pageContext.page?.businessContact.email} + color='inherit'>{pageContext.page?.businessContact?.email} } diff --git a/src/components/mackenzies-mind/pages/PageMux.tsx b/src/components/mackenzies-mind/pages/PageMux.tsx index d5374193..50bb0431 100644 --- a/src/components/mackenzies-mind/pages/PageMux.tsx +++ b/src/components/mackenzies-mind/pages/PageMux.tsx @@ -33,7 +33,7 @@ const PageMux: FunctionComponent = (props: IProps) => { return } else if (pageContext.page && pageContext.page.underConstructionPageRef) { return + email={pageContext.page?.businessContact?.email}/> } if (pageContext.isPageError) { diff --git a/src/components/web-dev-site/dev-footer/WebDevFooterMenuContainer.tsx b/src/components/web-dev-site/dev-footer/WebDevFooterMenuContainer.tsx index 5168f4df..30717300 100644 --- a/src/components/web-dev-site/dev-footer/WebDevFooterMenuContainer.tsx +++ b/src/components/web-dev-site/dev-footer/WebDevFooterMenuContainer.tsx @@ -59,10 +59,10 @@ const WebDevFooterMenuContainer: FunctionComponent = (props: IProps) => } { - {pageContext.page?.email} + color='inherit'>{pageContext.page?.businessContact?.email} } @@ -72,7 +72,7 @@ const WebDevFooterMenuContainer: FunctionComponent = (props: IProps) => {pageContext.page?.address} + gutterBottom>{pageContext.page?.businessContact?.address} = (props: IProps) => justifyContent={smDown ? 'center' : 'flex-start'}> {pageContext.page?.phone} + variant='subtitle1'>{pageContext.page?.businessContact?.phone} diff --git a/src/stories/data/ThwHomePageData.ts b/src/stories/data/ThwHomePageData.ts index dd5a7139..44970d6a 100644 --- a/src/stories/data/ThwHomePageData.ts +++ b/src/stories/data/ThwHomePageData.ts @@ -2,6 +2,25 @@ import {SanityTransformHwHomePage} from "../../common/sanityIo/Types"; import DigitalResumeThemeData from "./DigitalResumeThemeData"; const thwHomePageData:SanityTransformHwHomePage = { + businessContact: { + // "github": null, + // "instagram": null, + "facebook": "kamikazenupe1911", + // "facebookIconSrc": null, + // "twitter": null, + // "twitterIconSrc": null, + "linkedIn": "Terrell-singleton", + // "instagramIconSrc": null, + "email": "terrell.singleton@gmail.com", + "twitter": "KamikazetheZ", + "address": "7300 Roselynn Lane, Clinton, MD 20735", + "instagram": "thehandsomestnerd", + "instagramIconSrc": undefined, + "phone": "443.992.2191", + "facebookIconSrc": undefined, + "twitterIconSrc": undefined, + "github": "tmanundercover", + }, "description": " To provide innovative and alternative services in an effort to help those seeking change to live a meaningful and fulfilling life. To raise the awareness and the importance of Mental Health and Wellness.", "theme": DigitalResumeThemeData, "servicesAvailable": [ @@ -431,7 +450,7 @@ const thwHomePageData:SanityTransformHwHomePage = { ] }, ], - "facebook": "Transformative Healing and Wellness", + // "facebook": "Transformative Healing and Wellness", "isUnderConstruction": false, // "releaseDate": null, // "headerMenuRef": { @@ -2069,15 +2088,15 @@ const thwHomePageData:SanityTransformHwHomePage = { }, "structuredData": null, // "facebookIconSrc": null, - "twitter": "transform_hw", + // "twitter": "transform_hw", "slug": { "current": "home", "_type": "slug" }, - "phone": "443.940.5550", + // "phone": "443.940.5550", "_type": "homePage", // "instagramIconSrc": null, - "email": "jgreene@transformhw.org", + // "email": "jgreene@transformhw.org", "metaImage": { "_type": "image", "asset": { @@ -2088,9 +2107,9 @@ const thwHomePageData:SanityTransformHwHomePage = { // "googleReviewLink": "https://www.google.com/maps/place/Transformative+Healing+%26+Wellness/@39.4030221,-76.7579788,17z/data=!3m1!5s0x89c81741c512004f:0x9b9d4f470b87d68!4m7!3m6!1s0x89c817f2385e32a9:0xb54a2748f7057204!8m2!3d39.4030221!4d-76.7557901!9m1!1b1", // "underConstructionPageRef": null, // "twitterIconSrc": null, - "instagram": "TransformativeHW", + // "instagram": "TransformativeHW", "title": "Home Page - Transformative Healing & Wellness", - "address": "9505 Reisterstown RD Ste 3NW, Owings Mills, MD 21117" + // "address": "9505 Reisterstown RD Ste 3NW, Owings Mills, MD 21117" } export default thwHomePageData; \ No newline at end of file diff --git a/src/stories/digital-resume/SocialMediaBlock.stories.tsx b/src/stories/digital-resume/SocialMediaBlock.stories.tsx index 0dca9895..0afb2547 100644 --- a/src/stories/digital-resume/SocialMediaBlock.stories.tsx +++ b/src/stories/digital-resume/SocialMediaBlock.stories.tsx @@ -23,10 +23,10 @@ type Story = StoryObj; export const SocialMediaBlockFromHomepage: Story = { args:{ - facebook:homePageResumeData.businessContact.facebook, - twitter:homePageResumeData.businessContact.twitter, - linkedIn:homePageResumeData.businessContact.linkedIn, - github:homePageResumeData.businessContact.github, + facebook:homePageResumeData.businessContact?.facebook, + twitter:homePageResumeData.businessContact?.twitter, + linkedIn:homePageResumeData.businessContact?.linkedIn, + github:homePageResumeData.businessContact?.github, instagram: "thehandsomestNerd" }, render: ({facebook,twitter, linkedIn, instagram, github}) => , @@ -34,15 +34,15 @@ export const SocialMediaBlockFromHomepage: Story = { export const SocialMediaBlockOnlyFacebook: Story = { args:{ - facebook:homePageResumeData.businessContact.facebook, + facebook:homePageResumeData.businessContact?.facebook, }, render: ({facebook}) => , }; export const SocialMediaBlockOnly3: Story = { args:{ - facebook:homePageResumeData.businessContact.facebook, - twitter:homePageResumeData.businessContact.twitter, + facebook:homePageResumeData.businessContact?.facebook, + twitter:homePageResumeData.businessContact?.twitter, instagram: "thehandsomestNerd" }, render: ({facebook, twitter, instagram}) => ,