-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8f1c58
commit c6d8b3e
Showing
23 changed files
with
261 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default as Loadable } from './loadable.svelte' | ||
export { default as LoadableQuery } from './loadable-query.svelte' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script lang="ts"> | ||
import type { OperationResultStore } from '@urql/svelte' | ||
import Loadable from './loadable.svelte' | ||
type Data = $$Generic | ||
type $$Slots = { default: { loaded: Data } } | ||
export let query: OperationResultStore<Data> | ||
</script> | ||
|
||
<Loadable error={$query.error} data={$query.data} let:loaded> | ||
<slot {loaded} /> | ||
</Loadable> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts"> | ||
import { ErrorMessage } from '../ErrorMessage' | ||
import { Loading } from '../Loading' | ||
type T = $$Generic | ||
type $$Slots = { default: { loaded: T } } | ||
export let error: unknown | ||
export let data: T | null | undefined | ||
</script> | ||
|
||
<div class="grid h-full"> | ||
{#if error} | ||
<ErrorMessage {error} /> | ||
{:else if data} | ||
<slot loaded={data} /> | ||
{:else} | ||
<div class="place-self-center"> | ||
<Loading /> | ||
</div> | ||
{/if} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as Tokens } from './tokens.svelte' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script lang="ts"> | ||
import { MaxItems } from '$lib/client/constants' | ||
import type { FetchPOAPTokensData } from '$lib/client/poap' | ||
import type { POAPEventMetadata, POAPTokenWithEvent } from '$lib/types/poap' | ||
import { collectItems } from '$lib/utils/items' | ||
import { Token } from '../Token' | ||
export let tokenData: FetchPOAPTokensData | ||
export let metadata: Record<string, POAPEventMetadata> = {} | ||
export let max = MaxItems | ||
const set = new Set<string>() | ||
let tokens: POAPTokenWithEvent[] = [] | ||
$: tokens = collectItems(set, max, tokens, tokenData.tokens, ({ id }) => id).sort( | ||
(a, b) => Number(b.created) - Number(a.created), | ||
) | ||
</script> | ||
|
||
<div class="grid grid-cols-1 auto-rows-min gap-2 py-2 w-full"> | ||
{#each tokens as token (token.id)} | ||
<Token {token} event={token.event} metadata={metadata[token.event.id]} /> | ||
{/each} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.