/
navbarGroup.tsx
40 lines (35 loc) · 1.29 KB
/
navbarGroup.tsx
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
40
/*
* Copyright 2017 Palantir Technologies, Inc. All rights reserved.
*
* Licensed under the terms of the LICENSE file distributed with this project.
*/
import classNames from "classnames";
import * as React from "react";
import { Alignment } from "../../common/alignment";
import * as Classes from "../../common/classes";
import { IProps } from "../../common/props";
export interface INavbarGroupProps extends React.HTMLProps<HTMLDivElement>, IProps {
/**
* The side of the navbar on which the group should appear.
* The `Alignment` enum provides constants for these values.
* @default Alignment.LEFT
*/
align?: Alignment;
}
// this component is simple enough that tests would be purely tautological.
/* istanbul ignore next */
export class NavbarGroup extends React.PureComponent<INavbarGroupProps, {}> {
public static displayName = "Blueprint2.NavbarGroup";
public static defaultProps: INavbarGroupProps = {
align: Alignment.LEFT,
};
public render() {
const { align, children, className, ...htmlProps } = this.props;
const classes = classNames(Classes.NAVBAR_GROUP, Classes.alignmentClass(align), className);
return (
<div className={classes} {...htmlProps}>
{children}
</div>
);
}
}