-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert remaining identifier javascript code to typescript
Add types for relevant annotations with packages.
- Loading branch information
Showing
54 changed files
with
1,308 additions
and
1,219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
|
||
import { BrowserRouter } from 'react-router-dom'; | ||
|
||
import { createStyles, WithStyles, withStyles } from '@material-ui/core/styles'; | ||
|
||
import Routes from './Routes'; | ||
import { RootState } from './store'; | ||
import { ObjectType } from './types'; | ||
|
||
const styles = () => createStyles({ | ||
root: { | ||
position: 'relative', | ||
display: 'flex', | ||
flex: 1 | ||
} | ||
}); | ||
|
||
export interface MainProps extends WithStyles<typeof styles> { | ||
hello: ObjectType; | ||
pathPrefix: string; | ||
updateAvailable: boolean; | ||
} | ||
|
||
|
||
const Main: React.FC<MainProps> = ({ classes, hello, pathPrefix }) => { | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<BrowserRouter basename={pathPrefix}> | ||
<Routes hello={hello} /> | ||
</BrowserRouter> | ||
</div> | ||
); | ||
} | ||
|
||
const mapStateToProps = (state: RootState) => { | ||
const { hello, updateAvailable, pathPrefix } = state.common; | ||
|
||
return { | ||
hello: hello as ObjectType, | ||
updateAvailable, | ||
pathPrefix | ||
}; | ||
}; | ||
|
||
export default connect(mapStateToProps)(withStyles(styles)(Main)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.