Skip to content

Commit

Permalink
feat: better share button
Browse files Browse the repository at this point in the history
  • Loading branch information
kurozenzen committed Feb 18, 2024
1 parent f59ac4a commit db0be5e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sort from '$lib/store/sort-store';
import filter from '$lib/store/filter-store';
import TagButton from '../button-tag/TagButton.svelte';
import { base } from '$app/paths';
const share = async () => {
const shareData = {
Expand All @@ -20,4 +21,6 @@
};
</script>

<TagButton title="Share current search." icon="codicon codicon-copy" on:click={share} />
<TagButton title="Share current search." on:click={share}>
<img src="{base}/assets/share.svg" alt="No more results to load" width="16" height="16" />
</TagButton>
12 changes: 2 additions & 10 deletions src/lib/components/kurosearch/button-tag/TagButton.svelte
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<script lang="ts">
export let title: string;
export let icon: string;
</script>

<button type="button" {title} on:click>
<i class={icon} />
<slot />
</button>

<style>
button {
width: var(--line-height-small);
height: var(--line-height-small);
border-radius: var(--line-height-small);
border-radius: var(--border-radius);
padding: var(--tiny-gap);
background-color: var(--accent);
color: var(--text-accent);
Expand All @@ -26,11 +25,4 @@
background-color: var(--accent-light);
}
}
i {
font-size: var(--text-size-large);
width: var(--text-size-large);
height: var(--text-size-large);
text-align: center;
}
</style>
5 changes: 3 additions & 2 deletions src/lib/components/kurosearch/tag-list/ActiveTagList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
{/each}
{#if tags.length > 1}
<TagButton
icon="codicon codicon-star-full"
title="Create a supertag from the current selection."
on:click={() => dispatch('createSupertag', tags)}
/>
>
<i class="codicon codicon-star-full" />
</TagButton>
{/if}
{#if supportsUrlSharing()}
<ShareButton />
Expand Down
7 changes: 7 additions & 0 deletions static/assets/share.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit db0be5e

Please sign in to comment.