Skip to content

Commit

Permalink
create SandboxContainer component, and replace markup in sandbox.tsx …
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
gwyneplaine committed Oct 13, 2022
1 parent db2c33f commit fb24697
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions polaris.shopify.com/pages/sandbox.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import SandboxHeader from '../src/components/SandboxHeader';
import SandboxHelpDialog from '../src/components/SandboxHelpDialog';
import {useEffect, useRef, useState} from 'react';
import {useRouter} from 'next/router';
import type {InferGetServerSidePropsType, GetServerSideProps} from 'next';
import {useRouter} from 'next/router';

import SandboxHeader from '../src/components/SandboxHeader';
import SandboxHelpDialog from '../src/components/SandboxHelpDialog';
import SandboxContainer from '../src/components/SandboxContainer';

export const getServerSideProps: GetServerSideProps = async ({query}) => {
// We need to pass initial query param to our nested iframe
Expand Down Expand Up @@ -70,17 +72,7 @@ export default function Sandbox({
}, [router]);

return (
<div
className="styles-for-site-but-not-polaris-examples"
style={{
display: 'flex',
flexDirection: 'column',
width: '100%',
height: '100vh',
margin: 0,
padding: 0,
}}
>
<SandboxContainer>
<SandboxHeader
setHelpIsOpen={setHelpIsOpen}
url={typeof window !== 'undefined' ? window.location.href : ''}
Expand All @@ -98,6 +90,6 @@ export default function Sandbox({
width="100%"
height="100%"
/>
</div>
</SandboxContainer>
);
}

0 comments on commit fb24697

Please sign in to comment.