Skip to content

Commit

Permalink
fix: logo config when 1 doc type
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Oct 21, 2020
1 parent 2389f6a commit 011a917
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions ui/app/src/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,29 @@ export const Header: FC<HeaderProps> = ({ toolbar = {} }) => {
const LogoImage: FC<{ src: string }> = ({ src }) => (
<Image alt={siteDescription} variant="appheader.logo" src={src} />
);
const actions: ActionItems = [
{
node: logo ? (
typeof logo === 'string' ? (
<LogoLink>
<LogoImage src={logo} />
</LogoLink>
) : (
logo
)
) : logo === null ? (
let logoNode;
if (logo) {
logoNode =
typeof logo === 'string' ? (
<LogoLink>
<LogoImage src={logo} />
</LogoLink>
) : (
logo
);
} else {
logoNode =
logo === null ? (
'Home'
) : (
<LogoLink>
<LogoImage src={logoImg.default} />
</LogoLink>
),
);
}
const actions: ActionItems = [
{
node: logoNode,
href: homePath,
'aria-label': 'go to home page',
id: 'home',
Expand Down Expand Up @@ -98,11 +104,7 @@ export const Header: FC<HeaderProps> = ({ toolbar = {} }) => {
} else {
actions[0].node = (
<LogoLink>
{logo === null ? (
<Heading as="h2">{siteTitle}</Heading>
) : (
<LogoImage src={logoImg.default} />
)}
{logo === null ? <Heading as="h2">{siteTitle}</Heading> : logoNode}
</LogoLink>
);
}
Expand Down

0 comments on commit 011a917

Please sign in to comment.