UNPKG

1.71 kBTypeScriptView Raw
1/*
2 * Copyright 2017 Palantir Technologies, Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17import classNames from "classnames";
18import * as React from "react";
19import { polyfill } from "react-lifecycles-compat";
20
21import { AbstractPureComponent2, Classes } from "../../common";
22import { DISPLAYNAME_PREFIX, HTMLDivProps, Props } from "../../common/props";
23
24// eslint-disable-next-line deprecation/deprecation
25export type NavbarHeadingProps = INavbarHeadingProps;
26/** @deprecated use NavbarHeadingProps */
27export interface INavbarHeadingProps extends Props, HTMLDivProps {
28 // allow the empty interface so we can label it clearly in the docs
29}
30
31// this component is simple enough that tests would be purely tautological.
32/* istanbul ignore next */
33@polyfill
34export class NavbarHeading extends AbstractPureComponent2<NavbarHeadingProps> {
35 public static displayName = `${DISPLAYNAME_PREFIX}.NavbarHeading`;
36
37 public render() {
38 const { children, className, ...htmlProps } = this.props;
39 return (
40 <div className={classNames(Classes.NAVBAR_HEADING, className)} {...htmlProps}>
41 {children}
42 </div>
43 );
44 }
45}