-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The client fetches account info from the server, and uses this to control the presentation of elements that require auth.
- Loading branch information
Showing
8 changed files
with
68 additions
and
35 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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import * as React from 'react'; | ||
|
||
// Guard the wrapped component behind a loading message, until the required | ||
// server data has been loaded. Currently this is the set of labels. #175, #179 | ||
// and #217 will probably also check whether user auth data has been loaded. | ||
// server data has been loaded. Currently this is the account info and the | ||
// labels. | ||
export const withAccountInfo = WrappedComponent => props => | ||
(props.account ? <WrappedComponent {...props} /> : <h1>Loading…</h1>); | ||
|
||
// Guard the wrapped component behind a loading message, until the required | ||
// server data has been loaded. Currently this is the labels. | ||
const withServerData = WrappedComponent => props => | ||
(props.labels && props.labels.labelList ? <WrappedComponent {...props} /> : <h1>Loading</h1>); | ||
(props.labels && props.labels.labelList ? <WrappedComponent {...props} /> : <h1>Loading…</h1>); | ||
|
||
export default withServerData; |
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