mirror of
https://github.com/pheralb/svgl.git
synced 2024-12-04 21:32:37 +08:00
fix: wordmark SVG error
This commit is contained in:
parent
61f31b09e9
commit
1108b024a1
@ -28,6 +28,7 @@
|
||||
|
||||
// Props:
|
||||
export let svgInfo: iSVG;
|
||||
export let searchTerm: string;
|
||||
|
||||
let isInFigma = false;
|
||||
onMount(() => {
|
||||
@ -37,6 +38,11 @@
|
||||
|
||||
// Wordmark SVG:
|
||||
let wordmarkSvg = false;
|
||||
$: {
|
||||
if (searchTerm) {
|
||||
wordmarkSvg = false;
|
||||
}
|
||||
}
|
||||
|
||||
const insertSVG = async (url?: string) => {
|
||||
const content = (await getSvgContent(url)) as string;
|
||||
@ -59,7 +65,7 @@
|
||||
class="group flex flex-col items-center justify-center rounded-md border border-neutral-200 p-4 transition-colors duration-100 hover:bg-neutral-100/80 dark:border-neutral-800 dark:hover:bg-neutral-800/20"
|
||||
>
|
||||
<!-- Image -->
|
||||
{#if wordmarkSvg == true}
|
||||
{#if wordmarkSvg == true && svgInfo.wordmark !== undefined}
|
||||
<img
|
||||
class={cn('hidden dark:block', globalImageStyles)}
|
||||
src={typeof svgInfo.wordmark !== 'string'
|
||||
@ -175,7 +181,7 @@
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
{#if wordmarkSvg}
|
||||
{#if wordmarkSvg && svgInfo.wordmark !== undefined}
|
||||
<CopySvg {iconSize} {iconStroke} {svgInfo} isInFigma={false} isWordmarkSvg={true} />
|
||||
{:else}
|
||||
<CopySvg {iconSize} {iconStroke} {svgInfo} isInFigma={false} isWordmarkSvg={false} />
|
||||
|
@ -134,7 +134,7 @@
|
||||
</div>
|
||||
<Grid>
|
||||
{#each filteredSvgs.slice(0, showAll ? undefined : 30) as svg}
|
||||
<SvgCard svgInfo={svg} />
|
||||
<SvgCard svgInfo={svg} searchTerm={searchTerm} />
|
||||
{/each}
|
||||
</Grid>
|
||||
{#if filteredSvgs.length > 30 && !showAll}
|
||||
|
Loading…
Reference in New Issue
Block a user