diff --git a/src/HeaderBar/LogoImage.js b/src/HeaderBar/LogoImage.js
index 4566200..a31f4dd 100644
--- a/src/HeaderBar/LogoImage.js
+++ b/src/HeaderBar/LogoImage.js
@@ -5,11 +5,17 @@ import css from 'styled-jsx/css'
import { useDataQuery } from '@dhis2/app-runtime'
import { LogoIconWhite } from '@dhis2/ui-core'
-const defaultLogo = css.resolve`
+const logoStyles = css.resolve`
svg {
height: 25px;
width: 27px;
}
+
+ img {
+ max-height: 100%;
+ min-height: auto;
+ width: auto;
+ }
`
const query = {
@@ -18,20 +24,35 @@ const query = {
},
}
+const pathExists = data =>
+ data &&
+ data.customLogo &&
+ data.customLogo.images &&
+ data.customLogo.images.png
+
export const LogoImage = () => {
const { loading, error, data } = useDataQuery(query)
if (loading) return null
+ let Logo
+ if (!error && pathExists(data)) {
+ Logo = (
+
+ )
+ } else {
+ Logo =