diff --git a/src/components/headerLogoLink.svelte b/src/components/headerLogoLink.svelte index d00eebc..030fefd 100644 --- a/src/components/headerLogoLink.svelte +++ b/src/components/headerLogoLink.svelte @@ -2,13 +2,12 @@ import { toast } from 'svelte-sonner'; import * as ContextMenu from '@/ui/context-menu'; - import { CopyIcon } from 'lucide-svelte'; + import { ArrowUpRightIcon, CopyIcon, StarsIcon } from 'lucide-svelte'; import Logo from './icons/logo.svelte'; - import ReactIcon from './icons/reactIcon.svelte'; import { clipboard } from '@/utils/clipboard'; import { getSvgContent } from '@/utils/getSvgContent'; - import { getReactComponentCode } from '@/utils/getReactComponentCode'; + import GithubIcon from './icons/githubIcon.svelte'; const logoUrl = '/library/svgl.svg'; @@ -20,31 +19,8 @@ }); }; - let isLoading = false; - - const convertSvgReactComponent = async (tsx: boolean) => { - isLoading = true; - - const title = 'svgl'; - const content = await getSvgContent(logoUrl); - const dataComponent = { code: content, typescript: tsx, name: title }; - const { data, error } = await getReactComponentCode(dataComponent); - - if (error || !data) { - toast.error('Failed to fetch React component', { - description: `${error ?? ''}`, - duration: 5000 - }); - return; - } - - await clipboard(data); - - toast.success(`Copied as React ${tsx ? 'TSX' : 'JSX'} component`, { - description: `Svgl - Library` - }); - - isLoading = false; + const openUrl = (url: string) => { + window.open(url, '_blank'); }; @@ -53,23 +29,23 @@
- - +
copyToClipboard()}> - + Copy as SVG - convertSvgReactComponent(false)}> - - Copy as React JSX Component + openUrl('https://github.com/pheralb/svgl')}> + + Repository + - convertSvgReactComponent(true)}> - - Copy as React TSX Component + + + v4.5