Skip to content

Commit

Permalink
update naming
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Aug 4, 2020
1 parent e4d4d00 commit 75a8246
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { letBrowserHandleEvent } from '../react_router_helpers';
import { letBrowserHandleEvent } from '../index';

describe('letBrowserHandleEvent', () => {
const event = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import React from 'react';
import { shallow, mount } from 'enzyme';
import { EuiLink, EuiButton } from '@elastic/eui';

import '../../../lib/__mocks__/react_router_history.mock';
import '../../../../lib/__mocks__/react_router_history.mock';

import { ReactRouterEuiLink, ReactRouterEuiButton } from './eui_link';
import { mockHistory } from '../../../lib/__mocks__';
import { ReactRouterEuiLink, ReactRouterEuiButton } from '../link_for_eui';
import { mockHistory } from '../../../../lib/__mocks__';

describe('EUI & React Router Component Helpers', () => {
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
*/

export { letBrowserHandleEvent } from './link_events';
export { ReactRouterEuiLink as EuiLink } from './eui_link';
export { ReactRouterEuiButton as EuiButton } from './eui_link';
export { ReactRouterEuiLink as EuiLink } from './link_for_eui';
export { ReactRouterEuiButton as EuiButton } from './link_for_eui';
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface IEuiReactRouterProps {
to: string;
}

export const EuiReactRouterHelper: React.FC<IEuiReactRouterProps> = ({ to, children }) => {
export const ReactRouterHelperForEUi: React.FC<IEuiReactRouterProps> = ({ to, children }) => {
const history = useHistory();

const onClick = (event: React.MouseEvent) => {
Expand All @@ -53,22 +53,22 @@ type TEuiReactRouterButtonProps = EuiButtonProps & IEuiReactRouterProps;
type TEuiReactRouterButtonEmptyProps = EuiButtonEmptyProps & IEuiReactRouterProps;

export const ReactRouterEuiLink: React.FC<TEuiReactRouterLinkProps> = ({ to, ...rest }) => (
<EuiReactRouterHelper to={to}>
<ReactRouterHelperForEUi to={to}>
<EuiLink {...rest} />
</EuiReactRouterHelper>
</ReactRouterHelperForEUi>
);

export const ReactRouterEuiButton: React.FC<TEuiReactRouterButtonProps> = ({ to, ...rest }) => (
<EuiReactRouterHelper to={to}>
<ReactRouterHelperForEUi to={to}>
<EuiButton {...rest} />
</EuiReactRouterHelper>
</ReactRouterHelperForEUi>
);

export const ReactRouterEuiButtonEmpty: React.FC<TEuiReactRouterButtonEmptyProps> = ({
to,
...rest
}) => (
<EuiReactRouterHelper to={to}>
<ReactRouterHelperForEUi to={to}>
<EuiButtonEmpty {...rest} />
</EuiReactRouterHelper>
</ReactRouterHelperForEUi>
);

0 comments on commit 75a8246

Please sign in to comment.