Commit 536ab8a0 authored by Tamas Kecskes's avatar Tamas Kecskes
Browse files

InfoCard component.

Also added index files where it was missing.
parent 9832a72a
Loading
Loading
Loading
Loading
+22 −15
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ import Typography from '@material-ui/core/Typography';
import {DragDropContext} from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';


import DemoProjectSeedCards from '../src/components/ProjectSeedCards/demo';
import DemoAttributeEditor from '../src/components/AttributeEditor/demo';
import DemoConfirmDialog from '../src/components/ConfirmDialog/demo';
@@ -14,7 +15,7 @@ import DemoUserProfileNavigator from '../src/components/UserProfileNavigator/dem
import DemoModalSpinner from '../src/components/ModalSpinner/demo';
import DemoContainmentCanvas from '../src/components/ContainmentCanvas/demo';
import DemoSingleConnectedNode from '../src/components/SingleConnectedNode/demo';

import DemoInfoCard from '../src/components/InfoCard//demo';


class demoApp extends Component {
@@ -49,11 +50,17 @@ class demoApp extends Component {
            {
                component: <DemoContainmentCanvas/>,
                title: 'ContainmentCanvas',
                height: 400
            },
            {
                component: <DemoSingleConnectedNode/>,
                title: 'SingleConnectedNode',
            },
            {
                component: <DemoInfoCard/>,
                title: 'InfoCard',
                height: 200
            },
        ];

        return (
@@ -64,7 +71,7 @@ class demoApp extends Component {
                            <ExpansionPanelSummary>
                                <Typography variant="headline" color="textSecondary">{info.title}</Typography>
                            </ExpansionPanelSummary>
                                <div style={{padding: 20}}>
                            <div style={{padding: 20, height: info.height}}>
                                {info.component}
                            </div>
                        </ExpansionPanel>
+1 −0
Original line number Diff line number Diff line
export {default} from './BasicEventManager';
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
import BasicConnectingComponent from './BasicConnectingComponent';
import ConnectionManager from './ConnectionManager';

export {ConnectionManager,BasicConnectingComponent};
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
import React, {Component} from 'react';
import ContainmentCanvas from './ContainmentCanvas';
import ContainmentCanvas from './index';

export default class DemoContainmentCanvas extends Component {
    constructor(props) {
+49 −0
Original line number Diff line number Diff line
import React from 'react';

import Card from '@material-ui/core/Card';
import CardActions from '@material-ui/core/CardActions';
import CardContent from '@material-ui/core/CardContent';
import Button from '@material-ui/core/Button';
import Typography from '@material-ui/core/Typography';

const InfoCard = (title, content, link) => {
    let button = link == null ? null : (
        <a href={link.target || 'https://www.google.com/'}
           target="_blank"
           rel="noopener noreferrer"
           key="infoBtn"
           style={{textDecoration: 'none'}}
        >
            <Button
                size="small"
                color="primary"
            >
                Learn More
            </Button>
        </a>
    );

    return (
        <Card style={{
            position: 'absolute',
            maxWidth: 600,
            left: 'calc(50% - 300px)',
            top: '20%',
        }}
        >
            <CardContent>
                <Typography style={{marginBottom: 20}} variant="headline" component="h2">
                    {title || 'An information card'}
                </Typography>
                <Typography component="p">
                    {content || 'You can describe your content and put onto the screen with a useful link.'}
                </Typography>
            </CardContent>
            <CardActions>
                {button}
            </CardActions>
        </Card>
    );
};

export default InfoCard;
 No newline at end of file
Loading