Skip to content

Instantly share code, notes, and snippets.

@AlbionaHoti
Created October 15, 2020 19:38
Show Gist options
  • Save AlbionaHoti/5c07c415d6bedfd6bc910bcd0ec64f3a to your computer and use it in GitHub Desktop.
Save AlbionaHoti/5c07c415d6bedfd6bc910bcd0ec64f3a to your computer and use it in GitHub Desktop.
e-commerce-starter
import React, { useState } from 'react';
// Ant Design
import { Layout } from 'antd';
const { Content, Footer } = Layout;
// Header
import HeaderComponent from './Header';
// Stripe
import { loadStripe } from '@stripe/stripe-js';
import { Elements } from '@stripe/react-stripe-js';
const stripePromise = loadStripe(`${process.env.PUBLISHABLE_KEY}`);
function LayoutComponent(props) {
return (
<div>
<HeaderComponent title={props.title} />
<Content className="site-layout">
<Layout
className="site-layout-background"
style={{
padding: '24px 0',
marginTop: 64,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
minHeight: '800px',
background: '#fff',
}}
>
<Content
style={{
padding: '24px',
}}
>
<Elements stripe={stripePromise}>
{props.children}
</Elements>
</Content>
</Layout>
<Footer style={{ textAlign: 'center', background: '#fff' }}>
E-Commerce Website with Webiny and Next.js @ 2020
</Footer>
</Content>
</div>
);
}
export default LayoutComponent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment