Sha256: cd77edd9bc8fbd08a245089f6562ff958c018052af644e233c78bd93d6208c8b

Contents?: true

Size: 1.23 KB

Versions: 3

Compression:

Stored size: 1.23 KB

Contents

import React from 'react';
import classnames from 'classnames';
import { observer } from 'mobx-react';
import { Grid } from 'react-flexbox-grid';
import Box from 'grommet/components/Box';

import Screens from '../screens';

const ScreenView = observer((props) => {
    const { screen: Screen, ...rest } = props;
    return (
        <Screen.component {...rest} screen={Screen} />
    );
});
ScreenView.displayName = 'ScreenView';

@observer
export default class Screen extends React.Component {

    static propTypes = {
        params: React.PropTypes.shape({
            screenId: React.PropTypes.string,
        }).isRequired,
    }

    componentDidMount() {
        const { screenId } = this.props.params;
        if (screenId) {
            const definition = Screens.getDefinition(screenId);
            if (definition) { definition.display(); }
        }
    }

    render() {
        return (
            <Box
                full
                className="screens-wrapper"
                justify="start"
                align="stretch"
                flex="grow"
            >
                {Screens.displaying.map(s =>
                    <ScreenView key={s.id} {...this.props.params} screen={s} />)}
            </Box>

        );
    }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lanes-0.8.2 client/lanes/workspace/screen.jsx
lanes-0.8.1 client/lanes/workspace/screen.jsx
lanes-0.8.0 client/lanes/workspace/screen.jsx