|
1 | 1 | import React, { useState } from 'react'; |
2 | 2 | import { PageAppSDK } from '@contentful/app-sdk'; |
| 3 | +import { css } from '@emotion/css'; |
3 | 4 | import { GraphiqlView } from './GraphiqlView'; |
4 | | -import { Workbench } from '@contentful/f36-workbench'; |
5 | 5 | import { useQuery } from '@tanstack/react-query'; |
6 | | -import { Card, Modal, ModalContent, Note } from '@contentful/f36-components'; |
| 6 | +import { Card, GlobalStyles, Modal, ModalContent, Note } from '@contentful/f36-components'; |
| 7 | +import { Layout } from '@contentful/f36-layout'; |
7 | 8 |
|
8 | 9 | interface PageProps { |
9 | 10 | sdk: PageAppSDK; |
10 | 11 | } |
11 | 12 |
|
| 13 | +export const styles = { |
| 14 | + body: css({ |
| 15 | + // emotion version mismatch between this app and F36 requires this override |
| 16 | + padding: '0 !important', |
| 17 | + }), |
| 18 | +}; |
| 19 | + |
12 | 20 | const Page = (props: PageProps) => { |
13 | 21 | const { sdk } = props; |
14 | 22 | const { parameters } = sdk; |
@@ -37,20 +45,19 @@ const Page = (props: PageProps) => { |
37 | 45 | }); |
38 | 46 |
|
39 | 47 | return cpaToken ? ( |
40 | | - <Workbench> |
41 | | - <Workbench.Content type={'full'}> |
| 48 | + <Layout variant="fullscreen" offsetTop={0}> |
| 49 | + <Layout.Body className={styles.body}> |
42 | 50 | <GraphiqlView |
43 | 51 | spaceId={spaceId} |
44 | 52 | environmentId={spaceEnvironmentAlias || spaceEnvironment} |
45 | 53 | cpaToken={cpaToken} |
46 | 54 | graphqlHost={sdk.hostnames.graphql} |
47 | 55 | /> |
48 | | - |
49 | 56 | <Modal isShown={isModelOpen} onClose={() => setModelOpen(false)}> |
50 | 57 | <ModalContent>Go Vikas</ModalContent> |
51 | 58 | </Modal> |
52 | | - </Workbench.Content> |
53 | | - </Workbench> |
| 59 | + </Layout.Body> |
| 60 | + </Layout> |
54 | 61 | ) : ( |
55 | 62 | <Card style={{ margin: '1em' }}> |
56 | 63 | <Note variant="warning"> |
|
0 commit comments