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>
))}
export const buildPaywallConfig = ( | |
address: string, | |
memberLevel: MembershipLevel, | |
metaData: Array<Record<any, any>> | null, | |
endingCallToAction = "Go to profile" | |
) => { | |
const lockAddress = contractAddresses[memberLevel]; | |
return { | |
icon: "https://www.bestdishever.nyc/bde-logomark.png", | |
locks: { |
"abi": [ | |
{ | |
"inputs": [ | |
{ | |
"internalType": "string", | |
"name": "_baseUri", | |
"type": "string" | |
}, | |
{ | |
"internalType": "address", |
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"; |
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 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, |
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>
))}
{"lastUpload":"2020-08-03T13:31:40.214Z","extensionVersion":"v3.4.3"} |
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":"2018-09-05T20:44:40.966Z","extensionVersion":"v3.1.2"} |
{"lastUpload":"2018-09-05T20:43:28.176Z","extensionVersion":"v3.1.2"} |