2022-06-17 21:23:35 +02:00
|
|
|
import React from 'react'
|
|
|
|
import styled, {StyleSheetManager} from 'styled-components'
|
|
|
|
import {ItemSectionWithPreviews} from './ItemSectionWithPreviews'
|
|
|
|
import {PlaygroundHeader} from './PlaygroundHeader'
|
|
|
|
|
|
|
|
const HomeContainer = styled.div`
|
|
|
|
position: fixed;
|
|
|
|
inset: 0;
|
|
|
|
background: #1b1c1e;
|
2022-08-03 17:12:40 +02:00
|
|
|
overflow: auto;
|
2022-06-17 21:23:35 +02:00
|
|
|
`
|
|
|
|
const ContentContainer = styled.div`
|
|
|
|
padding: 0 5rem;
|
|
|
|
|
|
|
|
@media screen and (max-width: 920px) {
|
|
|
|
padding: 0 2rem;
|
|
|
|
}
|
|
|
|
`
|
|
|
|
|
|
|
|
const version = require('../../../../theatre/studio/package.json').version
|
|
|
|
|
|
|
|
const PageTitleH1 = styled.h1`
|
|
|
|
padding: 1rem 0;
|
|
|
|
`
|
|
|
|
|
|
|
|
export const PlaygroundPage = ({
|
|
|
|
groups,
|
|
|
|
}: {
|
|
|
|
groups: {[groupName: string]: string[]}
|
|
|
|
}) => (
|
|
|
|
<StyleSheetManager disableVendorPrefixes>
|
|
|
|
<HomeContainer>
|
|
|
|
<PlaygroundHeader
|
|
|
|
version={{
|
|
|
|
displayText: version,
|
|
|
|
}}
|
|
|
|
links={[
|
|
|
|
{
|
|
|
|
label: 'Docs',
|
2023-01-15 14:53:50 +01:00
|
|
|
href: 'https://www.theatrejs.com/docs/latest',
|
2022-06-17 21:23:35 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Github',
|
|
|
|
href: 'https://github.com/theatre-js/theatre',
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
/>
|
|
|
|
<ContentContainer>
|
|
|
|
<PageTitleH1>Playground</PageTitleH1>
|
|
|
|
{Object.entries(groups).map(([groupName, modules]) => (
|
|
|
|
<ItemSectionWithPreviews
|
|
|
|
key={`group-${groupName}`}
|
|
|
|
groupName={groupName}
|
|
|
|
modules={modules}
|
|
|
|
/>
|
|
|
|
))}
|
|
|
|
</ContentContainer>
|
|
|
|
</HomeContainer>
|
|
|
|
</StyleSheetManager>
|
|
|
|
)
|