aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/features')
-rw-r--r--src/features/names.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/features/names.js b/src/features/names.js
index e1f23ce..701b474 100644
--- a/src/features/names.js
+++ b/src/features/names.js
@@ -889,6 +889,23 @@ export function namesFeature(ctx) {
h('p', { class: 'small muted', style: 'margin:0' }, t('namesZapCodeHow')));
}
+ // The public pay page (v3.coinos.io/<name>/receive, src/pay-page.js): the
+ // link a website puts behind its Donate button, as coinos.io/<name>/receive
+ // was on the old coinos. coinos.io names only: the page pays those.
+ function payPagePane() {
+ const st = load();
+ const domain = st.domain || DOMAIN();
+ if (!st.name || (domain !== 'coinos.io' && domain !== 'staging.coinos.io')) return h('div', { class: 'small muted' }, t('namesNeedArk'));
+ const host = domain === 'staging.coinos.io' ? location.origin : 'https://v3.coinos.io';
+ const link = `${host}/${st.name}/receive`;
+ return h('div', { class: 'col', style: 'gap:10px;width:100%;align-items:center' },
+ h('div', { class: 'addr-box break', style: 'width:100%' }, link),
+ h('div', { class: 'row gap6' },
+ copyBtn(link, t('copy')),
+ h('button', { class: 'btn-ghost btn-sm', onClick: () => window.open(link, '_blank', 'noopener') }, t('namesPageOpen'))),
+ h('p', { class: 'small muted', style: 'margin:0' }, t('namesPageHow')));
+ }
+
// ---- more options -------------------------------------------------------
// The address covers almost everyone; behind one link live the other codes
// a payer might insist on.
@@ -901,6 +918,7 @@ export function namesFeature(ctx) {
h('strong', { class: 'small' }, label),
h('span', { class: 'small muted' }, how));
return h('div', { class: 'list', style: 'width:100%' },
+ opt('page', t('namesMorePage'), t('namesMorePageHow')),
opt('bolt11', t('namesMoreBolt11'), t('namesMoreBolt11How')),
opt('bolt12', t('namesMoreBolt12'), t('namesMoreBolt12How'), loadOffers),
opt('ark', t('namesMoreArk'), t('namesMoreArkHow')),
@@ -927,12 +945,14 @@ export function namesFeature(ctx) {
ark: t('namesMoreArk'),
clink: t('namesMoreClink'),
ownnode: t('namesOwnNode'),
+ page: t('namesMorePage'),
};
const body = ui.namesMore === 'bolt11' ? invoicePane()
: ui.namesMore === 'bolt12' ? offerPane()
: ui.namesMore === 'ark' ? arkPane()
: ui.namesMore === 'clink' ? clinkPane()
: ui.namesMore === 'ownnode' ? ownNodeSection()
+ : ui.namesMore === 'page' ? payPagePane()
: menuPane();
return h('div', { class: 'col', style: 'gap:10px;width:100%' },
h('div', { class: 'row between', style: 'align-items:baseline' },