@@ -1,5 +1,6 @@
1import { useState, useEffect } from 'react';
1import { useState, useEffect } from 'react';
2import Head from "next/head";
2import Head from "next/head";
3+import Link from 'next/link';
3import Meta from "../components/Meta";
4import Meta from "../components/Meta";
@@ -9,8 +10,9 @@ import {
9} from "@urbit/foundation-design-system";
10} from "@urbit/foundation-design-system";
10import Header from "../components/Header";
11import Header from "../components/Header";
11import Footer from "../components/Footer";
12import Footer from "../components/Footer";
13+import cn from 'classnames';
13−const postReq = (path, params, method='post') => {
15+const postReq = (path, params, method = 'post') => {
14 const form = document.createElement('form');
16 const form = document.createElement('form');
15 form.method = method;
17 form.method = method;
16 form.action = path;
18 form.action = path;
@@ -34,7 +36,8 @@ const postReq = (path, params, method='post') => {
35export default function Trial(props) {
37export default function Trial(props) {
36 const post = {
38 const post = {
37− title: "Trial",
39+ title: "Explore the Network",
40+ description: "Get one week of a complimentary hosted comet: a temporary Urbit ID."
40 const [count, setCount] = useState(0)
43 const [count, setCount] = useState(0)
@@ -42,7 +45,7 @@ export default function Trial(props) {
42 useEffect(() => {
45 useEffect(() => {
43 fetch('https://api.shore.arvo.network/count', {
46 fetch('https://api.shore.arvo.network/count', {
44 method: 'GET',
47 method: 'GET',
45− headers: {'Content-Type': 'application/json'}
48+ headers: { 'Content-Type': 'application/json' }
47 .then(res => res.json())
50 .then(res => res.json())
48 .then(data => {
51 .then(data => {
@@ -52,50 +55,64 @@ export default function Trial(props) {
53 const available = count > 0;
56 const available = count > 0;
55− const buttonBg = available ? '' : 'pink';
58 <Container>
59 <Container>
60− <title>Trial • urbit.org</title>
61+ <title>{post.title} • urbit.org</title>
61 {Meta(post)}
62 {Meta(post)}
63 <IntraNav ourSite="https://urbit.org" search={props.search} />
64 <IntraNav ourSite="https://urbit.org" search={props.search} />
64 <SingleColumn>
65 <SingleColumn>
65 <Header />
66 <Header />
66− <Section className="pt-8">
67+ <Section className="space-y-12">
67− <h1>Trial</h1>
68+ <h1>{post.title}</h1>
68− <p className="mt-12">There are currently {count} trial comets left.</p>
69+ {/* Flex between image and blurb, collapse to col on mobile */}
69− </Section>
70+ <div className="flex flex-col items-center space-y-4 md:space-y-0 md:flex-row md:space-x-4">
71+ <img className="max-w-lg h-auto w-full" src="https://media.urbit.org/site/getting-started/explore.png" />
72+ {/* Blurb is flexed to space button and copy */}
73+ <div className="flex-col flex space-y-4">
74+ <p>No downloads, no signup.</p>
75+ <p>Get <span className="font-bold">one week</span> of a complimentary hosted comet: a temporary Urbit ID.</p>
76+ {/* Button is flexed to space potential "try again later" copy */}
70− <div className="layout px-4 md:px-8">
77+ <div className="space-x-4 flex items-center">
71− <a className="p-8 button-lg bg-green-400 text-white"
78+ <a className={cn("p-8 button-lg text-white max-w-fit", {
72− style={{"backgroundColor": buttonBg}}
79+ "bg-green-400": available,
80+ "bg-wall-300 cursor-not-allowed": !available,
73− onClick={(e) => {
82+ onClick={(e) => {
74− e.stopPropagation();
83+ e.stopPropagation();
76− if (!available) {
85+ if (!available) {
80− fetch('https://api.shore.arvo.network/enter', {
89+ fetch('https://api.shore.arvo.network/enter', {
81− method: 'GET',
90+ method: 'GET',
82− headers: {'Content-Type': 'application/json'}
91+ headers: { 'Content-Type': 'application/json' }
84− .then(res =>{
93+ .then(res => {
85− if (!res.ok) {
94+ if (!res.ok) {
86− throw 'Error response from shore api.';
95+ throw 'Error response from shore api.';
88− return res.json();
97+ return res.json();
90− .then(data => {
99+ .then(data => {
91− postReq(data.url + '/~/login', {password: data.code, redirect: '/'});
100+ postReq(data.url + '/~/login', { password: data.code, redirect: '/' });
93− .catch(e => setCount(0));
102+ .catch(e => setCount(0));
96− {available ? 'Try now' : 'No trial comets available, try again later'}
105+ {available ? 'Launch Comet' : 'No Comets Available'}
98− </div>
107+ {!available && <p>Try back later!</p>}
111+ <div className="max-w-prose flex flex-col space-y-4">
112+ <p>Comets are great for checking things out, but some groups may require a planet – a permanent Urbit ID.</p>
113+ <p>Learn more about <Link href="/getting-started/get-planet"><a>getting a planet</a></Link>.</p>
99 </SingleColumn>
116 </SingleColumn>
100 <Footer />
117 <Footer />
101 </Container>
118 </Container>