-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #322 from labzero/jeffrey/footer
More TypeScript conversion
- Loading branch information
Showing
12 changed files
with
94 additions
and
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { connect } from "react-redux"; | ||
import Flash from "./Flash"; | ||
import FlashComponent from "./Flash"; | ||
import { expireFlash } from "../../actions/flash"; | ||
import { Dispatch } from "../../interfaces"; | ||
import { Dispatch, Flash } from "../../interfaces"; | ||
|
||
const mapDispatchToProps = (dispatch: Dispatch, ownProps: { id: string }) => ({ | ||
const mapDispatchToProps = (dispatch: Dispatch, ownProps: Flash) => ({ | ||
expireFlash: () => { | ||
dispatch(expireFlash(ownProps.id)); | ||
}, | ||
}); | ||
|
||
export default connect(null, mapDispatchToProps)(Flash); | ||
export default connect(null, mapDispatchToProps)(FlashComponent); |
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
3 changes: 2 additions & 1 deletion
3
src/components/Footer/FooterContainer.js → src/components/Footer/FooterContainer.ts
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
41 changes: 23 additions & 18 deletions
41
...ents/GoogleInfoWindow/GoogleInfoWindow.js → ...nts/GoogleInfoWindow/GoogleInfoWindow.tsx
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
23 changes: 0 additions & 23 deletions
23
src/components/GoogleInfoWindow/GoogleInfoWindowContainer.js
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
src/components/GoogleInfoWindow/GoogleInfoWindowContainer.ts
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,28 @@ | ||
import { connect } from "react-redux"; | ||
import { addRestaurant } from "../../actions/restaurants"; | ||
import { Dispatch } from "../../interfaces"; | ||
import GoogleInfoWindow from "./GoogleInfoWindow"; | ||
|
||
const mapDispatchToProps = ( | ||
dispatch: Dispatch, | ||
ownProps: { placeId: string } | ||
) => ({ | ||
addRestaurant: (result: google.maps.places.PlaceResult) => { | ||
// eslint-disable-next-line camelcase | ||
const { name, formatted_address } = result; | ||
const location = result.geometry?.location; | ||
|
||
return dispatch( | ||
addRestaurant( | ||
name || "", | ||
ownProps.placeId, | ||
// eslint-disable-next-line camelcase | ||
formatted_address || "", | ||
location?.lat() || 0, | ||
location?.lng() || 0 | ||
) | ||
); | ||
}, | ||
}); | ||
|
||
export default connect(null, mapDispatchToProps)(GoogleInfoWindow); |
2 changes: 1 addition & 1 deletion
2
...sLoaderContext/GoogleMapsLoaderContext.js → ...sLoaderContext/GoogleMapsLoaderContext.ts
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { createContext } from "react"; | ||
|
||
const GoogleMapsLoaderContext = createContext(); | ||
const GoogleMapsLoaderContext = createContext({}); | ||
|
||
export default GoogleMapsLoaderContext; |
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
3 changes: 2 additions & 1 deletion
3
src/components/Header/HeaderContainer.js → src/components/Header/HeaderContainer.ts
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
3 changes: 2 additions & 1 deletion
3
...nents/HeaderLogin/HeaderLoginContainer.js → ...nents/HeaderLogin/HeaderLoginContainer.ts
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { connect } from "react-redux"; | ||
import { State } from "../../interfaces"; | ||
import HeaderLogin from "./HeaderLogin"; | ||
|
||
const mapStateToProps = (state) => ({ user: state.user }); | ||
const mapStateToProps = (state: State) => ({ user: state.user }); | ||
|
||
export default connect(mapStateToProps)(HeaderLogin); |