Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion demos/freelance-escrow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ simulation. You'll need testnet XLM in your Freighter wallet to post the bond;
get some from [Friendbot](https://friendbot.stellar.org/) if you're testing
with a fresh address.

The app starts with an empty job list. Every job it shows is one created
through the "Post a job" form, so there is no seeded or mock content anywhere.

## What maps to what

| App action | Tholos call |
Expand Down Expand Up @@ -82,5 +85,5 @@ src/
components/
JobCard.tsx, MilestoneRow.tsx, PostJobForm.tsx, WalletButton.tsx, RoleSwitcher.tsx
data/
jobs.ts Seed jobs and the Job/Milestone types
jobs.ts Job/Milestone types
```
8 changes: 8 additions & 0 deletions demos/freelance-escrow/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@
gap: var(--space-4);
}

.job-list-empty {
margin: 0;
padding: var(--space-5);
border-radius: var(--radius-lg);
border: 1px dashed var(--border);
color: var(--text-muted);
}

.job-card {
border-radius: var(--radius-lg);
padding: var(--space-5);
Expand Down
8 changes: 5 additions & 3 deletions demos/freelance-escrow/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ function AppShell() {
{showPostJob && <PostJobForm onDone={() => setShowPostJob(false)} />}

<div className="job-list">
{jobs.map((job) => (
<JobCard key={job.id} job={job} />
))}
{jobs.length === 0 ? (
<p className="job-list-empty">No jobs yet. Post the first one to get started.</p>
) : (
jobs.map((job) => <JobCard key={job.id} job={job} />)
)}
</div>
</main>
</div>
Expand Down
78 changes: 0 additions & 78 deletions demos/freelance-escrow/src/data/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,81 +39,3 @@ export interface Job {
token: string;
milestones: Milestone[];
}

export const jobs: Job[] = [
{
id: "job-1",
title: "Landing page redesign",
description:
"Redesign the marketing site landing page: new hero, pricing table, and mobile layout.",
client: "Nova Analytics",
freelancer: "Priya Chen",
token: "USDC",
milestones: [
{
id: "job-1-m1",
title: "Wireframes and content outline",
amount: "250",
status: "in_progress",
},
{
id: "job-1-m2",
title: "Hero and pricing section build",
amount: "600",
status: "in_progress",
},
{
id: "job-1-m3",
title: "Mobile layout and QA pass",
amount: "400",
status: "in_progress",
},
],
},
{
id: "job-2",
title: "Onboarding email sequence",
description:
"Write and implement a 5-part onboarding email sequence in the existing ESP template.",
client: "Fernbank Studio",
freelancer: "Diego Ramirez",
token: "USDC",
milestones: [
{
id: "job-2-m1",
title: "Copy draft for all 5 emails",
amount: "300",
status: "in_progress",
},
{
id: "job-2-m2",
title: "ESP implementation and send test",
amount: "200",
status: "in_progress",
},
],
},
{
id: "job-3",
title: "API rate-limit middleware",
description:
"Add a configurable rate-limit middleware to the existing Node API gateway, with tests.",
client: "Harrow Logistics",
freelancer: "Amara Okafor",
token: "USDC",
milestones: [
{
id: "job-3-m1",
title: "Middleware implementation",
amount: "500",
status: "in_progress",
},
{
id: "job-3-m2",
title: "Load test and tuning",
amount: "350",
status: "in_progress",
},
],
},
];
8 changes: 4 additions & 4 deletions demos/freelance-escrow/src/state/JobsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
type ReactNode,
type SetStateAction,
} from "react";
import { jobs as seedJobs, type Job, type Milestone, type MilestoneStatus } from "../data/jobs";
import type { Job, Milestone, MilestoneStatus } from "../data/jobs";
import { JobsContext, type JobsContextValue, type NewJobInput } from "./jobs-context";
import type { Assertion } from "../lib/tholos";
import { detectWallet } from "../lib/wallet";
Expand Down Expand Up @@ -63,13 +63,13 @@ function loadJobsFromStorage(): Job[] {
try {
const stored = window.localStorage.getItem(JOBS_STORAGE_KEY);
if (stored === null) {
return seedJobs;
return [];
}

const parsed: unknown = JSON.parse(stored);
return Array.isArray(parsed) ? parsed.filter(isJob) : seedJobs;
return Array.isArray(parsed) ? parsed.filter(isJob) : [];
} catch {
return seedJobs;
return [];
}
}

Expand Down
Loading