summaryrefslogtreecommitdiffstats
path: root/webapp/components/help/help_controller.jsx
blob: b58a93320d3c8298a2e5e3593c5e88ee00ee20f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import PropTypes from 'prop-types';

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import React from 'react';
import ReactDOM from 'react-dom';

export default class HelpController extends React.Component {
    static get propTypes() {
        return {
            children: PropTypes.node.isRequired
        };
    }

    componentWillUpdate() {
        ReactDOM.findDOMNode(this).scrollIntoView();
    }

    render() {
        return (
            <div className='help'>
                <div className='container col-sm-10 col-sm-offset-1'>
                    {this.props.children}
                </div>
            </div>
        );
    }
}