demoApp.jsx 1.92 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';
Patrik Meijer's avatar
Patrik Meijer committed
11
12
13
14
15
16
17
18
19
20
21
22
23


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
24
                title: 'AttributeEditor',
Patrik Meijer's avatar
Patrik Meijer committed
25
26
27
            },
            {
                component: <DemoProjectSeedCards/>,
Patrik Meijer's avatar
Patrik Meijer committed
28
29
30
31
32
                title: 'ProjectSeedCards',
            },
            {
                component: <DemoConfirmDialog/>,
                title: 'ConfirmDialog',
Patrik Meijer's avatar
Patrik Meijer committed
33
            },
34
35
36
37
            {
                component: <DemoUserProfileNavigator/>,
                title: 'UserProfileNavigator',
            },
Patrik Meijer's avatar
Patrik Meijer committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
        ];

        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}}>
                            {info.component}
                            </div>
                        </ExpansionPanel>
                    )
                })}
            </div>);
    };
};