Skip to content

Instantly share code, notes, and snippets.

View joshua-isaac's full-sized avatar
🧪
experimenting

joshua joshua-isaac

🧪
experimenting
View GitHub Profile
export async function getStaticProps({
preview,
params,
locale,
defaultLocale,
locales,
}) {
const globalComponents = {
header: SiteHeader,
};
@joshua-isaac
joshua-isaac / Form Builder
Created May 18, 2021 13:40
Form Builder Agility CMS Content Modelling
import React from "react"
const ServiceForm = ({ form, handleClose }) => {
return (
<form
name={form.customFields.name}
method="POST"
data-netlify="true"
action="/thank-you"
className="max-w-full md:max-w-lg mx-auto"
{
"items": [
{
"contentID": 15,
"properties": {
"state": 2,
"modified": "2019-07-18T13:16:41.033",
"versionID": 105,
"referenceName": "posts",
"definitionName": "Post",
curl https://api.aglty.io/4582b5fa-u/fetch/en-us/list/posts
--header "APIKey: defaultlive.2b7f3a91559d794bedb688358be5e13af2b1e3ae8cd39e8ed2433bbef5d8d6ac"
@joshua-isaac
joshua-isaac / Layout.js
Last active November 12, 2020 23:00
Adding Snipcart CSS, Script & Hidden Div to Layout.js file
import PreviewBar from "./PreviewBar";
import GlobalHeader from "./GlobalHeader";
import GlobalFooter from "./GlobalFooter";
import { useRouter } from "next/router";
import Head from "next/head";
import dynamic from "next/dynamic";
import tw from "twin.macro";
const MainElem = tw.main`p-8`;
@joshua-isaac
joshua-isaac / products.js
Last active November 13, 2020 15:13
Fetch products from Products Content List in Agility CMS with Agility Content Fetch SDK
import agility from "@agility/content-fetch";
// setup content fetch
const api = agility.getApi({
guid: process.env.AGILITY_GUID,
apiKey: process.env.AGILITY_API_FETCH_KEY,
});
// get products
const getProducts = async () => {
@joshua-isaac
joshua-isaac / ProductListing.js
Last active November 12, 2020 21:48
ProductListing Module for Agility CMS + Snipcart Tutorial
import React from "react";
import tw from "twin.macro";
const Container = tw.div`container mx-auto grid gap-5 grid-cols-1 sm:grid-cols-3 mb-8`;
const Card = tw.div`my-8`;
const Title = tw.h1`mt-2 text-xl font-bold`;
const Price = tw.p`text-sm mb-2 text-primary-600 font-bold`;
const Button = tw.button`bg-primary-600 text-white w-full p-2 font-bold mt-2`;
const ProductListing = ({ customData, fields, page }) => {