diff --git a/src/Form.svelte b/src/Form.svelte index b0f6c7ea0..0a4026e90 100644 --- a/src/Form.svelte +++ b/src/Form.svelte @@ -62,12 +62,9 @@ border-color: var(--color-secondary) !important; } input.field::placeholder { - color: var(--color-subtle); + color: var(--color-secondary); font-style: italic; } - input.field::placeholder { - color: transparent; - } input.field[disabled] { color: var(--color-secondary); } @@ -111,7 +108,7 @@ {field.value} {/if} {:else} - {field.placeholder} + Not set {/if} {/if} diff --git a/src/base/orgs/View.svelte b/src/base/orgs/View.svelte index 3fe7cc30f..4d613cb63 100644 --- a/src/base/orgs/View.svelte +++ b/src/base/orgs/View.svelte @@ -139,12 +139,12 @@ {/if} {#if profile.twitter} - + {/if} {#if profile.github} - + {/if} diff --git a/src/base/registrations/View.svelte b/src/base/registrations/View.svelte index 9724c4f6f..e0c2c47fe 100644 --- a/src/base/registrations/View.svelte +++ b/src/base/registrations/View.svelte @@ -46,18 +46,18 @@ fields = [ { name: "owner", placeholder: "", value: r.owner, resolve: true, editable: false }, - { name: "address", placeholder: "Not set", + { name: "address", placeholder: "Ethereum address, eg. 0x4a9cf21...bc91", value: r.address, editable: true }, - { name: "seed", placeholder: "Not set", - value: r.seed, editable: true }, - { name: "url", label: "URL", placeholder: "Not set", + { name: "url", label: "URL", placeholder: "https://acme.org", value: r.url,editable: true }, - { name: "avatar", placeholder: "Not set", + { name: "avatar", placeholder: "https://acme.org/avatar.png", value: r.avatar, editable: true }, - { name: "twitter", placeholder: "Not set", + { name: "twitter", placeholder: "Twitter username, eg. 'acme'", value: r.twitter, editable: true }, - { name: "github", placeholder: "Not set", + { name: "github", label: "GitHub", placeholder: "GitHub username, eg. 'acme'", value: r.github, editable: true }, + { name: "seed", placeholder: "https://seed.acme.org:8888", + value: r.seed, editable: true }, ]; state = { status: Status.Found, registration: r }; } else { diff --git a/src/base/users/View.svelte b/src/base/users/View.svelte index 7bcd33726..58d7e0980 100644 --- a/src/base/users/View.svelte +++ b/src/base/users/View.svelte @@ -54,7 +54,7 @@ - + @@ -62,17 +62,17 @@ {profile.url} {/if} {#if profile.twitter} - + {/if} {#if profile.github} - + {/if} - + {/await} diff --git a/src/config.json b/src/config.json index 15f9978c1..9250563bf 100644 --- a/src/config.json +++ b/src/config.json @@ -66,7 +66,7 @@ "tokens": [] }, "ceramic": { "api": "https://ceramic-clay.3boxlabs.com" }, - "radicle": { "api": "" }, + "radicle": { "api": "http://0.0.0.0:8888" }, "ipfs": { "gateway": "https://ipfs.io/ipfs/" }, "abi": { "registrar": [ diff --git a/src/profile.ts b/src/profile.ts index 85daa8ad3..f6e920583 100644 --- a/src/profile.ts +++ b/src/profile.ts @@ -1,6 +1,8 @@ import type { Registration } from "@app/base/registrations/registrar"; import type { BasicProfile } from "@ceramicstudio/idx-constants"; -import { formatCAIP10Address, formatIpfsFile, resolveEnsProfile, resolveIdxProfile } from "@app/utils"; +import { + formatCAIP10Address, formatIpfsFile, resolveEnsProfile, resolveIdxProfile, parseUsername, +} from "@app/utils"; import type { Config } from "./config"; export interface IProfile { @@ -19,14 +21,14 @@ export class Profile { // Using undefined as return type if nothing to be returned since it works better with links get github(): string | undefined { - if (this.profile?.ens?.github) return this.profile.ens.github; + if (this.profile?.ens?.github) return parseUsername(this.profile.ens.github); else if (this.profile?.idx?.affiliations) return this.profile.idx?.affiliations.find(item => item === "github"); else return undefined; } // Using undefined as return type if nothing to be returned since it works better with links get twitter(): string | undefined { - if (this.profile?.ens?.twitter) return this.profile.ens.twitter; + if (this.profile?.ens?.twitter) return parseUsername(this.profile.ens.twitter); else if (this.profile?.idx?.affiliations) return this.profile.idx.affiliations.find(item => item === "twitter"); else return undefined; } diff --git a/src/utils.ts b/src/utils.ts index c5d963cf7..ca913e6ac 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -74,6 +74,13 @@ export function parseEnsLabel(name: string | undefined, config: Config): string } } +// Takes a URL, eg. "https://twitter.com/cloudhead", and return "cloudhead". +// Returns the original string if it was unable to extract the username. +export function parseUsername(input: string): string { + const parts = input.split("/"); + return parts[parts.length - 1]; +} + // Return the current unix time. export function unixTime(): number { return Math.floor(Date.now() / 1000);