Skip to content

Commit

Permalink
converts NavDrawer, NavDrawerGroup, and NavDrawerFlyout to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitropoulos committed Apr 7, 2020
1 parent 41c88fb commit 7883db6
Show file tree
Hide file tree
Showing 9 changed files with 321 additions and 260 deletions.
2 changes: 1 addition & 1 deletion src/components/list_group/list_group_item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export type EuiListGroupItemProps = CommonProps &
* Pass-through ref reference specifically for targeting
* instances where the item content is rendered as a `button`
*/
buttonRef?: React.RefObject<HTMLButtonElement>;
buttonRef?: React.Ref<HTMLButtonElement>;
};

export const EuiListGroupItem: FunctionComponent<EuiListGroupItemProps> = ({
Expand Down
5 changes: 0 additions & 5 deletions src/components/nav_drawer/index.js

This file was deleted.

6 changes: 6 additions & 0 deletions src/components/nav_drawer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export { EuiNavDrawer, EuiNavDrawerProps } from './nav_drawer';
export { EuiNavDrawerGroup, EuiNavDrawerGroupProps } from './nav_drawer_group';
export {
EuiNavDrawerFlyout,
EuiNavDrawerFlyoutProps,
} from './nav_drawer_flyout';
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ import React from 'react';
import { render } from 'enzyme';

import { EuiNavDrawer } from './nav_drawer';
import { EuiNavDrawerGroup } from './nav_drawer_group';
import { EuiNavDrawerGroup, FlyoutMenuItem } from './nav_drawer_group';
import { EuiListGroupItemProps } from '../list_group';

const extraAction = {
const extraAction: EuiListGroupItemProps['extraAction'] = {
color: 'subdued',
iconType: 'pin',
iconSize: 's',
};

const topLinks = [
const topLinks: FlyoutMenuItem[] = [
{
label: 'Recently viewed',
iconType: 'clock',
Expand Down Expand Up @@ -74,7 +75,7 @@ const topLinks = [
},
];

const exploreLinks = [
const exploreLinks: FlyoutMenuItem[] = [
{
label: 'Canvas',
href: '#',
Expand Down
Loading

0 comments on commit 7883db6

Please sign in to comment.