Skip to content

Commit

Permalink
fix: make refresh button disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
istudyatuni committed Apr 21, 2022
1 parent 7c171b1 commit c966911
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
{#if show}
<div class="flex justify-between mb-3">
<Button on:click={toggleShow} class="mr-2">Hide</Button>
<div class:hidden={$refresh === false}>
<Button on:click={() => window.location.reload()}>Refresh</Button>
</div>
<Button on:click={() => window.location.reload()} disabled={!$refresh}>
Refresh
</Button>
</div>

<div class="flex mb-2">
Expand Down
8 changes: 5 additions & 3 deletions src/components/atoms/Button.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<script>
export let danger = false
export let danger = false,
disabled = false
</script>

<button
class="rounded px-3 py-2 bg-gray-300 {$$props.class}"
class="rounded px-3 py-2 bg-gray-300 disabled:opacity-50 {$$props.class}"
on:click
class:text-red-500={danger}>
class:text-red-500={danger}
{disabled}>
<slot />
</button>

0 comments on commit c966911

Please sign in to comment.