Skip to content

Commit

Permalink
add business contact reference
Browse files Browse the repository at this point in the history
  • Loading branch information
tmanundercover committed Oct 16, 2023
1 parent aa0fd6c commit 7d45d7c
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 24 deletions.
3 changes: 2 additions & 1 deletion src/common/sanityIo/Types.ts
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -57,7 +58,7 @@ export type SanityTransformHwHomePage = {
metaImage?: SanityImageSource
businessCardImageSrc?: SanityImageSource
slug?: any
businessContact: SanityBusinessContact
businessContact?: SanityBusinessContact
theme?: SanityMuiTheme
headerContent?: any
footerContent?: any
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
8 changes: 4 additions & 4 deletions src/components/mackenzies-mind/footer/FooterMenuContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,21 @@ const FooterMenuContainer: FunctionComponent<IProps> = (props: IProps) => {
<Grid container item spacing={1} justifyContent='center'>
<Grid item>
<Typography color='inherit' style={{width: "180px"}} align='center' variant='subtitle1'
gutterBottom>{pageContext.page?.businessContact.address}</Typography>
gutterBottom>{pageContext.page?.businessContact?.address}</Typography>
</Grid>
</Grid>
<Grid container item spacing={1} justifyContent='center'>
<Grid item>
<Typography color='inherit' align='center'
variant='subtitle1'>{pageContext.page?.businessContact.phone}</Typography>
variant='subtitle1'>{pageContext.page?.businessContact?.phone}</Typography>
</Grid>
</Grid>
<Grid container item spacing={1} justifyContent='center'>
{<Grid item>
<MailTo color={"#383838"} email={pageContext.page?.businessContact.email ?? ""}
<MailTo color={"#383838"} email={pageContext.page?.businessContact?.email ?? ""}
subject={"Information Request"}
body={""}><Typography
color='inherit'>{pageContext.page?.businessContact.email}</Typography></MailTo>
color='inherit'>{pageContext.page?.businessContact?.email}</Typography></MailTo>
</Grid>}
</Grid>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/mackenzies-mind/pages/PageMux.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const PageMux: FunctionComponent<IProps> = (props: IProps) => {
return <PageLayout homePage={pageContext.page}></PageLayout>
} else if (pageContext.page && pageContext.page.underConstructionPageRef) {
return <UnderConstruction underConstructionPageRef={pageContext.page.underConstructionPageRef}
email={pageContext.page?.email}/>
email={pageContext.page?.businessContact?.email}/>
}

if (pageContext.isPageError) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ const WebDevFooterMenuContainer: FunctionComponent<IProps> = (props: IProps) =>
</Grid>}
<Grid container item justifyContent={smDown ? 'center' : 'flex-start'}>
{<Grid item>
<MailTo color={"white"} email={pageContext.page?.email ?? ""}
<MailTo color={"white"} email={pageContext.page?.businessContact?.email ?? ""}
subject={"Information Request"}
body={""}><Typography
color='inherit'>{pageContext.page?.email}</Typography></MailTo>
color='inherit'>{pageContext.page?.businessContact?.email}</Typography></MailTo>
</Grid>}
</Grid>
<Grid item container style={{paddingLeft: theme.spacing(1)}}>
Expand All @@ -72,15 +72,15 @@ const WebDevFooterMenuContainer: FunctionComponent<IProps> = (props: IProps) =>
<Typography color='inherit' variant='subtitle1'
align={smDown ? 'center' : 'left'}
style={{fontWeight: "400", fontFamily: "Raleway", maxWidth: "150px"}}
gutterBottom>{pageContext.page?.address}</Typography>
gutterBottom>{pageContext.page?.businessContact?.address}</Typography>
</Grid>
</Grid>
<Grid container item spacing={1}
style={{paddingBottom: mdDown ? "24px" : "4px"}}
justifyContent={smDown ? 'center' : 'flex-start'}>
<Grid item>
<Typography color='inherit' align='center'
variant='subtitle1'>{pageContext.page?.phone}</Typography>
variant='subtitle1'>{pageContext.page?.businessContact?.phone}</Typography>
</Grid>
</Grid>
</Grid>
Expand Down
31 changes: 25 additions & 6 deletions src/stories/data/ThwHomePageData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -431,7 +450,7 @@ const thwHomePageData:SanityTransformHwHomePage = {
]
},
],
"facebook": "Transformative Healing and Wellness",
// "facebook": "Transformative Healing and Wellness",
"isUnderConstruction": false,
// "releaseDate": null,
// "headerMenuRef": {
Expand Down Expand Up @@ -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": {
Expand All @@ -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;
14 changes: 7 additions & 7 deletions src/stories/digital-resume/SocialMediaBlock.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,26 @@ type Story = StoryObj<typeof SocialMediaBlock>;

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}) => <SocialMediaBlock facebook={facebook} twitter={twitter} linkedIn={linkedIn} github={github} instagram={instagram}></SocialMediaBlock>,
};

export const SocialMediaBlockOnlyFacebook: Story = {
args:{
facebook:homePageResumeData.businessContact.facebook,
facebook:homePageResumeData.businessContact?.facebook,
},
render: ({facebook}) => <SocialMediaBlock facebook={facebook}></SocialMediaBlock>,
};

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}) => <SocialMediaBlock facebook={facebook} instagram={instagram} twitter={twitter}></SocialMediaBlock>,
Expand Down

0 comments on commit 7d45d7c

Please sign in to comment.