First pass prettier/eslint and headwind

This commit is contained in:
Michael
2021-12-16 23:45:43 +01:00
parent ab9e3732d6
commit be7580c04d
47 changed files with 2149 additions and 1939 deletions

View File

@@ -1,14 +1,15 @@
/**
* This is a singleton to ensure we only instantiate Stripe once.
*/
import { Stripe, loadStripe } from '@stripe/stripe-js';
let stripePromise: Promise<Stripe | null>;
const getStripe = (): Promise<Stripe | null> => {
if (!stripePromise) {
stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY || '');
}
return stripePromise;
if (!stripePromise) {
stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY || '');
}
return stripePromise;
};
export default getStripe;