@@ -3,6 +3,10 @@ import Container from "../../components/Container";
33import Section from "../../components/Section";
44import SingleColumn from "../../components/SingleColumn";
55import { useInputChange } from "../../lib/hooks";
6+import ob from "urbit-ob";
7+import Sigil from "../../components/Sigil";
8+import Head from "next/head";
9+import Meta from "../../components/Meta";
610
711const SubmissionPage = () => {
812 const [form, handleFormChange] = useInputChange();
@@ -12,13 +16,24 @@ const SubmissionPage = () => {
1216 )}.md&value=${encodeURIComponent(
1317 `+++
1418ship = "${form?.ship}"
19+nickname = "${form?.nickname}"
20+bgcolor = "${form?.bgcolor}"
21+image = "${form?.image}"
1522+++
1623
1724${form?.description || ""}`
1825 )}`;
1926
27+ let validColor = /^#[0-9A-F]{6}$/i.test(form?.bgColor)
28+ ? form?.bgColor
29+ : "#000000";
30+
2031 return (
2132 <Container>
33+ <Head>
34+ <title>Claim an Urbit ID page • Urbit.org</title>
35+ {Meta}
36+ </Head>
2237 <SingleColumn>
2338 <Section narrow className="space-y-12">
2439 <div className="flex flex-col space-y-4">
@@ -50,14 +65,60 @@ ${form?.description || ""}`
5065 <div className="flex flex-col space-y-4">
5166 <h3>Enter your Urbit ID information</h3>
5267 <div className="flex flex-col">
53− <p>
54− Urbit ID (e.g. <code>~bitbet-bolbel</code>) (required)
55− </p>
56− <input
57− className="bg-wall-100 p-2"
58− name="ship"
59− onChange={handleFormChange}
60− />
68+ <p>Urbit ID (required)</p>
69+ <div className="flex items-center">
70+ {form?.image ? (
71+ <img
72+ className="mr-2 rounded-lg"
73+ src={form?.image}
74+ style={{ height: 32, width: 32 }}
75+ />
76+ ) : (
77+ <div
78+ className="flex p-2 rounded-lg mr-2"
79+ style={{
80+ backgroundColor: validColor,
81+ display: form?.ship?.length > 14 ? "none" : "block",
82+ }}
83+ >
84+ <Sigil
85+ icon
86+ color={validColor}
87+ size="25"
88+ patp={
89+ ob.isValidPatp(form?.ship || "") ? form?.ship : "~zod"
90+ }
91+ />
92+ </div>
93+ )}
94+ <input
95+ className="bg-wall-100 p-2 flex-1"
96+ name="ship"
97+ placeholder="~bitbet-bolbel"
98+ onChange={handleFormChange}
99+ />
100+ </div>
101+ </div>
102+ <div className="flex flex-col">
103+ <p>Nickname (optional)</p>
104+ <input placeholder="Bitbet" className="bg-wall-100 p-2" />
105+ </div>
106+ <div>
107+ <p>Sigil color (or avatar image)</p>
108+ <div className="flex space-x-2">
109+ <input
110+ placeholder="#000000"
111+ name="bgColor"
112+ className="bg-wall-100 p-2 flex-1"
113+ onChange={handleFormChange}
114+ />
115+ <input
116+ placeholder="https://..."
117+ name="image"
118+ className="bg-wall-100 p-2 flex-1"
119+ onChange={handleFormChange}
120+ />
121+ </div>
61122 </div>
62123 <div className="flex flex-col">
63124 <p>Hosted groups</p>