feat: generic nostr.com client config
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Kieran 2024-01-22 13:52:18 +00:00
parent ef8a5c29bf
commit 6fd02cffbb
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 84 additions and 32 deletions

View File

@ -0,0 +1,43 @@
{
"appName": "Nostr",
"appNameCapitalized": "Nostr",
"appTitle": "Nostr",
"hostname": "nostr.com",
"nip05Domain": "nostr.com",
"favicon": "public/favicon.ico",
"appleTouchIconUrl": "/nostrich_512.png",
"navLogo": null,
"publicDir": "public/snort",
"httpCache": "",
"animalNamePlaceholders": false,
"features": {
"analytics": false,
"subscriptions": false,
"deck": false,
"zapPool": false,
"notificationGraph": true,
"communityLeaders": false
},
"signUp": {
"moderation": true,
"defaultFollows": []
},
"defaultPreferences": {
"hideMutedNotes": false
},
"media": {
"bypassImgProxyError": false,
"preferLargeMedia": true
},
"noteCreatorToast": true,
"hideFromNavbar": ["/graph"],
"deckSubKind": 1,
"showPowIcon": true,
"eventLinkPrefix": "nevent",
"profileLinkPrefix": "nprofile",
"defaultRelays": {
"wss://relay.snort.social/": { "read": true, "write": true },
"wss://nostr.wine/": { "read": true, "write": false },
"wss://eden.nostr.land/": { "read": true, "write": false }
}
}

View File

@ -64,10 +64,6 @@ const DonatePage = () => {
const [today, setSumToday] = useState<RevenueToday>();
const [onChain, setOnChain] = useState("");
const api = new SnortApi(ApiHost);
const zapPool = useSyncExternalStore(
c => unwrap(ZapPoolController).hook(c),
() => unwrap(ZapPoolController).snapshot(),
);
async function getOnChainAddress() {
const { address } = await api.onChainDonation();
@ -178,34 +174,7 @@ const DonatePage = () => {
</div>
</Modal>
)}
{CONFIG.features.zapPool && (
<>
<h3>
<FormattedMessage defaultMessage="ZapPool" id="pRess9" />
</h3>
<p>
<FormattedMessage
defaultMessage="Fund the services that you use by splitting a portion of all your zaps into a pool of funds!"
id="x/Fx2P"
/>
</p>
<p>
<Link to="/zap-pool" className="underline">
<FormattedMessage defaultMessage="Configure zap pool" id="kqPQJD" />
</Link>
</p>
<ZapPoolTarget
target={
zapPool.find(b => b.pubkey === bech32ToHex(SnortPubKey) && b.type === ZapPoolRecipientType.Generic) ?? {
type: ZapPoolRecipientType.Generic,
pubkey: bech32ToHex(SnortPubKey),
split: 0,
sum: 0,
}
}
/>
</>
)}
<ZapPoolDonateSection />
<h3>
<FormattedMessage defaultMessage="Primary Developers" id="4IPzdn" />
</h3>
@ -228,4 +197,44 @@ const DonatePage = () => {
);
};
function ZapPoolDonateSection() {
if (!CONFIG.features.zapPool) {
return;
}
// eslint-disable-next-line react-hooks/rules-of-hooks
const zapPool = useSyncExternalStore(
c => unwrap(ZapPoolController).hook(c),
() => unwrap(ZapPoolController).snapshot(),
);
return (
<>
<h3>
<FormattedMessage defaultMessage="ZapPool" id="pRess9" />
</h3>
<p>
<FormattedMessage
defaultMessage="Fund the services that you use by splitting a portion of all your zaps into a pool of funds!"
id="x/Fx2P"
/>
</p>
<p>
<Link to="/zap-pool" className="underline">
<FormattedMessage defaultMessage="Configure zap pool" id="kqPQJD" />
</Link>
</p>
<ZapPoolTarget
target={
zapPool.find(b => b.pubkey === bech32ToHex(SnortPubKey) && b.type === ZapPoolRecipientType.Generic) ?? {
type: ZapPoolRecipientType.Generic,
pubkey: bech32ToHex(SnortPubKey),
split: 0,
sum: 0,
}
}
/>
</>
);
}
export default DonatePage;