Home Reference Source

application/components/changelog.js

import React, {Component} from 'react';
import {connect} from 'react-redux';
import Dialog from 'material-ui/Dialog';
import FlatButton from 'material-ui/FlatButton';
import RaisedButton from 'material-ui/RaisedButton';
import {RadioButton, RadioButtonGroup} from 'material-ui/RadioButton';
import Markdown from 'react-remarkable';

import Config from '../config';

class ChangeLog extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        const actions = [
            <FlatButton
                label="Close"
                primary={true}
                keyboardFocused={true}
                onClick={this.props.onRequestClose}
                />
        ];
        return (
            <Dialog
                title="There have been a few updates..."
                actions={actions}
                modal={false}
                open={this.props.application.doNotifyChanges}
                autoScrollBodyContent={true}
                >
                <p>We have updated a few things since you last logged in:</p>
                <Markdown source={atob(Config.get('changelog'))} />
            </Dialog>
        );
    }
}

const mapStateToProps = (state) => ({
    application: state.application
});

export default connect(mapStateToProps)(ChangeLog);