Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
pugnascotia committed Sep 27, 2019
1 parent 8c30585 commit 751ec9a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
21 changes: 8 additions & 13 deletions src/components/call_out/call_out.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ import { EuiText } from '../text';
type Color = 'primary' | 'success' | 'warning' | 'danger';
type Size = 's' | 'm';

export interface EuiCallOutProps {
title?: ReactNode;
iconType?: IconType;
color?: Color;
size?: Size;
}

type Props = CommonProps &
EuiCallOutProps &
Omit<HTMLAttributes<HTMLDivElement>, 'title'>;
export type EuiCallOutProps = CommonProps &
Omit<HTMLAttributes<HTMLDivElement>, 'title'> & {
title?: ReactNode;
iconType?: IconType;
color?: Color;
size?: Size;
};

const colorToClassNameMap: { [color in Color]: string } = {
primary: 'euiCallOut--primary',
Expand All @@ -35,9 +32,7 @@ const sizeToClassNameMap: { [size in Size]: string } = {
m: '',
};

export const SIZES = Object.keys(sizeToClassNameMap);

export const EuiCallOut: FunctionComponent<Props> = ({
export const EuiCallOut: FunctionComponent<EuiCallOutProps> = ({
title,
color = 'primary',
size = 'm',
Expand Down
15 changes: 6 additions & 9 deletions src/components/facet/facet_group.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FunctionComponent, HTMLAttributes } from 'react';
import classNames from 'classnames';

import { CommonProps, keysOf } from '../common';
import { CommonProps } from '../common';
import { EuiFlexGroup } from '../flex';

type FacetGroupLayout = 'vertical' | 'horizontal';
Expand All @@ -11,15 +11,12 @@ const layoutToClassNameMap: { [layout in FacetGroupLayout]: string } = {
horizontal: 'euiFacetGroup--horizontal',
};

export const LAYOUTS = keysOf(layoutToClassNameMap);
export type EuiFacetGroupProps = CommonProps &
HTMLAttributes<HTMLDivElement> & {
layout?: FacetGroupLayout;
};

export interface EuiFacetGroupProps {
layout?: FacetGroupLayout;
}

type Props = CommonProps & HTMLAttributes<HTMLDivElement> & EuiFacetGroupProps;

export const EuiFacetGroup: FunctionComponent<Props> = ({
export const EuiFacetGroup: FunctionComponent<EuiFacetGroupProps> = ({
children,
className,
layout = 'vertical',
Expand Down
4 changes: 2 additions & 2 deletions src/components/key_pad_menu/key_pad_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import classNames from 'classnames';

import { CommonProps } from '../common';

type Props = CommonProps & HTMLAttributes<HTMLDivElement>;
export type EuiKeyPadMenuProps = CommonProps & HTMLAttributes<HTMLDivElement>;

export const EuiKeyPadMenu: FunctionComponent<Props> = ({
export const EuiKeyPadMenu: FunctionComponent<EuiKeyPadMenuProps> = ({
children,
className,
...rest
Expand Down
4 changes: 2 additions & 2 deletions src/components/key_pad_menu/key_pad_menu_item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ interface EuiKeyPadMenuItemCommonProps {
betaBadgeTooltipContent?: ReactNode;
}

type EuiKeyPadMenuItemProps = CommonProps &
export type EuiKeyPadMenuItemProps = CommonProps &
AnchorHTMLAttributes<HTMLAnchorElement> &
EuiKeyPadMenuItemCommonProps;

Expand Down Expand Up @@ -113,7 +113,7 @@ export const EuiKeyPadMenuItem: FunctionComponent<EuiKeyPadMenuItemProps> = ({
);
};

type EuiKeyPadMenuItemButtonProps = CommonProps &
export type EuiKeyPadMenuItemButtonProps = CommonProps &
ButtonHTMLAttributes<HTMLButtonElement> &
EuiKeyPadMenuItemCommonProps;

Expand Down

0 comments on commit 751ec9a

Please sign in to comment.