This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / web / src / lib / components / welcome / mock.ts
2.6 kB 95 lines
1// stand-in data for the welcome flow. the appview fills these from 2// OnboardingSocial / OnboardingKeys; nothing here is wired to an api yet, so the 3// step components read from this module and a real load later replaces it. 4 5import type { PersonData, RepoCardData } from "$lib/components/profile/types"; 6 7export interface MockKey { 8 id: number; 9 name: string; 10 fingerprint: string; 11 createdAt: string; 12} 13 14const did = (name: string) => `did:plc:${name.replace(/[^a-z0-9]/g, "")}welcome`; 15 16/** OnboardingSocial's People — suggested accounts to follow */ 17export const people: PersonData[] = [ 18 { 19 did: did("alphaone"), 20 handle: "alpha.one", 21 description: "Innovative coder at tangled.org, passionate about sustainable tech.", 22 followers: 1100, 23 following: 99 24 }, 25 { 26 did: did("betaspace"), 27 handle: "beta.space", 28 description: "Rust and Go enthusiast, creating pixel art and exploring plant-based living.", 29 followers: 987, 30 following: 78 31 }, 32 { 33 did: did("gammanetwork"), 34 handle: "gamma.network", 35 description: "Co-founder of EcoTech Labs, blending software with environmental solutions.", 36 followers: 1700, 37 following: 25 38 } 39]; 40 41/** OnboardingSocial's TrendingRepos */ 42export const trendingRepos: RepoCardData[] = [ 43 { 44 rkey: "welcome-1", 45 name: "core", 46 repoDid: did("tangledorg"), 47 ownerHandle: "tangled.org", 48 description: "A decentralized network for secure and scalable data storage.", 49 createdAt: "2026-05-02T10:00:00Z", 50 language: "Go", 51 stars: 2200, 52 issues: 31, 53 pulls: 1 54 }, 55 { 56 rkey: "welcome-2", 57 name: "batman.vim", 58 repoDid: did("072004xyz"), 59 ownerHandle: "072004.xyz", 60 description: "A Vim colourscheme that only works at night.", 61 createdAt: "2026-04-18T10:00:00Z", 62 language: "Vim Script", 63 stars: 412, 64 issues: 3, 65 pulls: 2 66 }, 67 { 68 rkey: "welcome-3", 69 name: "knotserver", 70 repoDid: did("coopppage"), 71 ownerHandle: "coop.page", 72 description: "Self-hostable git remote that speaks the Tangled protocol.", 73 createdAt: "2026-03-09T10:00:00Z", 74 language: "Rust", 75 stars: 856, 76 issues: 12, 77 pulls: 4 78 } 79]; 80 81/** OnboardingKeys' PubKeys — starts empty, the step adds to it */ 82export const initialKeys: MockKey[] = []; 83 84/** 85 * Builds the row the appview would get back from `PUT /settings/keys`. It lives 86 * here rather than in draft.svelte.ts because svelte/prefer-svelte-reactivity 87 * rejects a plain `Date` inside a rune module, and this one is a throwaway — the 88 * timestamp is read once, never held. 89 */ 90export const newKey = (id: number, name: string, key: string): MockKey => ({ 91 id, 92 name, 93 fingerprint: `SHA256:${key.slice(-32)}`, 94 createdAt: new Date().toISOString() 95});