⚙️ Fixed download svg when `wordmark & route` are strings

This commit is contained in:
pheralb 2024-01-27 00:09:37 +00:00
parent b2caf5c371
commit 804a060e58

View File

@ -84,7 +84,7 @@
};
</script>
{#if typeof svgInfo.route === 'string'}
{#if typeof svgInfo.route === 'string' && svgInfo.wordmark === undefined}
<button
title="Download Light & Dark variants"
class={mainDownloadStyles}
@ -114,6 +114,28 @@
'md:space-y-0 md:flex-row md:space-x-2 md:items-center md:justify-center'
)}
>
{#if typeof svgInfo.route === 'string'}
<div class={cardDownloadStyles}>
<img
src={isDarkTheme() ? svgInfo.route : svgInfo.route}
alt={svgInfo.title}
class="h-8 my-4"
/>
<button
title="Download logo"
class={buttonStyles}
on:click={() => {
if (typeof svgInfo.route === 'string') {
downloadSvg(svgInfo.route);
return;
}
}}
>
<DownloadIcon class="mr-2" size={iconSize} />
<p>Icon logo</p>
</button>
</div>
{:else}
<div class={cardDownloadStyles}>
<img
src={isDarkTheme() ? svgInfo.route.dark : svgInfo.route.light}
@ -164,6 +186,7 @@
Only dark variant
</button>
</div>
{/if}
{#if typeof svgInfo.wordmark === 'string' && svgInfo.wordmark !== undefined}
<div class={cardDownloadStyles}>