Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Show placeholder when there are no pinned projects
Rūdolfs Ošiņš committed 2 years ago
commit c96d693083d2e94d4522bdb5961749be8f7a5a60
parent 39f2ff5217c8d64fd2741080e44e13eb7f49507b
1 file changed +40 -13
modified src/views/nodes/View.svelte
@@ -98,6 +98,24 @@
    grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
    gap: 1rem;
  }
+
  .empty-state {
+
    text-align: center;
+
    display: flex;
+
    flex-direction: column;
+
    align-items: center;
+
    justify-content: center;
+
    gap: 0.5rem;
+
    height: 35vh;
+
  }
+
  .empty-state .heading {
+
    font-size: var(--font-size-small);
+
    font-weight: var(--font-weight-bold);
+
  }
+
  .empty-state .label {
+
    display: block;
+
    font-size: var(--font-size-small);
+
    font-weight: var(--font-weight-regular);
+
  }
  @media (max-width: 720px) {
    .wrapper {
      width: 100%;
@@ -164,19 +182,28 @@
        {#await fetchProjectInfos( baseUrl, { show: isLocal(baseUrl.hostname) ? "all" : "pinned", perPage: stats.repos.total }, )}
          <Loading small center />
        {:then projectInfos}
-
          <div class="project-grid">
-
            {#each projectInfos as projectInfo}
-
              <ProjectCard
-
                {projectInfo}
-
                isSeeding={isLocal(baseUrl.hostname)
-
                  ? true
-
                  : isSeeding(projectInfo.project.id)}
-
                isDelegate={isDelegate(
-
                  session?.publicKey,
-
                  projectInfo.project.delegates,
-
                ) ?? false} />
-
            {/each}
-
          </div>
+
          {#if projectInfos.length > 0}
+
            <div class="project-grid">
+
              {#each projectInfos as projectInfo}
+
                <ProjectCard
+
                  {projectInfo}
+
                  isSeeding={isLocal(baseUrl.hostname)
+
                    ? true
+
                    : isSeeding(projectInfo.project.id)}
+
                  isDelegate={isDelegate(
+
                    session?.publicKey,
+
                    projectInfo.project.delegates,
+
                  ) ?? false} />
+
              {/each}
+
            </div>
+
          {:else}
+
            <div class="empty-state">
+
              <div class="heading">No pinned projects</div>
+
              <div class="label">
+
                The selected seed node doesn't have any pinned projects.
+
              </div>
+
            </div>
+
          {/if}
        {:catch error}
          {router.push(handleError(error, baseUrlToString(api.baseUrl)))}
        {/await}