Skip to content

Commit 18750e6

Browse files
markets/: config.brand + config.tagline flow into the UI wordmark and titles (standalone hosts rebrand; JSS default unchanged)
1 parent 086213a commit 18750e6

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

markets/plugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,9 +1308,9 @@ export async function activate(api) {
13081308
// ---------------------------------------------------------------- UI
13091309
const uiHandler = async (request, reply) => {
13101310
for (const [k, v] of Object.entries(UI_HEADERS)) reply.header(k, v);
1311-
return reply.header('content-type', 'text/html; charset=utf-8').send(renderUi(prefix, { accounts: accountsUi }));
1311+
return reply.header('content-type', 'text/html; charset=utf-8').send(renderUi(prefix, { accounts: accountsUi, brand: cfg.brand, tagline: cfg.tagline }));
13121312
};
1313-
api.fastify.get(prefix, uiHandler);
1313+
if (prefix) api.fastify.get(prefix, uiHandler); // '' would be an empty route path
13141314
api.fastify.get(`${prefix}/`, uiHandler);
13151315

13161316
tick();

markets/ui.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424

2525
export function renderUi(prefix, opts = {}) {
2626
const accounts = !!opts.accounts; // standalone host: register/login form
27+
const brand = typeof opts.brand === 'string' && opts.brand ? opts.brand : 'Markets';
28+
const tagline = typeof opts.tagline === 'string' && opts.tagline ? opts.tagline : 'prediction markets on your pod';
2729
const P = JSON.stringify(prefix);
2830
return `<!doctype html>
2931
<html lang="en">
3032
<head>
3133
<meta charset="utf-8">
3234
<meta name="viewport" content="width=device-width, initial-scale=1">
33-
<title>Marketsprediction markets on your pod</title>
35+
<title>${brand}${tagline}</title>
3436
<style>
3537
:root{
3638
/* surfaces + ink */
@@ -316,7 +318,7 @@ export function renderUi(prefix, opts = {}) {
316318
<rect x="7.75" y="6" width="4.5" height="13" rx="1.5" fill="currentColor" opacity=".7"></rect>
317319
<rect x="14.5" y="1" width="4.5" height="18" rx="1.5" fill="var(--accent)"></rect>
318320
</svg>
319-
Markets
321+
${brand}
320322
</a>
321323
<span class="livechip off" id="live"><span class="livedot" aria-hidden="true"></span><span id="live-t">connecting</span></span>
322324
<span class="spacer"></span>
@@ -1370,7 +1372,7 @@ export function renderUi(prefix, opts = {}) {
13701372
if (h.startsWith('#m/')) return renderDetail(h.slice(3), true);
13711373
$('detail-view').classList.add('hidden');
13721374
$('list-view').classList.remove('hidden');
1373-
document.title = 'Marketsprediction markets on your pod';
1375+
document.title = ${JSON.stringify(brand + '' + tagline)};
13741376
current = null; cursor = null; paged = false;
13751377
$('d-position').dataset.shape = '';
13761378
cancelSlip();

0 commit comments

Comments
 (0)