mirror of
https://github.com/pheralb/svgl.git
synced 2024-12-04 21:32:37 +08:00
Merge pull request #424 from ridemountainpig/fix-wordmark
⚙️ Fix wordmark SVG error
This commit is contained in:
commit
302dfd62ca
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
// Props:
|
// Props:
|
||||||
export let svgInfo: iSVG;
|
export let svgInfo: iSVG;
|
||||||
|
export let searchTerm: string;
|
||||||
|
|
||||||
let isInFigma = false;
|
let isInFigma = false;
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
@ -37,6 +38,11 @@
|
|||||||
|
|
||||||
// Wordmark SVG:
|
// Wordmark SVG:
|
||||||
let wordmarkSvg = false;
|
let wordmarkSvg = false;
|
||||||
|
$: {
|
||||||
|
if (searchTerm) {
|
||||||
|
wordmarkSvg = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const insertSVG = async (url?: string) => {
|
const insertSVG = async (url?: string) => {
|
||||||
const content = (await getSvgContent(url)) as 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"
|
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 -->
|
<!-- Image -->
|
||||||
{#if wordmarkSvg == true}
|
{#if wordmarkSvg == true && svgInfo.wordmark !== undefined}
|
||||||
<img
|
<img
|
||||||
class={cn('hidden dark:block', globalImageStyles)}
|
class={cn('hidden dark:block', globalImageStyles)}
|
||||||
src={typeof svgInfo.wordmark !== 'string'
|
src={typeof svgInfo.wordmark !== 'string'
|
||||||
@ -175,7 +181,7 @@
|
|||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if wordmarkSvg}
|
{#if wordmarkSvg && svgInfo.wordmark !== undefined}
|
||||||
<CopySvg {iconSize} {iconStroke} {svgInfo} isInFigma={false} isWordmarkSvg={true} />
|
<CopySvg {iconSize} {iconStroke} {svgInfo} isInFigma={false} isWordmarkSvg={true} />
|
||||||
{:else}
|
{:else}
|
||||||
<CopySvg {iconSize} {iconStroke} {svgInfo} isInFigma={false} isWordmarkSvg={false} />
|
<CopySvg {iconSize} {iconStroke} {svgInfo} isInFigma={false} isWordmarkSvg={false} />
|
||||||
|
@ -134,7 +134,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<Grid>
|
<Grid>
|
||||||
{#each filteredSvgs.slice(0, showAll ? undefined : 30) as svg}
|
{#each filteredSvgs.slice(0, showAll ? undefined : 30) as svg}
|
||||||
<SvgCard svgInfo={svg} />
|
<SvgCard svgInfo={svg} searchTerm={searchTerm} />
|
||||||
{/each}
|
{/each}
|
||||||
</Grid>
|
</Grid>
|
||||||
{#if filteredSvgs.length > 30 && !showAll}
|
{#if filteredSvgs.length > 30 && !showAll}
|
||||||
|
Loading…
Reference in New Issue
Block a user