Skip to content

Commit a23a136

Browse files
authored
feat: use new Forma 36 Layout component [UFO-1876] (#9971)
1 parent e124306 commit a23a136

File tree

11 files changed

+327
-270
lines changed

11 files changed

+327
-270
lines changed

apps/graphql-playground-v2/package-lock.json

Lines changed: 65 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/graphql-playground-v2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"dependencies": {
66
"@contentful/app-sdk": "^4.23.1",
77
"@contentful/f36-components": "^4.54.0",
8+
"@contentful/f36-layout": "5.0.0-alpha.18",
89
"@contentful/f36-tokens": "^4.0.2",
9-
"@contentful/f36-workbench": "^4.21.0",
1010
"@contentful/react-apps-toolkit": "^1.2.16",
1111
"@emotion/css": "^11.13.4",
1212
"@graphiql/toolkit": "^0.10.0",

apps/graphql-playground-v2/src/components/GraphiqlView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import 'graphiql/graphiql.min.css';
66
import { Box } from '@contentful/f36-components';
77
import { css } from '@emotion/css';
88

9-
//TODO: make it 100% height :)
109
const style = css({
1110
height: '800px',
11+
minHeight: '100vh',
1212
});
1313

1414
type Props = {

apps/graphql-playground-v2/src/components/Page.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
import React, { useState } from 'react';
22
import { PageAppSDK } from '@contentful/app-sdk';
3+
import { css } from '@emotion/css';
34
import { GraphiqlView } from './GraphiqlView';
4-
import { Workbench } from '@contentful/f36-workbench';
55
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';
78

89
interface PageProps {
910
sdk: PageAppSDK;
1011
}
1112

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+
1220
const Page = (props: PageProps) => {
1321
const { sdk } = props;
1422
const { parameters } = sdk;
@@ -37,20 +45,19 @@ const Page = (props: PageProps) => {
3745
});
3846

3947
return cpaToken ? (
40-
<Workbench>
41-
<Workbench.Content type={'full'}>
48+
<Layout variant="fullscreen" offsetTop={0}>
49+
<Layout.Body className={styles.body}>
4250
<GraphiqlView
4351
spaceId={spaceId}
4452
environmentId={spaceEnvironmentAlias || spaceEnvironment}
4553
cpaToken={cpaToken}
4654
graphqlHost={sdk.hostnames.graphql}
4755
/>
48-
4956
<Modal isShown={isModelOpen} onClose={() => setModelOpen(false)}>
5057
<ModalContent>Go Vikas</ModalContent>
5158
</Modal>
52-
</Workbench.Content>
53-
</Workbench>
59+
</Layout.Body>
60+
</Layout>
5461
) : (
5562
<Card style={{ margin: '1em' }}>
5663
<Note variant="warning">

0 commit comments

Comments
 (0)