demoApp.jsx 2.31 KB
Newer Older
Patrik Meijer's avatar
Patrik Meijer committed
1
2
3
4
5
6
/* global window */
import React, {Component} from 'react';
import ExpansionPanel from '@material-ui/core/ExpansionPanel';
import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';
import Typography from '@material-ui/core/Typography';

Patrik Meijer's avatar
Patrik Meijer committed
7
8
import DemoProjectSeedCards from '../src/components/ProjectSeedCards/demo';
import DemoAttributeEditor from '../src/components/AttributeEditor/demo';
Patrik Meijer's avatar
Patrik Meijer committed
9
import DemoConfirmDialog from '../src/components/ConfirmDialog/demo';
10
import DemoUserProfileNavigator from '../src/components/UserProfileNavigator/demo';
Tamas Kecskes's avatar
Tamas Kecskes committed
11
12
import DemoModalSpinner from '../src/components/ModalSpinner/demo';
import DemoContainmentCanvas from '../src/components/ContainmentCanvas/demo';
Patrik Meijer's avatar
Patrik Meijer committed
13
14
15
16
17
18
19
20
21
22
23
24

export default class demoApp extends Component {
    componentDidMount() {
        window.onGMEInit = () => {
            window.gmeClient = new window.GME.classes.Client(window.GME.gmeConfig);
        };
    }

    render() {
        const DEMOS = [
            {
                component: <DemoAttributeEditor/>,
Patrik Meijer's avatar
Patrik Meijer committed
25
                title: 'AttributeEditor',
Patrik Meijer's avatar
Patrik Meijer committed
26
27
28
            },
            {
                component: <DemoProjectSeedCards/>,
Patrik Meijer's avatar
Patrik Meijer committed
29
30
31
32
33
                title: 'ProjectSeedCards',
            },
            {
                component: <DemoConfirmDialog/>,
                title: 'ConfirmDialog',
Patrik Meijer's avatar
Patrik Meijer committed
34
            },
35
36
37
38
            {
                component: <DemoUserProfileNavigator/>,
                title: 'UserProfileNavigator',
            },
Tamas Kecskes's avatar
Tamas Kecskes committed
39
40
41
42
43
44
45
46
            {
                component: <DemoModalSpinner/>,
                title: 'ModalSpinner',
            },
            // {
            //     component: <DemoContainmentCanvas/>,
            //     title: 'ContainmentCanvas',
            // },
Patrik Meijer's avatar
Patrik Meijer committed
47
48
49
50
51
52
53
54
55
56
57
        ];

        return (
            <div>
                {DEMOS.map((info) => {
                    return (
                        <ExpansionPanel defaultExpanded key={info.title}>
                            <ExpansionPanelSummary>
                                <Typography variant="headline" color="textSecondary">{info.title}</Typography>
                            </ExpansionPanelSummary>
                            <div style={{padding: 20}}>
Tamas Kecskes's avatar
Tamas Kecskes committed
58
                                {info.component}
Patrik Meijer's avatar
Patrik Meijer committed
59
60
61
62
63
64
65
                            </div>
                        </ExpansionPanel>
                    )
                })}
            </div>);
    };
};