Skip to content

Commit 0564827

Browse files
committed
Cleaned up more imports
1 parent c3fab10 commit 0564827

File tree

15 files changed

+19
-32
lines changed

15 files changed

+19
-32
lines changed

website/src/components/Home.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import React, {useCallback, useState} from 'react';
44
import {fetchShortestPaths} from '../api.ts';
55
import {WikipediaPage, WikipediaPageId} from '../types.ts';
66
import {getRandomPageTitle} from '../utils.js';
7-
import Logo from './common/Logo';
7+
import {Logo} from './common/Logo';
88
import {ErrorMessage} from './ErrorMessage.tsx';
99
import {InputFlexContainer, Modal, P} from './Home.styles.ts';
10-
import Loading from './Loading.tsx';
10+
import {Loading} from './Loading.tsx';
1111
import {NavLinks} from './NavLinks.tsx';
1212
import {PageInput} from './PageInput.tsx';
1313
import {Results} from './Results.tsx';

website/src/components/Loading.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const LoadingIndicator = styled.div`
9999
}
100100
`;
101101

102-
const Loading: React.FC = () => {
102+
export const Loading: React.FC = () => {
103103
const [currentFact, setCurrentFact] = useState(getRandomWikipediaFact());
104104

105105
useEffect(() => {
@@ -144,5 +144,3 @@ const Loading: React.FC = () => {
144144
</Wrapper>
145145
);
146146
};
147-
148-
export default Loading;

website/src/components/PageInput.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import styled from 'styled-components';
99
import {SDOW_USER_AGENT, WIKIPEDIA_API_URL} from '../resources/constants';
1010
import {WikipediaPage} from '../types';
1111
import {getRandomPageTitle} from '../utils';
12-
import PageInputSuggestion from './PageInputSuggestion';
12+
import {PageInputSuggestion} from './PageInputSuggestion';
1313

1414
type PageSuggestion = Required<Omit<WikipediaPage, 'url'>>;
1515

website/src/components/PageInputSuggestion.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import defaultPageThumbnail from '../images/defaultPageThumbnail.png';
44
import {Description, Image, InnerWrapper, Title, Wrapper} from './PageInputSuggestion.styles';
55

6-
const PageInputSuggestion = ({title, description, thumbnailUrl}) => {
6+
export const PageInputSuggestion = ({title, description, thumbnailUrl}) => {
77
const descriptionContent = description ? <Description>{description}</Description> : null;
88

99
return (
@@ -16,5 +16,3 @@ const PageInputSuggestion = ({title, description, thumbnailUrl}) => {
1616
</Wrapper>
1717
);
1818
};
19-
20-
export default PageInputSuggestion;

website/src/components/Results.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import styled from 'styled-components';
33

44
import {WikipediaPage, WikipediaPageId} from '../types';
55
import {getNumberWithCommas, getWikipediaPageUrl} from '../utils';
6-
import Button from './common/Button.tsx';
6+
import {Button} from './common/Button.tsx';
77
import {StyledTextLink} from './common/StyledTextLink.tsx';
8-
import ResultsGraph from './ResultsGraph.tsx';
8+
import {ResultsGraph} from './ResultsGraph.tsx';
99
import {ResultsList} from './ResultsList.tsx';
1010

1111
const ResultsMessage = styled.div`

website/src/components/ResultsGraph.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ import * as d3 from 'd3';
22
import debounce from 'lodash/debounce';
33
import map from 'lodash/map';
44
import range from 'lodash/range';
5-
import some from 'lodash/some';
65
import React, {useCallback, useEffect, useMemo, useRef} from 'react';
76
import styled from 'styled-components';
87

98
import {WikipediaPage, WikipediaPageId} from '../types';
109
import {getWikipediaPageUrl} from '../utils';
11-
import Button from './common/Button.tsx';
10+
import {Button} from './common/Button.tsx';
1211

1312
const DEFAULT_CHART_HEIGHT = 600;
1413

@@ -130,7 +129,7 @@ interface GraphLink {
130129
readonly target: number;
131130
}
132131

133-
const Graph: React.FC<{
132+
export const ResultsGraph: React.FC<{
134133
readonly paths: readonly WikipediaPageId[][];
135134
readonly pagesById: Record<WikipediaPageId, WikipediaPage>;
136135
}> = ({paths, pagesById}) => {
@@ -271,5 +270,3 @@ const Graph: React.FC<{
271270
</GraphWrapper>
272271
);
273272
};
274-
275-
export default Graph;

website/src/components/SearchButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import {useHistory, useLocation} from 'react-router-dom';
33
import styled from 'styled-components';
44

5-
import Button from './common/Button.tsx';
5+
import {Button} from './common/Button.tsx';
66

77
const SearchButtonWrapper = styled(Button)`
88
width: 240px;

website/src/components/blog/Blog/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import {Helmet} from 'react-helmet';
33

4-
import Logo from '../../common/Logo';
4+
import {Logo} from '../../common/Logo';
55
import {StyledTextLink} from '../../common/StyledTextLink.tsx';
66
import NewsletterSignupForm from '../NewsletterSignupForm';
77
import posts from '../posts/index.json';

website/src/components/blog/BlogPost/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import Loadable from 'react-loadable';
33
import {Redirect, useParams} from 'react-router-dom';
44

5-
import Logo from '../../common/Logo';
5+
import {Logo} from '../../common/Logo';
66

77
const AsyncSearchResultsAnalysisPost = Loadable({
88
loader: () => import('../posts/SearchResultsAnalysisPost'),

website/src/components/blog/NewsletterSignupForm/index.styles.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from 'styled-components';
22

3-
import Button from '../../common/Button.tsx';
3+
import {Button} from '../../common/Button.tsx';
44

55
export const Wrapper = styled.div`
66
display: flex;

website/src/components/blog/posts/SearchResultsAnalysisPost/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React from 'react';
22
import {Helmet} from 'react-helmet';
33

44
import {getNumberWithCommas} from '../../../../utils';
5-
import BarChart from '../../../charts/BarChart';
6-
import Table from '../../../charts/Table';
5+
import {BarChart} from '../../../charts/BarChart';
6+
import {Table} from '../../../charts/Table';
77
import {StyledTextLink} from '../../../common/StyledTextLink.tsx';
88
import {
99
Divider,

website/src/components/charts/BarChart/index.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {BarChartSvg, BarChartWrapper} from './index.styles';
66

77
const DEFAULT_CHART_HEIGHT = 300;
88

9-
class BarChart extends Component {
9+
export class BarChart extends Component {
1010
constructor() {
1111
super();
1212

@@ -126,5 +126,3 @@ class BarChart extends Component {
126126
);
127127
}
128128
}
129-
130-
export default BarChart;

website/src/components/charts/Table/index.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22

33
import {TableWrapper} from './index.styles';
44

5-
const Table = ({headers, rows}) => {
5+
export const Table = ({headers, rows}) => {
66
const headerRow = (
77
<tr key="table-header-row">
88
{headers.map((header, i) => {
@@ -38,5 +38,3 @@ const Table = ({headers, rows}) => {
3838
</TableWrapper>
3939
);
4040
};
41-
42-
export default Table;

website/src/components/common/Button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from 'styled-components';
22

3-
export default styled.button`
3+
export const Button = styled.button`
44
position: relative;
55
display: block;
66
color: ${({theme}) => theme.colors.creme};

website/src/components/common/Logo/index.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const LogoImg = styled.img`
2121
}
2222
`;
2323

24-
const Logo = () => (
24+
export const Logo = () => (
2525
<Link to="/">
2626
<LogoImg
2727
srcSet={`${logo} 462w, ${logo2x} 924w`}
@@ -31,5 +31,3 @@ const Logo = () => (
3131
/>
3232
</Link>
3333
);
34-
35-
export default Logo;

0 commit comments

Comments
 (0)