This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a cool way to add a gist! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This assumes that you've already set up Apollo Client and have wrapped your React app in an ApolloProvider component. | |
//Inside your component you want to make the query from and display that data in: | |
import { gql, useQuery } from "@apollo/client"; | |
const AddOns = () => { | |
const [cartItems, setCartItems] = useState([]); | |
const [sort, setSort] = useState("salePrice_DESC"); | |
const [productTypeFilter, setProductTypeFilter] = useState([]); | |
const [strainTypeFilter, setstrainTypeFilter] = useState([]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create a .env file and assign all of your firebase private keys to variables and refernce them in the firebase component. | |
// In the firebase.js component: | |
import firebase from "firebase/app"; | |
import "firebase/firestore"; | |
import "firebase/auth"; | |
import "firebase/database"; | |
const app = { | |
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction | |
// Create a file in your pages folder and define what actions to take on your content | |
import * as contentful from "contentful-management"; | |
export default async (req, res) => { | |
console.log("whats in request body", typeof req.body); | |
const client = contentful.createClient({ | |
// This is the access token for this space. Normally you get the token in the Contentful web app | |
accessToken: "ppfbfBBbqdaC4KTIqne8rtJhU_XXChx6rBzXbX6x8gI", |