From 91a7e49e992814949fb8a6ede02d5fbedf155152 Mon Sep 17 00:00:00 2001 From: Michael Fix Date: Sat, 6 Mar 2021 18:13:04 -0800 Subject: [PATCH] remove mock stripe (#1191) --- components/Billing.js | 66 ++++--------------------------------------- package.json | 1 - pages/account.js | 6 ---- yarn.lock | 7 ----- 4 files changed, 6 insertions(+), 74 deletions(-) diff --git a/components/Billing.js b/components/Billing.js index 598912c..ba0bc61 100644 --- a/components/Billing.js +++ b/components/Billing.js @@ -1,5 +1,4 @@ import React from 'react' -import { Elements, StripeProvider, CardElement, injectStripe } from 'react-stripe-elements' import { useAsyncCallback } from 'actionsack' import Button from './Button' @@ -24,22 +23,11 @@ const X = ( ) -function Billing(props) { +export default function Billing() { const user = useAuth() - const [submit, { error, loading, data: success }] = useAsyncCallback(async e => { - e.preventDefault() - - const name = e.target.name.value.trim() - - const res = await props.stripe.createToken({ name }) - - if (res.error) { - throw res.error.message - } - - return {} - }) + const [submit, { error, loading }] = useAsyncCallback(() => true) + const success = true if (!user) { return ( @@ -70,10 +58,9 @@ function Billing(props) {

However, Carbon Diamond is not quite ready yet.
- Your card has not been charged or saved today. + {/* Your card has not been charged or saved today. */}
- We greatly appreciate your support, and will contact you when these premium features - launch! + We greatly appreciate your support, and will let you know when premium features launch!

— the Carbon Team{' '} @@ -92,32 +79,7 @@ function Billing(props) {

Please enter a credit or debit card:

- + {/** Insert Stripe element here */}
@@ -261,19 +223,3 @@ function Billing(props) { ) } - -const BillingWithStripe = injectStripe(Billing) - -export default function BillingPage() { - const [stripe, setStripe] = React.useState(null) - React.useEffect(() => { - setStripe(window.Stripe(process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY)) - }, []) - return ( - - - - - - ) -} diff --git a/package.json b/package.json index 3e921a7..b6409c0 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,6 @@ "react-dom": "^17.0.1", "react-image-crop": "^6.0.16", "react-mailchimp-subscribe": "^2.1.0", - "react-stripe-elements": "^6.1.2", "serialize-javascript": "^5.0.1", "tohash": "^1.0.2", "use-climate-change-reminder": "^0.0.7" diff --git a/pages/account.js b/pages/account.js index 87e800f..739bd0b 100644 --- a/pages/account.js +++ b/pages/account.js @@ -1,13 +1,11 @@ // Theirs import React from 'react' import dynamic from 'next/dynamic' -import Head from 'next/head' // Ours import Button from '../components/Button' import Page from '../components/Page' import MenuButton from '../components/MenuButton' -import { MetaLinks } from '../components/Meta' import { useAuth } from '../components/AuthContext' import { loginGitHub, logout } from '../lib/client' @@ -250,10 +248,6 @@ function Settings() { function SettingsPage() { return ( - -