-
Notifications
You must be signed in to change notification settings - Fork 53
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 #183 from opentripplanner/form-fixes
Add SettingsPreview and TripDetails messages
- Loading branch information
Showing
4 changed files
with
74 additions
and
10 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 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Takes component's default props and its instance props and returns the | ||
* merged messages props. The returned object will ensure that the default | ||
* messages are substituted for any translation strings that were missing in the | ||
* props. Note: this does not account for messages in nested objects (e.g., | ||
* messages.header.description). | ||
*/ | ||
export function mergeMessages (defaultProps, props) { | ||
const defaultMessages = defaultProps.messages || {} | ||
const propsMessages = props.messages || {} | ||
return { | ||
...defaultMessages, | ||
...propsMessages | ||
} | ||
} |