I hereby claim:
- I am albionahoti on github.
- I am hoti5 (https://keybase.io/hoti5) on keybase.
- I have a public key ASDAS744Bw6WJc4SwzRdgtY6kEEAagIkWvRuBO1kPcZqzQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import React, { useState } from 'react'; | |
// Ant Design | |
import { Layout } from 'antd'; | |
const { Content, Footer } = Layout; | |
// Header | |
import HeaderComponent from './Header'; | |
// Stripe |
// Ant design | |
import { Button, Form } from 'antd'; | |
// React context | |
import { CartContext, TotalContext } from '../context/Context'; | |
import { Col, Row } from 'antd'; | |
import React, { useContext, useState } from 'react'; | |
// Components | |
import { BillingDetailsFields } from './BillingDetailsField'; | |
// styled components |
// Apollo | |
import { useQuery, gql } from '@apollo/client'; | |
// Ant design | |
import { Row, Col } from 'antd'; | |
// Components | |
import ProductCard from './Product'; | |
export const QUERY = gql` |
import { useMemo } from 'react' | |
import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client' | |
let apolloClient | |
function createApolloClient() { | |
return new ApolloClient({ | |
ssrMode: typeof window === 'undefined', | |
link: new HttpLink({ | |
uri: process.env.CONTENT_DELIVERY_API_URL, |
import '../assets/antd-custom.less'; | |
// Layout Component | |
import LayoutComponent from '../components/Layout'; | |
// React Context | |
import { CartProvider } from '../context/Context'; | |
// Apollo | |
import { ApolloProvider } from '@apollo/client'; | |
import { useApollo } from '../lib/apolloClient'; |
import Stripe from 'stripe' | |
const stripe = new Stripe( | |
'STRIPE_SECRET_KEY_HERE' | |
) | |
export default async (req, res) => { | |
if (req.method === 'POST') { | |
try { | |
const { amount, paymentIntentId } = JSON.parse(req.body) |
import React, { useState, useContext } from 'react' | |
import Router from 'next/router' | |
// Stripe | |
import { CardElement, useStripe, useElements } from '@stripe/react-stripe-js' | |
import { destroyCookie } from 'nookies' | |
// React context | |
import { CartContext, TotalContext } from '../context/Context' |
import React from 'react' | |
import Stripe from 'stripe' | |
import { parseCookies, setCookie } from 'nookies' | |
import { loadStripe } from '@stripe/stripe-js' | |
import { Elements } from '@stripe/react-stripe-js' | |
// Components | |
import CheckoutForm from '../components/CheckoutForm' | |
// initialize the stripe library and create a payment intent |
import React, { useState } from 'react' | |
// Ant design | |
import { Input } from 'antd' | |
const { Search } = Input | |
import ProductList, { QUERY } from '../components/ProductList' // QUERY -> returns the producst and categories data | |
// Apollo |