Skip to content

Commit

Permalink
refactor(headerbar instance infos): adjust styles according to sugges…
Browse files Browse the repository at this point in the history
…tions in PR
  • Loading branch information
Mohammer5 committed Oct 7, 2021
1 parent 020309f commit cc614c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
23 changes: 17 additions & 6 deletions components/header-bar/src/profile-menu/instance-and-app-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const InstanceInfo = ({ instanceData }) => {
const { version, revision } = instanceData

return (
<div className="instance-info">
<>
<span className="version">
{`${i18n.t('DHIS2 version')} ${version}`}
</span>
Expand All @@ -25,7 +25,7 @@ const InstanceInfo = ({ instanceData }) => {
white-space: nowrap;
}
`}</style>
</div>
</>
)
}

Expand All @@ -41,6 +41,7 @@ const menuItemWithBorderTopStyles = resolve`
border-top: 1px solid ${colors.grey400};
color: ${colors.grey700};
font-size: 14px;
line-height: 17px;
}
`

Expand All @@ -66,15 +67,25 @@ export const InstanceAndAppInfo = ({ appName, appVersion }) => {
// other instance info when an error occurs
return (
<MenuItemWithBorderTop>
{loading && <div>{i18n.t('Loading instance information..')}</div>}
<div className="instance-infos">
{loading && <div>{i18n.t('Checking DHIS2 version...')}</div>}

{!loading && !error && (
<InstanceInfo instanceData={data.systemInfo} />
)}
{error && <div>{i18n.t('There was a problem getting DHIS2 version.')}</div>}

{!loading && !error && (
<InstanceInfo instanceData={data.systemInfo} />
)}
</div>

{appName && appVersion && (
<div className="app-info">{`${appName}, ${appVersion}`}</div>
)}

<style jsx>{`
.instance-infos {
margin-bottom: 6px;
}
`}</style>
</MenuItemWithBorderTop>
)
}
Expand Down
2 changes: 1 addition & 1 deletion components/header-bar/src/profile-menu/profile-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const ProfileMenu = ({
position: absolute;
top: 34px;
right: -6px;
width: 310px;
width: 320px;
border-top: 4px solid transparent;
}
`}</style>
Expand Down

0 comments on commit cc614c3

Please sign in to comment.