Skip to content

Commit

Permalink
fix: Fix getFindProfile types
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoroldos committed Sep 14, 2022
1 parent c3fbfef commit b6e32cf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 23 deletions.
10 changes: 3 additions & 7 deletions src/lib/FlowConnect/FlowConnect.svelte
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<script type="ts">
import { Button } from '../index';
interface FlowUser {
loggedIn: boolean;
addr: string;
}
export let logIn: () => void;
export let unauthenticate: () => void;
export let user: FlowUser;
export let getFindProfile: (userAddress: string) => any;
// TODO: apply user interface
export let user: any;
export let getFindProfile: (address: string) => Promise<string>;
// let findProfile = getFindProfile(user?.addr);
</script>
Expand Down
30 changes: 14 additions & 16 deletions src/lib/Header/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
export let themeStore: 'dark' | 'light';
export let logIn: () => void;
export let unauthenticate: () => void;
export let getFindProfile: () => string;
export let getFindProfile: (address: string) => Promise<string>;
// TODO: apply user interface
export let user: any;
</script>
Expand Down Expand Up @@ -96,21 +96,19 @@
<Hamburger {open} onClick={hamburgerClick} />
</div>

<!-- {#if $user?.loggedIn}
{#await findProfile then profile}
<a href="/my-collections" sveltekit:prefetch>
{#if profile}
<img class="avatar" src={profile.avatar} alt={`${profile.name} avatar`} />
{:else}
<img
class="avatar"
src="https://cdn-icons-png.flaticon.com/512/168/168734.png"
alt="default avatar"
/>
{/if}
</a>
{/await}
{/if} -->
{#if user?.loggedIn}
<!-- {#await findProfile then profile} -->
<!-- {#if profile}
<img class="avatar" src={profile.avatar} alt={`${profile.name} avatar`} />
{:else} -->
<img
class="avatar"
src="https://cdn-icons-png.flaticon.com/512/168/168734.png"
alt="default avatar"
/>
<!-- {/if} -->
<!-- {/await} -->
{/if}
</Row>
</Row>
</Container>
Expand Down

0 comments on commit b6e32cf

Please sign in to comment.