-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
playground.tsx
45 lines (42 loc) · 1.02 KB
/
playground.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
import '@stoplight/elements/styles.min.css';
import {
Preflight,
ThemeProvider,
defaultTheme,
x,
} from '@xstyled/styled-components';
import dynamic from 'next/dynamic';
import Head from 'next/head';
const APIDocumentUI = dynamic<{
apiDescriptionUrl: string;
layout?: 'sidebar' | 'stacked';
router?: 'history' | 'memory' | 'hash' | 'static';
}>(
import('@stoplight/elements').then(({ API }) => API),
{
ssr: false,
loading: () => <p>Loading...</p>,
}
);
const theme = {
...defaultTheme,
};
export default function Playground() {
return (
<ThemeProvider theme={theme}>
<x.div h="100vh" mx="auto">
<Preflight />
<Head>
<title>Next Swagger Doc Demo App</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/favicon.ico" />
</Head>
<APIDocumentUI
apiDescriptionUrl="/swagger.json"
layout="sidebar"
router="hash"
/>
</x.div>
</ThemeProvider>
);
}