summaryrefslogtreecommitdiffstats
path: root/webapp/components/backstage/components/backstage_header.jsx
blob: 65ba5c77d9f19b187d656e7c7ad460115e7d3874 (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
30
31
32
33
34
35
36
37
38
39
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import React from 'react';

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

    render() {
        const children = [];

        React.Children.forEach(this.props.children, (child, index) => {
            if (index !== 0) {
                children.push(
                    <span
                        key={'divider' + index}
                        className='backstage-header__divider'
                    >
                        <i className='fa fa-angle-right'/>
                    </span>
                );
            }

            children.push(child);
        });

        return (
            <div className='backstage-header'>
                <h1>
                    {children}
                </h1>
            </div>
        );
    }
}