This repository was archived by the owner on Sep 6, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +9
-20
lines changed Expand file tree Collapse file tree 5 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,10 @@ import * as React from 'react';
33import Ul from './Ul' ;
44import Wrapper from './Wrapper' ;
55import { Repo } from '../../containers/RepoListItem/types' ;
6- import { UserData } from '../../containers/App/types' ;
76
87interface Props {
98 component : React . ComponentType < any > ;
10- items ?: UserData [ 'repos' ] ;
9+ items ?: Repo [ ] ;
1110}
1211
1312function List ( props : Props ) {
@@ -31,5 +30,4 @@ function List(props: Props) {
3130 ) ;
3231}
3332
34- const items : UserData [ 'repos' ] = [ ] ;
3533export default List ;
Original file line number Diff line number Diff line change @@ -6,13 +6,9 @@ import LoadingIndicator from 'components/LoadingIndicator';
66import RepoListItem from 'containers/RepoListItem' ;
77import { ContainerState , UserData } from '../../containers/App/types' ;
88
9- interface Props {
10- loading ?: ContainerState [ 'loading' ] ;
11- error ?: ContainerState [ 'error' ] ;
12- repos ?: UserData [ 'repos' ] ;
13- }
9+ export type ReposListProps = Pick < ContainerState , 'loading' | 'error' > & Pick < UserData , 'repos' > ;
1410
15- function ReposList ( { loading, error, repos } : Props ) {
11+ function ReposList ( { loading, error, repos } : ReposListProps ) {
1612 if ( loading ) {
1713 return < List component = { LoadingIndicator } /> ;
1814 }
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ describe('<ReposList />', () => {
5555 // tslint:disable-next-line: jsx-wrap-multiline
5656 < Provider store = { store } >
5757 < IntlProvider locale = "en" >
58- < ReposList repos = { repos } error = { false } />
58+ < ReposList repos = { repos } error = { false } loading = { false } />
5959 </ IntlProvider >
6060 </ Provider > ,
6161 ) ;
Original file line number Diff line number Diff line change 11import { ActionType } from 'typesafe-actions' ;
22import * as actions from './actions' ;
3- import { ApplicationRootState } from 'types' ;
43import { Repo } from '../RepoListItem/types' ;
4+ import { ApplicationRootState } from '../../types' ;
55
66/* --- STATE --- */
77
@@ -13,7 +13,7 @@ interface AppState {
1313}
1414
1515interface UserData {
16- readonly repos ?: Repo [ ] ; // too many fields. Won't declare them all
16+ readonly repos ?: Repo [ ] ;
1717}
1818
1919
Original file line number Diff line number Diff line change 44 * This is the first thing users see of our App, at the '/' route
55 */
66
7- import React , { useEffect , memo } from 'react' ;
7+ import React , { useEffect } from 'react' ;
88import { Helmet } from 'react-helmet' ;
99import { FormattedMessage } from 'react-intl' ;
10- import { connect , useSelector , useDispatch } from 'react-redux' ;
11- import { compose , Dispatch } from 'redux' ;
10+ import { useDispatch , useSelector } from 'react-redux' ;
1211import { createStructuredSelector } from 'reselect' ;
1312
1413import { useInjectReducer } from 'utils/injectReducer' ;
1514import { useInjectSaga } from 'utils/injectSaga' ;
16- import {
17- makeSelectRepos ,
18- makeSelectLoading ,
19- makeSelectError ,
20- } from 'containers/App/selectors' ;
15+ import { makeSelectError , makeSelectLoading , makeSelectRepos } from 'containers/App/selectors' ;
2116import H2 from 'components/H2' ;
2217import ReposList from 'components/ReposList' ;
2318import AtPrefix from './AtPrefix' ;
You can’t perform that action at this time.
0 commit comments