This commit is contained in:
toshi1127 2019-03-15 19:24:12 +09:00
parent d43649e92b
commit d7af6f9f84
2 changed files with 8 additions and 7 deletions

View File

@ -8388,7 +8388,7 @@ exports[`Storyshots UI|Sidebar/Sidebar loading 1`] = `
<a
class="emotion-1"
href="./"
target="_blank"
target=""
>
<svg
class="emotion-0"
@ -9814,7 +9814,7 @@ exports[`Storyshots UI|Sidebar/Sidebar simple 1`] = `
<a
class="emotion-1"
href="./"
target="_blank"
target=""
>
<svg
class="emotion-0"
@ -11304,7 +11304,7 @@ exports[`Storyshots UI|Sidebar/SidebarHeading menuHighlighted 1`] = `
<a
class="emotion-1"
href="./"
target="_blank"
target=""
>
<svg
class="emotion-0"
@ -11935,7 +11935,7 @@ exports[`Storyshots UI|Sidebar/SidebarHeading standard 1`] = `
<a
class="emotion-1"
href="./"
target="_blank"
target=""
>
<svg
class="emotion-0"

View File

@ -65,12 +65,13 @@ const Head = styled.div({
});
const Brand = withTheme(({ theme: { brand: { title = 'Storybook', url = './', image } } }) => {
const targetValue = url === './' ? '' : '_blank';
if (image === undefined && url === null) {
return <Logo alt={title} />;
}
if (image === undefined && url) {
return (
<LogoLink href={url} target="_blank">
<LogoLink href={url} target={targetValue}>
<Logo alt={title} />
</LogoLink>
);
@ -80,7 +81,7 @@ const Brand = withTheme(({ theme: { brand: { title = 'Storybook', url = './', im
}
if (image === null && url) {
return (
<LogoLink href={url} target="_blank">
<LogoLink href={url} target={targetValue}>
{title}
</LogoLink>
);
@ -90,7 +91,7 @@ const Brand = withTheme(({ theme: { brand: { title = 'Storybook', url = './', im
}
if (image && url) {
return (
<LogoLink href={url} target="_blank">
<LogoLink href={url} target={targetValue}>
<Img src={image} alt={title} />
</LogoLink>
);