diff --git a/public/index.css b/public/index.css
index d8aeb90eb..ef86f18c5 100644
--- a/public/index.css
+++ b/public/index.css
@@ -19,10 +19,12 @@
--color-secondary-2: #2c326d;
--color-secondary-6: #e3e3ff;
--color-tertiary: #55ffff;
+ --color-tertiary-faded: #ade4e4;
--color-tertiary-background: #55ffff11;
--color-tertiary-1: #214047;
--color-tertiary-2: #2c326d;
--color-tertiary-6: #e3e3ff;
+ --color-light: #add0e4;
--color-yellow: #ffff99;
--color-yellow-background: #ffff9911;
--color-positive: #53db53;
@@ -39,7 +41,9 @@
--color-negative-2: #623237;
--color-negative-6: #ffd4d4;
--color-foreground: #ffffff;
+ --color-foreground-90: #dddddd;
--color-foreground-faded: #777788;
+ --color-foreground-subtle: #444455;
--color-foreground-background: #77778811;
--color-foreground-1: #242e38;
--color-foreground-2: #29343d;
@@ -52,6 +56,8 @@
--color-glow-error: #ff555522;
--font-family-sans-serif: Inter, sans-serif;
+ --font-weight-medium: 600;
+ --font-weight-bold: 700;
--font-family-monospace: monospace;
--border-radius: 50px;
--box-shadow-color: var(--color-secondary-2);
diff --git a/public/typography.css b/public/typography.css
index 6f13040b2..4d9687edc 100644
--- a/public/typography.css
+++ b/public/typography.css
@@ -16,7 +16,7 @@
@font-face {
font-family: "Inter";
- font-style: bold;
+ font-style: bolder;
font-weight: 700;
font-display: swap;
src: url("fonts/Inter-Bold.otf");
diff --git a/snowpack.config.js b/snowpack.config.js
index 8f16a88e6..b21aff64d 100644
--- a/snowpack.config.js
+++ b/snowpack.config.js
@@ -2,6 +2,7 @@
module.exports = {
env: {
RADICLE_ALCHEMY_API_KEY: process.env.RADICLE_ALCHEMY_API_KEY,
+ RADICLE_HTTP_API: process.env.RADICLE_HTTP_API,
},
mount: {
public: '/',
@@ -17,6 +18,7 @@ module.exports = {
routes: [
/* Enable an SPA Fallback in development: */
{"match": "routes", "src": ".*", "dest": "/index.html"},
+ {"match": "all", "src": "/projects/.*", "dest": "/index.html"},
],
optimize: {
/* Setting `bundle: true` breaks .json imports in snowpack 3.5.0 */
diff --git a/src/App.svelte b/src/App.svelte
index a28cd282b..5339f3722 100644
--- a/src/App.svelte
+++ b/src/App.svelte
@@ -7,6 +7,7 @@
import Vesting from '@app/base/vesting/Index.svelte';
import Registrations from '@app/base/registrations/Routes.svelte';
import Orgs from '@app/base/orgs/Routes.svelte';
+ import Projects from '@app/base/projects/Routes.svelte';
import Resolver from '@app/base/resolver/Routes.svelte';
import Header from '@app/Header.svelte';
import Loading from '@app/Loading.svelte';
@@ -55,6 +56,7 @@
+
diff --git a/src/Header.svelte b/src/Header.svelte
index c7acb5843..64de2dbc9 100644
--- a/src/Header.svelte
+++ b/src/Header.svelte
@@ -135,7 +135,7 @@
No Network
{/if}
- {#if address}
+ {#if address && tokenBalance}
{formatBalance(tokenBalance)} RAD
diff --git a/src/base/orgs/Org.ts b/src/base/orgs/Org.ts
index 96dd46a06..daff189a6 100644
--- a/src/base/orgs/Org.ts
+++ b/src/base/orgs/Org.ts
@@ -4,7 +4,7 @@ import type { ContractReceipt } from '@ethersproject/contracts';
import { assert } from '@app/error';
import * as utils from '@app/utils';
import type { Config } from '@app/config';
-import type { Project } from '@app/base/projects/Project';
+import type { Project } from '@app/project';
const GetProjects = `
query GetProjects($org: ID!) {
@@ -13,6 +13,7 @@ const GetProjects = `
anchor {
stateHash
stateHashFormat
+ timestamp
}
}
}
diff --git a/src/base/projects/Blob.svelte b/src/base/projects/Blob.svelte
new file mode 100644
index 000000000..8fe27ef2a
--- /dev/null
+++ b/src/base/projects/Blob.svelte
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+ {#if blob.binary}
+ 👀 Binary content
+ {:else}
+
+ {@html lineNumbers.join("\n")}
+
+
+ {#if blob.html}
+ {@html blob.content}
+ {:else}
+ {blob.content}
+ {/if}
+
+ {/if}
+
+
+
diff --git a/src/base/projects/Project.ts b/src/base/projects/Project.ts
deleted file mode 100644
index 03ed14fa6..000000000
--- a/src/base/projects/Project.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import type { Config } from '@app/config';
-
-export interface Project {
- id: string
- anchor: {
- stateHash: string
- stateHashFormat: string
- }
-}
-
-export interface User {
- urn: string
- avatar: { emoji: string, background: { r: number, g: number, b: number } }
-}
-
-export interface Meta {
- name: string
- description: string
- maintainers: User[]
-}
-
-export async function getMetadata(urn: string, config: Config): Promise {
- const response = await fetch(`${config.seed.url}/projects/${urn}`, {
- method: 'GET',
- headers: {
- 'Accept': 'application/json',
- }
- });
-
- if (! response.ok) {
- return null;
- }
-
- return await response.json();
-}
diff --git a/src/base/projects/Routes.svelte b/src/base/projects/Routes.svelte
new file mode 100644
index 000000000..29999a8f2
--- /dev/null
+++ b/src/base/projects/Routes.svelte
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/base/projects/Tree.svelte b/src/base/projects/Tree.svelte
new file mode 100644
index 000000000..f63125deb
--- /dev/null
+++ b/src/base/projects/Tree.svelte
@@ -0,0 +1,37 @@
+
+
+{#each tree.entries as entry (entry.path)}
+ {#if entry.info.objectType === ObjectType.Tree}
+
+ {:else}
+ onSelect({ detail: entry.path })}
+ />
+ {/if}
+{/each}
diff --git a/src/base/projects/Tree/File.svelte b/src/base/projects/Tree/File.svelte
new file mode 100644
index 000000000..ed910afaf
--- /dev/null
+++ b/src/base/projects/Tree/File.svelte
@@ -0,0 +1,55 @@
+
+
+
+
+
+ {#if loading}
+
+
+
+ {:else}
+
+ {/if}
+
{name}
+
diff --git a/src/base/projects/Tree/Folder.svelte b/src/base/projects/Tree/Folder.svelte
new file mode 100644
index 000000000..4847cc9ca
--- /dev/null
+++ b/src/base/projects/Tree/Folder.svelte
@@ -0,0 +1,89 @@
+
+
+
+
+
+ {name}/
+
+
+
+ {#if expanded}
+ {#await tree}
+
+ {:then tree}
+ {#if tree}
+ {#each tree.entries as entry (entry.path)}
+ {#if entry.info.objectType === ObjectType.Tree}
+
+ {:else}
+ {
+ onSelectFile({ detail: entry.path });
+ }} />
+ {/if}
+ {/each}
+ {/if}
+ {/await}
+ {/if}
+
diff --git a/src/base/projects/View.svelte b/src/base/projects/View.svelte
new file mode 100644
index 000000000..edb25128a
--- /dev/null
+++ b/src/base/projects/View.svelte
@@ -0,0 +1,143 @@
+
+
+
+
+
+
+ {#if meta === "loading"}
+
+ {:else if meta}
+ {meta.name}
+ {urn}
+ {meta.description}
+ {/if}
+
+ commit {commit}
+
+
+
+
+
+ {#await proj.getTree(urn, commit, "/", config)}
+ Loading..
+ {:then tree}
+
+ {:catch err}
+ {err}
+ {/await}
+
+
+
+ {#await blob}
+
+ {:then blob}
+ {#if blob}
+
+ {:else}
+
+ {/if}
+ {:catch}
+
+ {/await}
+
+
+
diff --git a/src/base/projects/Widget.svelte b/src/base/projects/Widget.svelte
index 0c5208e84..620905054 100644
--- a/src/base/projects/Widget.svelte
+++ b/src/base/projects/Widget.svelte
@@ -1,12 +1,10 @@