diff --git a/__snapshots__/repo-details--loading.png b/__snapshots__/repo-details--loading.png new file mode 100644 index 0000000..86f83a1 Binary files /dev/null and b/__snapshots__/repo-details--loading.png differ diff --git a/__snapshots__/repo-details--long-and-no-spaces.png b/__snapshots__/repo-details--long-and-no-spaces.png new file mode 100644 index 0000000..9e50be6 Binary files /dev/null and b/__snapshots__/repo-details--long-and-no-spaces.png differ diff --git a/__snapshots__/repo-details--long-details.png b/__snapshots__/repo-details--long-details.png new file mode 100644 index 0000000..2a44368 Binary files /dev/null and b/__snapshots__/repo-details--long-details.png differ diff --git a/__snapshots__/repo-details--no-description.png b/__snapshots__/repo-details--no-description.png new file mode 100644 index 0000000..a686a36 Binary files /dev/null and b/__snapshots__/repo-details--no-description.png differ diff --git a/__snapshots__/repo-details--no-maintainers-or-relays.png b/__snapshots__/repo-details--no-maintainers-or-relays.png new file mode 100644 index 0000000..19d6d1b Binary files /dev/null and b/__snapshots__/repo-details--no-maintainers-or-relays.png differ diff --git a/__snapshots__/repo-details--no-maintainers.png b/__snapshots__/repo-details--no-maintainers.png new file mode 100644 index 0000000..e95ce17 Binary files /dev/null and b/__snapshots__/repo-details--no-maintainers.png differ diff --git a/__snapshots__/repo-details--no-name-or-description.png b/__snapshots__/repo-details--no-name-or-description.png new file mode 100644 index 0000000..3d82b52 Binary files /dev/null and b/__snapshots__/repo-details--no-name-or-description.png differ diff --git a/__snapshots__/repo-details--no-relays.png b/__snapshots__/repo-details--no-relays.png new file mode 100644 index 0000000..19b5dce Binary files /dev/null and b/__snapshots__/repo-details--no-relays.png differ diff --git a/__snapshots__/repo-details--no-tags.png b/__snapshots__/repo-details--no-tags.png new file mode 100644 index 0000000..6169858 Binary files /dev/null and b/__snapshots__/repo-details--no-tags.png differ diff --git a/__snapshots__/repo-details--short-details.png b/__snapshots__/repo-details--short-details.png new file mode 100644 index 0000000..3201aac Binary files /dev/null and b/__snapshots__/repo-details--short-details.png differ diff --git a/__snapshots__/repo-details.test.js.snap b/__snapshots__/repo-details.test.js.snap new file mode 100644 index 0000000..530aff4 --- /dev/null +++ b/__snapshots__/repo-details.test.js.snap @@ -0,0 +1,442 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Repo/Details Long Details test 1`] = ` +
+

+ description +

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis nisl eget turpis congue molestie. Nulla vitae purus nec augue accumsan facilisis sed sed ligula. Vestibulum sed risus lacinia risus lacinia molestie. Ut lorem quam, consequat eget tempus in, rhoncus vel nunc. Duis efficitur a leo vel sodales. Nam id fermentum lacus. Etiam nec placerat velit. Praesent ac consectetur est. Aenean iaculis commodo enim. + Lorem ipsum dolor sit amet, con... +

+
+
+ svelte +
+
+ nostr +
+
+ code-collaboration +
+
+ git +
+
+
+

+ maintainers +

+
+ carole +
+
+ bob +
+
+ steve +
+
+
+

+ relays +

+
+ relay.damus.io +
+
+ relay.snort.social +
+
+ relayable.org +
+
+
+`; + +exports[`Repo/Details Long and No Spaces test 1`] = ` +
+

+ description +

+

+ LoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsum +

+
+
+ svelte +
+
+ nostr +
+
+ code-collaboration +
+
+ git +
+
+
+

+ maintainers +

+
+ carole +
+
+ bob +
+
+ steve +
+
+
+

+ relays +

+
+ relay.damus.io +
+
+ relay.snort.social +
+
+ relayable.org +
+
+
+`; + +exports[`Repo/Details No Description test 1`] = ` +
+
+
+
+
+ svelte +
+
+ nostr +
+
+ code-collaboration +
+
+ git +
+
+
+

+ maintainers +

+
+ carole +
+
+ bob +
+
+ steve +
+
+
+

+ relays +

+
+ relay.damus.io +
+
+ relay.snort.social +
+
+ relayable.org +
+
+
+`; + +exports[`Repo/Details No Maintainers or Relays test 1`] = ` +
+

+ description +

+

+ short description +

+
+
+ svelte +
+
+ nostr +
+
+ code-collaboration +
+
+ git +
+
+
+
+
+
+
+
+
+
+
+`; + +exports[`Repo/Details No Maintainers test 1`] = ` +
+

+ description +

+

+ short description +

+
+
+ svelte +
+
+ nostr +
+
+ code-collaboration +
+
+ git +
+
+
+
+
+
+
+

+ relays +

+
+ relay.damus.io +
+
+ relay.snort.social +
+
+ relayable.org +
+
+
+`; + +exports[`Repo/Details No Name or Description test 1`] = ` +
+
+
+
+
+ svelte +
+
+ nostr +
+
+ code-collaboration +
+
+ git +
+
+
+

+ maintainers +

+
+ carole +
+
+ bob +
+
+ steve +
+
+
+

+ relays +

+
+ relay.damus.io +
+
+ relay.snort.social +
+
+ relayable.org +
+
+
+`; + +exports[`Repo/Details No Relays test 1`] = ` +
+

+ description +

+

+ short description +

+
+
+ svelte +
+
+ nostr +
+
+ code-collaboration +
+
+ git +
+
+
+

+ maintainers +

+
+ carole +
+
+ bob +
+
+ steve +
+
+
+
+
+
+
+`; + +exports[`Repo/Details No Tags test 1`] = ` +
+

+ description +

+

+ short description +

+
+
+
+

+ maintainers +

+
+ carole +
+
+ bob +
+
+ steve +
+
+
+

+ relays +

+
+ relay.damus.io +
+
+ relay.snort.social +
+
+ relayable.org +
+
+
+`; + +exports[`Repo/Details Short Details test 1`] = ` +
+

+ description +

+

+ short description +

+
+
+ svelte +
+
+ nostr +
+
+ code-collaboration +
+
+ git +
+
+
+
+
+
+
+

+ relays +

+
+ relay.damus.io +
+
+ relay.snort.social +
+
+ relayable.org +
+
+
+`; + +exports[`Repo/Details loading test 1`] = ` +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`; diff --git a/src/lib/components/Repo.vectors.ts b/src/lib/components/Repo.vectors.ts index 4d15806..cb827a7 100644 --- a/src/lib/components/Repo.vectors.ts +++ b/src/lib/components/Repo.vectors.ts @@ -1,4 +1,5 @@ import type { Args as SummaryCardArgs } from "./RepoSummaryCard.svelte"; +import type { Args as DetailsArgs } from "./RepoDetails.svelte"; export let RepoSummaryCardArgsVectors = { Short: { @@ -15,4 +16,43 @@ export let RepoSummaryCardArgsVectors = { description: "LoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsum>", } as SummaryCardArgs, +}; +let base: DetailsArgs = { + repo_id: "9ee507fc4357d7ee16a5d8901bedcd103f23c17d", + name: "Short Name", + description: "short description", + git_server: "github.com/example/example", + tags: ["svelte", "nostr", "code-collaboration", "git"], + relays: [ + "relay.damus.io", + "relay.snort.social", + "relayable.org", + ], + maintainers: [ + "carole", + "bob", + "steve", + ], +}; + +export let RepoDetailsArgsVectors = { + Short: { ...base, } as DetailsArgs, + Long: { + ...base, + name: "Long Name that goes on and on and on and on and on and on and on and on and on", + description: + "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis nisl eget turpis congue molestie. Nulla vitae purus nec augue accumsan facilisis sed sed ligula. Vestibulum sed risus lacinia risus lacinia molestie. Ut lorem quam, consequat eget tempus in, rhoncus vel nunc. Duis efficitur a leo vel sodales. Nam id fermentum lacus. Etiam nec placerat velit. Praesent ac consectetur est. Aenean iaculis commodo enim.\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quis nisl eget turpis congue molestie.", + } as DetailsArgs, + LongNoSpaces: { + ...base, + name: "LongNameLongNameLongNameLongNameLongNameLongNameLongNameLongName", + description: + "LoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsumLoremipsum", + } as DetailsArgs, + NoNameOrDescription: { ...base, name: "", description: "" } as DetailsArgs, + NoDescription: { ...base, description: "" } as DetailsArgs, + NoTags: { ...base, tags: [] } as DetailsArgs, + NoMaintainers: { ...base, maintainers: [] } as DetailsArgs, + NoRelays: { ...base, relays: [] } as DetailsArgs, + NoMaintainersOrRelays: { ...base, maintainers: [], relays: [] } as DetailsArgs, }; \ No newline at end of file diff --git a/src/lib/components/RepoDetails.stories.svelte b/src/lib/components/RepoDetails.stories.svelte new file mode 100644 index 0000000..ce905ea --- /dev/null +++ b/src/lib/components/RepoDetails.stories.svelte @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/lib/components/RepoDetails.svelte b/src/lib/components/RepoDetails.svelte new file mode 100644 index 0000000..41202d0 --- /dev/null +++ b/src/lib/components/RepoDetails.svelte @@ -0,0 +1,98 @@ + + + + +
+ {#if loading} +
+
+
+ {:else if description.length == 0} +
+ {:else} +

description

+

{short_descrption}

+ {/if} +
+ {#if loading} +
+
+ {:else} + {#each tags as tag} +
{tag}
+ {/each} + {/if} +
+
+ {#if loading} +
+
+
+ {:else if maintainers.length == 0} +
+ {:else} +

maintainers

+ {#each maintainers as maintainer} +
{maintainer}
+ {/each} + {/if} +
+
+ {#if loading} +
+
+
+ {:else if relays.length == 0} +
+ {:else} +

relays

+ {#each relays as relay} +
{relay}
+ {/each} + {/if} +
+
diff --git a/src/lib/wrappers/RepoDetails.svelte b/src/lib/wrappers/RepoDetails.svelte new file mode 100644 index 0000000..81fb220 --- /dev/null +++ b/src/lib/wrappers/RepoDetails.svelte @@ -0,0 +1,39 @@ + + + diff --git a/src/routes/repo/[repo_id]/+page.svelte b/src/routes/repo/[repo_id]/+page.svelte index 4d4fac2..9deea1e 100644 --- a/src/routes/repo/[repo_id]/+page.svelte +++ b/src/routes/repo/[repo_id]/+page.svelte @@ -1,8 +1,16 @@ - +
+
+ +
+
+ +
+