Have been talking about the best way to get data out of the yaml to then map
in a component like the below
<ul>
{listItems.map(item => (
<li>
{item}
</li>
))}
<div id="mc_embed_signup"> | |
<form action="//h2melon.us12.list-manage.com/subscribe/post?u=15a1ba46f2ef3436777ccec17&id=36e7be12c9" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate news-form page-form" target="_blank" novalidate="true"> | |
<div id="mc_embed_signup_scroll"> | |
<label class="form-response" for="mce-email"></label> | |
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups--> | |
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_15a1ba46f2ef3436777ccec17_36e7be12c9" tabindex="-1" value=""></div> | |
<input type="email" value="" name="EMAIL" class="email" id="mce-email" placeholder="email address" required=""> | |
<input type="submit" value="Sign Up" name="subscribe" id="mc-embedded-subscribe" class="button"> | |
</div> | |
</form> |
<script type="text/javascript"> | |
(function(){ if(!window.jQuery) { | |
var script= document.createElement("script"); | |
script.src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"; | |
script.async = true; | |
script.type = "text/javascript"; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
}})(); | |
</script> | |
<script type="text/javascript" src="https://cdn.jsdelivr.net/keen.js/3.4.1/keen.min.js"></script> |
{"lastUpload":"2018-09-05T20:43:28.176Z","extensionVersion":"v3.1.2"} |
{"lastUpload":"2018-09-05T20:44:40.966Z","extensionVersion":"v3.1.2"} |
groupData = posts => { | |
const array = Object.values(posts); | |
const res = array.reduce((acc, curr) => { | |
if (!acc[curr.data.subreddit]) { | |
acc[curr.data.subreddit] = []; | |
} | |
// If this subreddit wasn't previously stored create an empty array | |
acc[curr.data.subreddit].push(curr); // Add the post to group |
{"lastUpload":"2020-08-03T13:31:40.214Z","extensionVersion":"v3.4.3"} |
Have been talking about the best way to get data out of the yaml to then map
in a component like the below
<ul>
{listItems.map(item => (
<li>
{item}
</li>
))}
import React, { useState, useEffect, useContext } from "react"; | |
import { Checkout } from "shopify-storefront-api-typings"; | |
import Client from "shopify-buy"; | |
const SHOPIFY_CHECKOUT_STORAGE_KEY = "shopify_checkout_id"; | |
const storefrontAccessToken = process.env.GASTBY_SHOPIFY_ACCESS_TOKEN as string; | |
const client = Client.buildClient({ | |
storefrontAccessToken, |
import * as React from "react"; | |
import { useImmer } from "use-immer"; | |
import Select from "part:@sanity/components/selects/default"; | |
import Fieldset from "part:@sanity/components/fieldsets/default"; | |
import PatchEvent, { setIfMissing, set } from "part:@sanity/form-builder/patch-event"; | |
import { FormBuilderInput } from "part:@sanity/form-builder"; | |
import { FIELD_NAMES } from "./consts"; | |
import Variant from "./variant"; |
import * as React from "react"; | |
import ObjectInput from "@sanity/form-builder/lib/inputs/ObjectInput"; | |
import { TabList, TabPanel, Tab, Card } from "@sanity/ui"; | |
import { Fieldset } from "@sanity/types/lib/schema/types"; | |
import ValidationStatus from "@sanity/base/lib/__legacy/@sanity/components/validation/ValidationStatus"; | |
import { FieldsetMarkersCollection } from "../MarkersCollection"; | |
import styled from "@emotion/styled"; | |
import { sanityTheme } from "../common/theme"; | |
import { ObjectFormBuilder } from "../ObjectFormBuilder"; |