mirror of
https://github.com/hanzo-apps/hanzo.ai.git
synced 2026-10-30 14:58:08 +00:00
Code on hanzo.ai was plain monospace: 285 blocks across 200 pages, one of them hand-inked in four greys. components/code now renders each sample at build with shiki and @hanzo/ui's codeTheme (Dracula dark, GitHub Light light), every colour written as light-dark() so the page's color-scheme picks it, on the theme's own ground. The page ships the coloured spans and no highlighter; e2e/gates/code.spec.ts holds both. A client page that shows code is split into a server page.tsx that owns the sample and a client view.tsx that takes the highlighted node: ProductLanding's code.source, the blockchain pages' codeExamples, the models kit Sample, the guest-key card, realtime, analytics, payments, sdks and the rest. Transcripts, agent prompts and ASCII diagrams are not code and keep their markup. Takes @hanzo/ui 8.27.83 for codeTheme and @hanzo/design 0.5.35 with it, regenerates app/gui.css for the new theme keys, and lowers the raw-colour allowance to 58: the samples' literal inks are gone.
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { Code } from '@/components/code'
|
|
import LedgerPage from './view'
|
|
|
|
const PAYOUT = `# A split payment: the vendor is paid and the platform takes its cut,
|
|
# in one transaction that lands whole or not at all.
|
|
|
|
curl -X POST http://localhost:3068/v2/main/transactions \\
|
|
-H 'Content-Type: application/json' \\
|
|
-H 'Idempotency-Key: order_42_payout' \\
|
|
-d '{
|
|
"postings": [
|
|
{ "source": "users:001", "destination": "merchants:042", "amount": 9500, "asset": "USD/2" },
|
|
{ "source": "users:001", "destination": "platform:fees", "amount": 500, "asset": "USD/2" }
|
|
],
|
|
"metadata": { "order": "ord_42" }
|
|
}'
|
|
|
|
# Or say it once in Numscript and let the ledger do the arithmetic:
|
|
#
|
|
# send [USD/2 10000] (
|
|
# source = @users:001
|
|
# destination = { 95% to @merchants:042
|
|
# 5% to @platform:fees }
|
|
# )`
|
|
|
|
/** The page, with its sample highlighted where it is built (components/code). */
|
|
export default function Page() {
|
|
return <LedgerPage source={<Code lang="bash" code={PAYOUT} />} />
|
|
}
|