Skip to content

Commit bc82be5

Browse files
committed
RouterTab: update to named export
1 parent b1788d5 commit bc82be5

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

client/common/RouterTab.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from 'react';
22
import { render, screen, fireEvent, waitFor, history } from '../test-utils';
3-
import Tab from './RouterTab';
3+
import { RouterTab } from './RouterTab';
44

55
const mockPath = '/projects';
66
const mockLinkText = 'Projects';
77

8-
describe('Tab', () => {
8+
describe('RouterTab', () => {
99
function mountComponent() {
10-
return render(<Tab to={mockPath}>{mockLinkText}</Tab>);
10+
return render(<RouterTab to={mockPath}>{mockLinkText}</RouterTab>);
1111
}
1212

1313
it('renders a react-router NavLink with correct text and path', async () => {

client/common/RouterTab.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import React, { ReactNode } from 'react';
22
import { NavLink } from 'react-router-dom';
33

4-
export interface TabProps {
4+
export interface RouterTabProps {
55
children: ReactNode;
66
to: string;
77
}
88

99
/**
1010
* Wraps the react-router `NavLink` with dashboard-header__tab styling.
1111
*/
12-
const Tab = ({ children, to }: TabProps) => (
12+
export const RouterTab = ({ children, to }: RouterTabProps) => (
1313
<li className="dashboard-header__tab">
1414
<NavLink
1515
className="dashboard-header__tab__title"
@@ -20,5 +20,3 @@ const Tab = ({ children, to }: TabProps) => (
2020
</NavLink>
2121
</li>
2222
);
23-
24-
export default Tab;

client/modules/Legal/pages/Legal.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import React, { useEffect, useState } from 'react';
44
import Helmet from 'react-helmet';
55
import { useTranslation } from 'react-i18next';
66
import styled from 'styled-components';
7-
import RouterTab from '../../../common/RouterTab';
7+
import { RouterTab } from '../../../common/RouterTab';
88
import RootPage from '../../../components/RootPage';
99
import { remSize } from '../../../theme';
1010
import Loader from '../../App/components/loader';

client/modules/User/components/DashboardTabSwitcher.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useDispatch } from 'react-redux';
55
import styled from 'styled-components';
66
import { FilterIcon } from '../../../common/icons';
77
import IconButton from '../../../common/IconButton';
8-
import RouterTab from '../../../common/RouterTab';
8+
import { RouterTab } from '../../../common/RouterTab';
99
import { Options } from '../../IDE/components/Header/MobileNav';
1010
import { toggleDirectionForField } from '../../IDE/actions/sorting';
1111
import useIsMobile from '../../IDE/hooks/useIsMobile';

0 commit comments

Comments
 (0)