This repository has been archived by the owner on Dec 2, 2019. It is now read-only.
-
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.
feat(cp-frontend): Move portal query to header, display result, retur…
…n user from mock server
- Loading branch information
1 parent
d2ac10a
commit 5ffa07a
Showing
10 changed files
with
292 additions
and
213 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
import { graphql } from 'react-apollo'; | ||
import PortalQuery from '@graphql/Portal.gql'; | ||
import { Header as HeaderComponent } from '@components/navigation'; | ||
|
||
const Header = ({ | ||
portal = { | ||
datacenter: { | ||
region: '' | ||
}, | ||
user: { | ||
firstName: '' | ||
} | ||
}, | ||
loading, | ||
error | ||
}) => ( | ||
<HeaderComponent | ||
datacenter={portal.datacenter.region} | ||
username={portal.user.firstName} | ||
/> | ||
); | ||
|
||
const HeaderWithData = graphql(PortalQuery, { | ||
props: ({ data: { portal, loading, error } }) => ({ | ||
portal, | ||
loading, | ||
error | ||
}) | ||
})(Header); | ||
|
||
export default HeaderWithData; |
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,2 +1,3 @@ | ||
export { default as Header } from './header'; | ||
export { default as Breadcrumb } from './breadcrumb'; | ||
export { default as Menu } from './menu'; |
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,6 +1,8 @@ | ||
query Portal { | ||
portal { | ||
username | ||
user { | ||
firstName | ||
} | ||
datacenter { | ||
uuid | ||
region | ||
|
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.