mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 03:40:37 +08:00
Use new UI kit icons in empty states
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<script lang="ts">
|
||||
import type { ComponentProps } from "svelte";
|
||||
|
||||
import IconLarge from "./IconLarge.svelte";
|
||||
import Icon from "./Icon.svelte";
|
||||
|
||||
export let iconName: ComponentProps<IconLarge>["name"];
|
||||
export let iconName: ComponentProps<Icon>["name"];
|
||||
export let caption: string;
|
||||
export let inline: boolean = false;
|
||||
</script>
|
||||
@@ -22,10 +22,18 @@
|
||||
.inline {
|
||||
flex-direction: row;
|
||||
}
|
||||
.icon :global(svg) {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
.inline .icon :global(svg) {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="placeholder" class:inline>
|
||||
<IconLarge name={iconName} />
|
||||
<div class="icon"><Icon name={iconName} /></div>
|
||||
{#each caption.split("\n") as line}
|
||||
{line}
|
||||
<br />
|
||||
|
||||
@@ -288,7 +288,9 @@
|
||||
</div>
|
||||
{:else}
|
||||
<div class="loading">
|
||||
<Placeholder iconName="desert" caption="No repositories to show." />
|
||||
<Placeholder
|
||||
iconName="repository"
|
||||
caption="No repositories to show." />
|
||||
</div>
|
||||
{/if}
|
||||
{:catch error}
|
||||
|
||||
@@ -236,11 +236,11 @@
|
||||
<div class="container">
|
||||
{#if listState === "pinned"}
|
||||
<Placeholder
|
||||
iconName="desert"
|
||||
iconName="repository"
|
||||
caption="This node doesn’t have any pinned repositories." />
|
||||
{:else}
|
||||
<Placeholder
|
||||
iconName="desert"
|
||||
iconName="repository"
|
||||
caption="This node doesn’t seed any repositories." />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -531,12 +531,12 @@
|
||||
</div>
|
||||
{:else}
|
||||
<div style:margin="1rem 0">
|
||||
<Placeholder iconName="empty-file" caption="Empty file" inline />
|
||||
<Placeholder iconName="document" caption="Empty file" inline />
|
||||
</div>
|
||||
{/if}
|
||||
{:else}
|
||||
<div style:margin="1rem 0">
|
||||
<Placeholder iconName="binary-file" caption="Binary file" inline />
|
||||
<Placeholder iconName="binary" caption="Binary file" inline />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
|
||||
{#if repo.payloads["xyz.radicle.project"].meta.issues[status] === 0}
|
||||
<div class="placeholder">
|
||||
<Placeholder iconName="no-issues" caption={`No ${status} issues`} />
|
||||
<Placeholder iconName="issue" caption={`No ${status} issues`} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -558,7 +558,7 @@
|
||||
{:else}
|
||||
<div style:margin="4rem 0">
|
||||
<Placeholder
|
||||
iconName="no-patches"
|
||||
iconName="patch"
|
||||
caption="No activity on this patch yet" />
|
||||
</div>
|
||||
{/each}
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
|
||||
{#if repo.payloads["xyz.radicle.project"].meta.patches[status] === 0}
|
||||
<div class="placeholder">
|
||||
<Placeholder iconName="no-patches" caption={`No ${status} patches`} />
|
||||
<Placeholder iconName="patch" caption={`No ${status} patches`} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
{#if allReleases.length === 0 && !error}
|
||||
<div class="placeholder">
|
||||
<Placeholder
|
||||
iconName="desert"
|
||||
iconName="parcel"
|
||||
caption={showFilters && !allAuthors
|
||||
? "No releases by delegates"
|
||||
: "No releases"} />
|
||||
|
||||
@@ -224,23 +224,23 @@
|
||||
{:else if blobResult.error.status === 413}
|
||||
<div class="placeholder">
|
||||
<Placeholder
|
||||
iconName="exclamation-circle"
|
||||
iconName="warning"
|
||||
caption="This file is too big to be displayed.
|
||||
If you want to view this file, clone this repository locally." />
|
||||
</div>
|
||||
{:else if path === "/"}
|
||||
<div class="placeholder">
|
||||
<Placeholder iconName="no-file" caption="No README found." />
|
||||
<Placeholder iconName="document" caption="No README found." />
|
||||
</div>
|
||||
{:else}
|
||||
<div class="placeholder">
|
||||
<Placeholder iconName="no-file" caption="File not found." />
|
||||
<Placeholder iconName="document" caption="File not found." />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{:else}
|
||||
<div class="placeholder">
|
||||
<Placeholder iconName="no-file" caption="No files at this revision." />
|
||||
<Placeholder iconName="document" caption="No files at this revision." />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
</div>
|
||||
{:else}
|
||||
<div style:margin="4rem 0" style:width="100%">
|
||||
<Placeholder iconName="binary-file" caption="Binary file" />
|
||||
<Placeholder iconName="binary" caption="Binary file" />
|
||||
</div>
|
||||
{/if}
|
||||
{:else if preview && blob.content}
|
||||
@@ -218,7 +218,7 @@
|
||||
</table>
|
||||
{:else}
|
||||
<div style:margin="4rem 0" style:width="100%">
|
||||
<Placeholder iconName="empty-file" caption="Empty file" />
|
||||
<Placeholder iconName="document" caption="Empty file" />
|
||||
</div>
|
||||
{/if}
|
||||
</File>
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
{:else}
|
||||
<div class="container">
|
||||
<Placeholder
|
||||
iconName="desert"
|
||||
iconName="repository"
|
||||
caption="This user doesn’t have any repositories on this node." />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user