enzostvs HF staff commited on
Commit
8009faa
β€’
1 Parent(s): 48bc121

middleware btn

Browse files
src/lib/components/generate/Response.svelte CHANGED
@@ -1,9 +1,9 @@
1
  <script lang="ts">
2
  import { get } from "svelte/store";
3
  import { generationStore } from "$lib/stores/use-generation";
 
4
 
5
  import Button from "$lib/components/Button.svelte";
6
- import Loading from "$lib/components/Loading.svelte";
7
 
8
  let generation = get(generationStore);
9
  export let loading_generation: boolean = false;
@@ -86,21 +86,23 @@
86
  <div class="p-8 w-full">
87
  <div class="w-full flex items-center justify-end gap-4">
88
  <Button size="lg" theme="light" icon="material-symbols:save" iconPosition="right" onClick={saveImage}>Save</Button>
89
- <Button
90
- size="lg"
91
- theme="blue"
92
- icon="bxs:share"
93
- iconPosition="right"
94
- loading={loading}
95
- disabled={loading || already_saved}
96
- onClick={share}
97
- >
98
- {#if already_saved}
99
- Shared!
100
- {:else}
101
- Share with community
102
- {/if}
103
- </Button>
 
 
104
  </div>
105
  <p class="text-neutral-500 text-sm text-right mt-2.5">
106
  All images not shared with the community are deleted right after generation.
 
1
  <script lang="ts">
2
  import { get } from "svelte/store";
3
  import { generationStore } from "$lib/stores/use-generation";
4
+ import UserIsLogged from '$lib/components/UserIsLogged.svelte';
5
 
6
  import Button from "$lib/components/Button.svelte";
 
7
 
8
  let generation = get(generationStore);
9
  export let loading_generation: boolean = false;
 
86
  <div class="p-8 w-full">
87
  <div class="w-full flex items-center justify-end gap-4">
88
  <Button size="lg" theme="light" icon="material-symbols:save" iconPosition="right" onClick={saveImage}>Save</Button>
89
+ <UserIsLogged>
90
+ <Button
91
+ size="lg"
92
+ theme="blue"
93
+ icon="bxs:share"
94
+ iconPosition="right"
95
+ loading={loading}
96
+ disabled={loading || already_saved}
97
+ onClick={share}
98
+ >
99
+ {#if already_saved}
100
+ Shared!
101
+ {:else}
102
+ Share with community
103
+ {/if}
104
+ </Button>
105
+ </UserIsLogged>
106
  </div>
107
  <p class="text-neutral-500 text-sm text-right mt-2.5">
108
  All images not shared with the community are deleted right after generation.