chore: tweak donate page
This commit is contained in:
parent
7625277beb
commit
849b9ed092
@ -1,13 +1,12 @@
|
|||||||
import "./ZapButton.css";
|
import "./ZapButton.css";
|
||||||
import { faBolt } from "@fortawesome/free-solid-svg-icons";
|
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { HexKey } from "@snort/nostr";
|
import { HexKey } from "@snort/nostr";
|
||||||
|
|
||||||
import { useUserProfile } from "Hooks/useUserProfile";
|
import { useUserProfile } from "Hooks/useUserProfile";
|
||||||
import SendSats from "Element/SendSats";
|
import SendSats from "Element/SendSats";
|
||||||
|
import Icon from "Icons/Icon";
|
||||||
|
|
||||||
const ZapButton = ({ pubkey, lnurl }: { pubkey: HexKey; lnurl?: string }) => {
|
const ZapButton = ({ pubkey, lnurl, children }: { pubkey: HexKey; lnurl?: string; children?: React.ReactNode }) => {
|
||||||
const profile = useUserProfile(pubkey);
|
const profile = useUserProfile(pubkey);
|
||||||
const [zap, setZap] = useState(false);
|
const [zap, setZap] = useState(false);
|
||||||
const service = lnurl ?? (profile?.lud16 || profile?.lud06);
|
const service = lnurl ?? (profile?.lud16 || profile?.lud06);
|
||||||
@ -15,8 +14,9 @@ const ZapButton = ({ pubkey, lnurl }: { pubkey: HexKey; lnurl?: string }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="zap-button" onClick={() => setZap(true)}>
|
<div className="zap-button flex" onClick={() => setZap(true)}>
|
||||||
<FontAwesomeIcon icon={faBolt} />
|
<Icon name="zap" className={children ? "mr5" : ""} size={15} />
|
||||||
|
{children}
|
||||||
</div>
|
</div>
|
||||||
<SendSats
|
<SendSats
|
||||||
target={profile?.display_name || profile?.name}
|
target={profile?.display_name || profile?.name}
|
||||||
|
@ -98,20 +98,24 @@ const DonatePage = () => {
|
|||||||
<p>
|
<p>
|
||||||
<FormattedMessage defaultMessage="Each contributor will get paid a percentage of all donations and NIP-05 orders, you can see the split amounts below" />
|
<FormattedMessage defaultMessage="Each contributor will get paid a percentage of all donations and NIP-05 orders, you can see the split amounts below" />
|
||||||
</p>
|
</p>
|
||||||
<div className="flex">
|
<div className="card">
|
||||||
<div className="mr10">
|
<div className="flex">
|
||||||
<FormattedMessage defaultMessage="Lightning Donation: " />
|
<div className="mr10">
|
||||||
|
<FormattedMessage defaultMessage="Lightning Donation: " />
|
||||||
|
</div>
|
||||||
|
<ZapButton pubkey={bech32ToHex(SnortPubKey)} lnurl={DonateLNURL}>
|
||||||
|
<FormattedMessage defaultMessage="Donate" />
|
||||||
|
</ZapButton>
|
||||||
</div>
|
</div>
|
||||||
<ZapButton pubkey={bech32ToHex(SnortPubKey)} lnurl={DonateLNURL} />
|
{today && (
|
||||||
|
<small>
|
||||||
|
<FormattedMessage
|
||||||
|
defaultMessage="Total today (UTC): {amount} sats"
|
||||||
|
values={{ amount: today.donations.toLocaleString() }}
|
||||||
|
/>
|
||||||
|
</small>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{today && (
|
|
||||||
<small>
|
|
||||||
<FormattedMessage
|
|
||||||
defaultMessage="Total today (UTC): {amount} sats"
|
|
||||||
values={{ amount: today.donations.toLocaleString() }}
|
|
||||||
/>
|
|
||||||
</small>
|
|
||||||
)}
|
|
||||||
<h3>
|
<h3>
|
||||||
<FormattedMessage defaultMessage="Primary Developers" />
|
<FormattedMessage defaultMessage="Primary Developers" />
|
||||||
</h3>
|
</h3>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user