diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml index 8b24ee55..f502142e 100644 --- a/.github/workflows/firebase-hosting-merge.yml +++ b/.github/workflows/firebase-hosting-merge.yml @@ -5,16 +5,38 @@ name: Deploy to Firebase Hosting on merge 'on': push: branches: - - master + - master + jobs: build_and_deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: npm ci && tsc && yarn build - - uses: FirebaseExtended/action-hosting-deploy@v0 + - name: Checking out code + uses: actions/checkout@v2 + - name: Setting up CI Env variables + run: | + set -e + # Put your environment variables here. Don't forget + # to create secrets for them on GitHub: + # https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets + cat << EOF > .env + REACT_APP_SANITY_PROJECTID="${{ secrets.REACT_APP_SANITY_PROJECTID }}" + REACT_APP_SANITY_DB="${{ secrets.REACT_APP_SANITY_DB }}" + REACT_APP_API_KEY="${{ secrets.REACT_APP_API_KEY }}" + REACT_APP_AUTH_DOMAIN="${{ secrets.REACT_APP_AUTH_DOMAIN }}" + REACT_APP_PROJECT_ID="${{ secrets.REACT_APP_PROJECT_ID }}" + REACT_APP_STORAGE_BUCKET="${{ secrets.REACT_APP_STORAGE_BUCKET }}" + REACT_APP_MESSAGING_SENDER_ID="${{ secrets.REACT_APP_MESSAGING_SENDER_ID }}" + REACT_APP_APP_ID="${{ secrets.REACT_APP_APP_ID }}" + REACT_APP_FIREBASE_ANALYTICS_TRACKING_ID="${{ secrets.REACT_APP_FIREBASE_ANALYTICS_TRACKING_ID }}" + EOF + - name: Building production code + run: unset CI && npm ci && npm run build + + - name: Deploying to Firebase Hosting + uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: '${{ secrets.GITHUB_TOKEN }}' - firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_THE_HANDSOMEST_NERD }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ST_JOSEPH_FWBC }}' channelId: live - projectId: transform-hw + projectId: st-joseph-fwbc diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml index c6bf3cd4..9c52b806 100644 --- a/.github/workflows/firebase-hosting-pull-request.yml +++ b/.github/workflows/firebase-hosting-pull-request.yml @@ -9,9 +9,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: npm ci && tsc && yarn build - - uses: FirebaseExtended/action-hosting-deploy@v0 + - name: Creating env file + run: | + set -e + # Put your environment variables here. Don't forget + # to create secrets for them on GitHub: + # https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets + cat << EOF > .env.production + REACT_APP_SANITY_PROJECTID="${{ secrets.REACT_APP_SANITY_PROJECTID }}" + REACT_APP_SANITY_DB="${{ secrets.REACT_APP_SANITY_DB }}" + EOF + - name: Building code + run: unset CI && npm ci && npm run build + - name: Deploying to hosting + uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: '${{ secrets.GITHUB_TOKEN }}' - firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_THE_HANDSOMEST_NERD }}' - projectId: transform-hw + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ST_JOSEPH_FWBC }}' + projectId: st-joseph-fwbc diff --git a/.github/workflows/sanity-backup.yml b/.github/workflows/sanity-backup.yml new file mode 100644 index 00000000..f5e6ace2 --- /dev/null +++ b/.github/workflows/sanity-backup.yml @@ -0,0 +1,36 @@ +name: Backup Sanity db +on: + schedule: + # Runs at 04:00 UTC on the 1st and 17th of every month + - cron: '0 4 */16 * *' + workflow_dispatch: + + +jobs: + export_upload: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install dependencies + run: | + cd sanityIo + npm install + set -e + # Put your environment variables here. Don't forget + # to create secrets for them on GitHub: + # https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets + cat << EOF > .env.production + EOF + # Make sure to add a secret for SANITY_AUTH_TOKEN + SANITY_AUTH_TOKEN="${{ secrets.SANITY_AUTH_TOKEN }}" npx @sanity/cli dataset export production backups/backup.tar.gz + - name: Upload backup.tar.gz + uses: actions/upload-artifact@v3 + with: + name: backup-tarball + path: sanityIo/backups/backup.tar.gz + # Fails the workflow if no files are found; defaults to 'warn' + if-no-files-found: error diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 00000000..e2900890 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index 4f8bfd99..ed5c4cec 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/functions/package-lock.json b/functions/package-lock.json index 3ded2a51..8718f01f 100644 --- a/functions/package-lock.json +++ b/functions/package-lock.json @@ -34,7 +34,7 @@ "eslint-config-google": "^0.14.0", "eslint-plugin-import": "^2.22.0", "firebase-functions-test": "^0.2.0", - "typescript": "^4.8.4" + "typescript": "^5.1.3" }, "engines": { "node": "14" @@ -5532,16 +5532,16 @@ } }, "node_modules/typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", + "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/uc.micro": { @@ -10181,9 +10181,9 @@ } }, "typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", + "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", "dev": true }, "uc.micro": { diff --git a/functions/package.json b/functions/package.json index 1f1deb06..e3b49108 100644 --- a/functions/package.json +++ b/functions/package.json @@ -2,14 +2,14 @@ "name": "functions", "scripts": { "lint": "eslint --ext .js,.ts .", - "build": "tsc && npm run html", + "build": "tsc", "build:dev": "NODE_ENV=development tsc", "serve": "npm run build && firebase emulators:start --only functions", "shell": "npm run build && firebase functions:shell", "start": "npm run shell", "deploy": "npm run build && firebase deploy --only functions", "logs": "firebase functions:log", - "html": "mv ../build/index.html ./lib/functions/src" + "html": "cp ../build/index.html ./lib/functions/src" }, "engines": { "node": "14" @@ -44,7 +44,7 @@ "eslint-config-google": "^0.14.0", "eslint-plugin-import": "^2.22.0", "firebase-functions-test": "^0.2.0", - "typescript": "^4.8.4" + "typescript": "^5.1.3" }, "private": true } diff --git a/functions/src/cmsClient.ts b/functions/src/cmsClient.ts index 3f4e6428..50cfa1ee 100644 --- a/functions/src/cmsClient.ts +++ b/functions/src/cmsClient.ts @@ -1,12 +1,12 @@ import {log} from "./logClient"; import {sanityClient} from "./sanityClient"; -import {SanityColdLead, SanityTransformHwHomePage} from "../../src/common/sanityIo/Types"; -import groqQueries from "../../src/utils/groqQueries"; +// import {SanityColdLead, SanityTransformHwHomePage} from "../../src/common/sanityIo/Types"; +import groqQueries from "./groqQueries"; -const createColdLead = async (coldLead: SanityColdLead) => { +const createColdLead = async (coldLead: any) => { log("createSanityColdLead", "DEBUG", "creating cold lead ", coldLead.email); - const newColdLead: SanityColdLead = { + const newColdLead: any = { ...coldLead, }; @@ -27,7 +27,7 @@ const fetchPage = async (pageSlug:string)=>{ `*[slug.current == $pageSlug]{ ${groqQueries.HOMEPAGE} }`, {pageSlug}) - .then((data: SanityTransformHwHomePage[]) => { + .then((data:any) => { log("fetchPage", "NOTICE", "fetched page", {pageSlug, page: data[0]}); return data[0]; }) diff --git a/functions/src/groqQueries.ts b/functions/src/groqQueries.ts new file mode 100644 index 00000000..8fe2b017 --- /dev/null +++ b/functions/src/groqQueries.ts @@ -0,0 +1,171 @@ +const MENUGROUP = ` + title, + _type, + slug, + menuGroupTitle, + "links":links[]->{ + _type, + displayText, + url, + isOutlinedButton, + isContainedButton, + isModalButton, + modalRef->{ + name, + title, + slug, + backgroundImageSrc, + iconOverlayImageSrc, + "contentText":contentText[], + "notes":notes[], + ctaButtonTitle, + ctaButtonLink + } + }, + displayText, + url, + isOutlinedButton, + isContainedButton, +`; + +const MENUGROUPCONTAINER = ` + title, + slug, + displayText, + "subMenus":subMenus[]->{ + ${MENUGROUP} + }, + logoImageSrc, + logoImageAltText +`; + +const SERVICE = + `name, + imageSrc, + imageSrcAltText, + contentTitle, + contentText, + ctaButtonText, + ctaButtonLink, + learnMoreLink, + learnMoreText, + educationPageTitle, + educationPageSlimHeroImage, + extendedDescriptions, + benefitsOfServiceTitle, + benefitsOfServiceContents, + benefitsOfServiceBullets, + "serviceAmenities": serviceAmenities[]->, + slug,`; + + +const HOMEPAGE = `_type, + title, + isUnderConstruction, + releaseDate, + slug, + address, + email, + phone, + description, + businessCardImageSrc, + bookAppointmentLink, + bookAppointmentQrCode, + website, + websiteQrCode, + metaImage, + headerContent { + "content": content[]->{ + ..., + headerMenuRef->{ + ${MENUGROUPCONTAINER} + }, + } + }, + footerContent { + "content": content[]->{ + ..., + footerMenuRef->{ + ${MENUGROUPCONTAINER} + }, + } + }, + pageContent { + "content": content[]->{ + ..., + "servicesList": servicesList[]->{ + ${SERVICE} + }, + "serviceAmenities": serviceAmenities[]->, + "skillsets": skillsets[]{ + ..., + "skills": skills[]->{ + _id, + name, + title, + }, + }, + "experiences": experiences[]->{ + ..., + "skillsUsed": skillsUsed[]-> + }, + "educationExperiences": educationExperiences[]->, + "feedbackEntries": feedbackEntries[]->, + "portfolioEntries": portfolioEntries[]->{ + ..., + "skillsHighlighted": skillsHighlighted[]->, + "imageGallery": imageGallery[] + }, + "resumeFile": resumeFile.asset->, + "cvFile": cvFile.asset-> + } + }, + "servicesAvailable": servicesAvailable[]->{ + ${SERVICE} + }, + underConstructionPageRef, + structuredData, + facebook, + facebookIconSrc{ + asset->{ + _id, + url, + altText + } + }, + twitter, + twitterIconSrc{ + asset->{ + _id, + url, + altText + } + }, + instagram, + linkedIn, + github, + instagramIconSrc{ + asset->{ + _id, + url, + altText + } + } +`; +// const MENUGROUP = ` +// title, +// slug, +// logoImage, +// menuGroupTitle, +// "links": links[]->{title, displayText, url, isOutlinedButton, isContainedButton} +// ` + + +enum SANITY_TYPES_ENUM { + SERVICE="transformServiceItem" +} + +const defaultObj = {HOMEPAGE, MENUGROUPCONTAINER, MENUGROUP, SERVICE, SANITY_TYPES_ENUM}; + + +export default defaultObj; diff --git a/functions/src/index.ts b/functions/src/index.ts index c68e2478..5dddb307 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -8,11 +8,14 @@ import * as cmsClient from "./cmsClient"; import * as Promise from "es6-promise"; import * as path from "path"; import * as fs from "fs"; -import {SanityColdLead, SanityTransformHwHomePage} - from "../../src/common/sanityIo/Types"; -import {urlFor} from - "../../src/components/block-content-ui/static-pages/cmsStaticPagesClient"; +// import {SanityColdLead, SanityTransformHwHomePage} +// from "../../src/common/sanityIo/Types"; +// import {urlFor} from +// "../../src/components/block-content-ui/static-pages/cmsStaticPagesClient"; import sendGridClient from "./sendGridClient"; +import imageUrlBuilder from "@sanity/image-url"; +// import {SanityImageSource} from "@sanity/asset-utils"; +import {sanityClient} from "./sanityClient"; // To Throttle requests to sanity Promise.polyfill(); @@ -49,6 +52,10 @@ const Logger = function(req: any, res: any, next: any) { // app.use(require("prerender-node") // .set("prerenderToken", process.env.PRERENDER_TOKEN)); +const builder = imageUrlBuilder(sanityClient); +export const urlFor = (source: any) => { + return builder.image(source); +}; app.use(Logger); // https://blog.logrocket.com/adding-dynamic-meta-tags-react-app-without-ssr/ @@ -107,7 +114,7 @@ const serveIndexFile = (req: any, res: any) => { logClient.log("server-side", "NOTICE", "Loading this page from sanity", pageSlug); try { - const pageFromSanity: SanityTransformHwHomePage = await cmsClient.fetchPage(pageSlug); + const pageFromSanity: any = await cmsClient.fetchPage(pageSlug); // console.log("IMAGE URL", pageFromSanity.metaImage && urlFor(pageFromSanity.metaImage).url()?.replace("undefined", process.env.SANITY_DB ?? "development")); const page = { @@ -140,7 +147,7 @@ const serveIndexFile = (req: any, res: any) => { app.post("/send-email-resume", async (req: any, functionRes: any) => { - const reqBody: SanityColdLead = JSON.parse(req.body); + const reqBody: any = JSON.parse(req.body); logClient.log("send-email-address", "NOTICE", "Request to collect an email address and send them an email", reqBody.email); @@ -174,7 +181,7 @@ app.post("/send-email-resume", app.post("/collect-email-address", async (req: any, functionRes: any) => { - const reqBody: SanityColdLead = JSON.parse(req.body); + const reqBody: any = JSON.parse(req.body); logClient.log("collect-email-address", "NOTICE", "Request to collect an email address", reqBody.email); diff --git a/src/App.tsx b/src/App.tsx index 5a828731..f1cff657 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -12,6 +12,8 @@ import ModalProvider from "./components/snackbar-context/ModalProvider"; import SnackbarProvider from "./components/modal-context/SnackbarProvider"; import PageMux from "./components/mackenzies-mind/pages/PageMux"; import QrCodeProvider from "./components/qr-code-context/QrCodeProvider"; +import TheOtherSide from "./components/the-drinkery/TheOtherSide"; +import TheDrinkerySpecials from "./components/the-drinkery/TheDrinkerySpecials"; export enum RoutesEnum { THN = "/the-handsomest-nerd-internal/:pageSlug", @@ -50,6 +52,8 @@ function App() { + }/> + }/> }/> }/> `url(${props.bgImage})`, backgroundSize: 'cover', - backgroundPosition: 'right', + backgroundPosition: 'center', backgroundColor: DigitalResumeTheme.palette.background.default }, fullSection: { diff --git a/src/components/the-drinkery/Drinkery.png b/src/components/the-drinkery/Drinkery.png new file mode 100644 index 00000000..203b4e85 Binary files /dev/null and b/src/components/the-drinkery/Drinkery.png differ diff --git a/src/components/the-drinkery/Shutterstock_1025370412.png b/src/components/the-drinkery/Shutterstock_1025370412.png new file mode 100644 index 00000000..dece9ce6 Binary files /dev/null and b/src/components/the-drinkery/Shutterstock_1025370412.png differ diff --git a/src/components/the-drinkery/TheDrinkerySpecials.tsx b/src/components/the-drinkery/TheDrinkerySpecials.tsx new file mode 100644 index 00000000..a6a42cfc --- /dev/null +++ b/src/components/the-drinkery/TheDrinkerySpecials.tsx @@ -0,0 +1,139 @@ +import React, {FunctionComponent} from 'react' +import {Avatar, Grid, Link, Typography, useMediaQuery, useTheme} from '@material-ui/core' +import clsx from "clsx"; +import {COLORS} from "../../theme/DigitalResumeTheme"; +import CssFadeToColor from "../css-fade-to-color/CssFadeToColor"; +import useCustomStyles from "../mackenzies-mind/pages/Styles"; +import bgImage from "./drinkery-background.jpg" +import TheOtherSideLogo from "./TheOtherSideLogo"; +import openDoorSign from './Shutterstock_1025370412.png' +import ashboy from "./ashboy-drinkery.jpg"; +import jt from "./jt-drinkery.jpg"; + +interface IProps { + email?: string +} + +const TheDrinkerySpecials: FunctionComponent = (props) => { + const classes = useCustomStyles({bgImage: bgImage}) + const theme = useTheme() + const smDown = useMediaQuery(theme.breakpoints.down('sm')) + const xsDown = useMediaQuery(theme.breakpoints.down('xs')) + + return ( + + + + + + + + + + + Weekly Drink Specials + + + (must mention qrcode) + + + + 2 for 1 Natty Boh + + + + Get Two Natty Bohs for the price of one. + + + + + + Meet your Bartenders + + + + + + + + + Tim + + + + + + + + + Dre + + + + + + + + Shaun + + + + + + + + + + Checkout the Other Side! + + + + + + + (click + to enter) + + + + + + + + + ) +} + +export default TheDrinkerySpecials \ No newline at end of file diff --git a/src/components/the-drinkery/TheOtherSide.tsx b/src/components/the-drinkery/TheOtherSide.tsx new file mode 100644 index 00000000..74bf3e77 --- /dev/null +++ b/src/components/the-drinkery/TheOtherSide.tsx @@ -0,0 +1,147 @@ +import React, {FunctionComponent} from 'react' +import {Avatar, Grid, Typography, useMediaQuery, useTheme} from '@material-ui/core' +import clsx from "clsx"; +import {COLORS} from "../../theme/DigitalResumeTheme"; +import CssFadeToColor from "../css-fade-to-color/CssFadeToColor"; +import useCustomStyles from "../mackenzies-mind/pages/Styles"; +import bgImage from "./drinkery-background.jpg" +import TheOtherSideLogo from "./TheOtherSideLogo"; +import openDoorSign from "./Shutterstock_1025370412.png"; +import ashboy from "./ashboy-drinkery.jpg"; +import jt from "./jt-drinkery.jpg"; + +interface IProps { + email?: string +} + +const TheOtherSide: FunctionComponent = (props) => { + const classes = useCustomStyles({bgImage: bgImage}) + const theme = useTheme() + const smDown = useMediaQuery(theme.breakpoints.down('sm')) + const xsDown = useMediaQuery(theme.breakpoints.down('xs')) + + return ( + + + + + + + + + + + ...the Other Side + + + + + + + + + + + Bartenders + + + + + + + + + + Ashley + + + + + + + + + Terrell + + + + + + + + {/**/} + + {/* */} + {/* Wednesdays with Ashley*/} + {/* */} + {/* */} + {/* 7:30pm-12am*/} + {/* */} + {/**/} + + + + Thursdays with Terrell + + + 7:30pm-1am + + + + + + Fridays with Terrell + + + 7:30pm-1am + + + + + + Saturdays with Ashley + + + 7:30pm-1am + + + + + + Sundays with Terrell + + + 7:30pm-1am + + + + + + + + + ) +} + +export default TheOtherSide \ No newline at end of file diff --git a/src/components/the-drinkery/TheOtherSideLogo.tsx b/src/components/the-drinkery/TheOtherSideLogo.tsx new file mode 100644 index 00000000..4c51eac9 --- /dev/null +++ b/src/components/the-drinkery/TheOtherSideLogo.tsx @@ -0,0 +1,39 @@ +import React, {FunctionComponent} from 'react' +import {makeStyles, Theme} from "@material-ui/core/styles" +import {Grid} from '@material-ui/core' +import {SanityImageSource} from "@sanity/asset-utils"; +import logoImg from './drinkery-logo.png' + + +interface CssProps { + logoImageSrc?: SanityImageSource + height?: number +} + +export const useStyles = makeStyles((theme: Theme) => ({ + root: (props: CssProps) => ({ + backgroundImage: `url(${logoImg})`, + backgroundSize: "contain", + backgroundRepeat: "no-repeat", + minWidth: "100px", + height: `${props.height ?? 68}px`, + // marginTop: theme.spacing(2), + // marginBottom: theme.spacing(2) + }), +})) + +interface LogoProps { + logoImageSrc?: SanityImageSource + height?: number + isCenter?: boolean +} + +const TheOtherSideLogo: FunctionComponent = (props) => { + const classes = useStyles({logoImageSrc: props.logoImageSrc, height: props.height}) + + return ( + + ) +} + +export default TheOtherSideLogo \ No newline at end of file diff --git a/src/components/the-drinkery/ashboy-drinkery.jpg b/src/components/the-drinkery/ashboy-drinkery.jpg new file mode 100644 index 00000000..92f147a8 Binary files /dev/null and b/src/components/the-drinkery/ashboy-drinkery.jpg differ diff --git a/src/components/the-drinkery/drinkery-background.jpg b/src/components/the-drinkery/drinkery-background.jpg new file mode 100644 index 00000000..2fe6dc01 Binary files /dev/null and b/src/components/the-drinkery/drinkery-background.jpg differ diff --git a/src/components/the-drinkery/drinkery-logo.png b/src/components/the-drinkery/drinkery-logo.png new file mode 100644 index 00000000..0c6f0e16 Binary files /dev/null and b/src/components/the-drinkery/drinkery-logo.png differ diff --git a/src/components/the-drinkery/jt-drinkery.jpg b/src/components/the-drinkery/jt-drinkery.jpg new file mode 100644 index 00000000..9a5bace8 Binary files /dev/null and b/src/components/the-drinkery/jt-drinkery.jpg differ diff --git a/src/components/the-drinkery/shutterstock_665407219.jpg b/src/components/the-drinkery/shutterstock_665407219.jpg new file mode 100644 index 00000000..11b3af0e Binary files /dev/null and b/src/components/the-drinkery/shutterstock_665407219.jpg differ diff --git a/transformative-hw.iml b/st-joseph-freewill-baptist-church.iml similarity index 100% rename from transformative-hw.iml rename to st-joseph-freewill-baptist-church.iml