diff --git a/packages/my-joy-navigation/package.json b/packages/my-joy-navigation/package.json
index 651c8321..4f1724d0 100644
--- a/packages/my-joy-navigation/package.json
+++ b/packages/my-joy-navigation/package.json
@@ -1,6 +1,6 @@
{
"name": "my-joy-navigation",
- "version": "2.3.3",
+ "version": "2.4.0",
"private": true,
"license": "MPL-2.0",
"main": "lib/index.js",
diff --git a/packages/my-joy-navigation/src/header.js b/packages/my-joy-navigation/src/header.js
index b18db01c..db4b7e64 100644
--- a/packages/my-joy-navigation/src/header.js
+++ b/packages/my-joy-navigation/src/header.js
@@ -33,20 +33,19 @@ const GetHeader = gql`
}
`;
-// Needs to be revised
-// const GetAccount = gql`
-// {
-// datacenter {
-// name
-// }
-// account {
-// login
-// }
-// }
-// `;
+const GetAccount = gql`
+ {
+ datacenter {
+ name
+ }
+ account {
+ login
+ }
+ }
+`;
const Navigation = ({
- login,
+ account = {},
datacenter = true,
toggleSectionOpen,
isOpen,
@@ -86,17 +85,18 @@ const Navigation = ({
) : null}
{datacenter ? : null}
-
-
- Account:
-
- Raul Millais
-
-
-
-
-
- )
+ {account.login ? (
+
+
+ Account:
+
+ {`${account.login}`}
+
+
+
+
+
+ ) : null}
{keys(Overlays).map(panelName =>
React.createElement(Overlays[panelName], {
@@ -107,23 +107,23 @@ const Navigation = ({
);
export default compose(
- // graphql(GetAccount, {
- // options: () => ({
- // ssr: false
- // }),
- // props: ({ data }) => {
- // const {
- // account = {},
- // datacenter = {},
- // loading = false,
- // error = null
- // } = data;
- // const { login } = account;
- // const { name } = datacenter;
+ graphql(GetAccount, {
+ options: () => ({
+ ssr: false
+ }),
+ props: ({ data }) => {
+ const {
+ account = {},
+ datacenter = {},
+ loading = false,
+ error = null
+ } = data;
- // return { login, datacenter: name, loading, error };
- // }
- // }),
+ const { name } = datacenter;
+
+ return { account, datacenter: name, loading, error };
+ }
+ }),
graphql(GetHeader, {
options: () => ({
ssr: false