-
Notifications
You must be signed in to change notification settings - Fork 0
/
Layout.tsx
75 lines (71 loc) · 2.04 KB
/
Layout.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import React from 'react';
import Head from 'next/head';
import Link from 'next/link';
import { Elements } from '@stripe/react-stripe-js';
import { loadStripe } from '@stripe/stripe-js';
type Props = {
title?: string;
};
const stripePromise = loadStripe(process.env.STRIPE_PUBLISHABLE_KEY!);
const Layout: React.FunctionComponent<Props> = ({
children,
title = 'TypeScript Next.js Stripe Example'
}) => (
<Elements stripe={stripePromise}>
<Head>
<title>{title}</title>
<meta charSet="utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@thorwebdev" />
<meta name="twitter:title" content="TypeScript Next.js Stripe Example" />
<meta
name="twitter:description"
content="Full-stack TypeScript example using Next.js, react-stripe-js, and stripe-node."
/>
<meta
name="twitter:image"
content="https://nextjs-typescript-react-stripe-js.now.sh/social_card.png"
/>
</Head>
<div className="container">
<header>
<div className="header-content">
<Link href="/">
<a className="logo">
<img src="/logo.png" />
</a>
</Link>
<h1>
<span className="light">Stripe Sample</span>
<br />
Next.js, TypeScript, and Stripe 🔒💸
</h1>
</div>
</header>
{children}
</div>
<div className="banner">
<span>
This is a{' '}
<a
href="https://github.com/stripe-samples"
target="_blank"
rel="noopener noreferrer"
>
Stripe Sample
</a>
.{' View code on '}
<a
href="https://github.com/zeit/next.js/tree/canary/examples/with-stripe-typescript"
target="_blank"
rel="noopener noreferrer"
>
GitHub
</a>
.
</span>
</div>
</Elements>
);
export default Layout;