-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EuiHeaderLogo
converted to TS (#1892)
* `EuiHeaderLogo` converted to TS * `EuiHeaderLogo` exported types * `EuiHeaderLogo` code review * `EuiHeaderLogo` snapshots
- Loading branch information
1 parent
55330de
commit 27fd998
Showing
6 changed files
with
54 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, { FunctionComponent, HTMLAttributes, ReactNode } from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
import { EuiIcon, IconType } from '../icon'; | ||
import { CommonProps } from '../common'; | ||
|
||
export interface EuiHeaderLogoProps { | ||
href?: string; | ||
iconType?: IconType; | ||
iconTitle?: string; | ||
children?: ReactNode; | ||
} | ||
|
||
export const EuiHeaderLogo: FunctionComponent< | ||
CommonProps & HTMLAttributes<HTMLAnchorElement> & EuiHeaderLogoProps | ||
> = ({ | ||
iconType = 'logoElastic', | ||
iconTitle = 'Elastic', | ||
href, | ||
children, | ||
className, | ||
...rest | ||
}) => { | ||
const classes = classNames('euiHeaderLogo', className); | ||
|
||
return ( | ||
<a href={href} className={classes} {...rest}> | ||
<EuiIcon className="euiHeaderLogo__icon" size="l" type={iconType} /> | ||
|
||
{children && <span className="euiHeaderLogo__text">{children}</span>} | ||
</a> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { | ||
EuiHeaderLogoProps as HeaderLogoProps, | ||
EuiHeaderLogo as HeaderLogo, | ||
} from './header_logo'; | ||
|
||
declare module '@elastic/eui' { | ||
/** | ||
* header logo type defs | ||
* | ||
* @see './header_logo.js' | ||
*/ | ||
export interface EuiHeaderLogoProps extends HeaderLogoProps {} | ||
export const EuiHeaderLogo: typeof HeaderLogo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters