forked from Kieran/snort
chore: add back zap button to donate page
This commit is contained in:
parent
90291eba96
commit
e6a831ef8c
@ -3,4 +3,5 @@
|
||||
background-color: var(--highlight);
|
||||
padding: 4px 8px;
|
||||
border-radius: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
@ -6,19 +6,19 @@ import useProfile from "Feed/ProfileFeed";
|
||||
import { HexKey } from "Nostr";
|
||||
import LNURLTip from "Element/LNURLTip";
|
||||
|
||||
const ZapButton = ({ pubkey }: { pubkey: HexKey }) => {
|
||||
const profile = useProfile(pubkey)?.get(pubkey);
|
||||
const ZapButton = ({ pubkey, svc }: { pubkey?: HexKey, svc?: string }) => {
|
||||
const profile = useProfile(pubkey)?.get(pubkey ?? "");
|
||||
const [zap, setZap] = useState(false);
|
||||
const svc = profile?.lud16 || profile?.lud06;
|
||||
const service = svc ?? (profile?.lud16 || profile?.lud06);
|
||||
|
||||
if (!svc) return null;
|
||||
if (!service) return null;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="zap-button" onClick={(e) => setZap(true)}>
|
||||
<FontAwesomeIcon icon={faBolt} />
|
||||
</div>
|
||||
<LNURLTip svc={svc} show={zap} onClose={() => setZap(false)} />
|
||||
<LNURLTip svc={service} show={zap} onClose={() => setZap(false)} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import { MetadataCache } from "Db/User";
|
||||
import { HexKey } from "Nostr";
|
||||
import { System } from "Nostr/System";
|
||||
|
||||
export default function useProfile(pubKey: HexKey | Array<HexKey> | undefined): Map<HexKey, MetadataCache> | undefined {
|
||||
export default function useProfile(pubKey?: HexKey | Array<HexKey> | undefined): Map<HexKey, MetadataCache> | undefined {
|
||||
const user = useLiveQuery(async () => {
|
||||
let userList = new Map<HexKey, MetadataCache>();
|
||||
if (pubKey) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
import ProfilePreview from "Element/ProfilePreview";
|
||||
import ZapButton from "Element/ZapButton";
|
||||
import { HexKey } from "Nostr";
|
||||
import { useEffect, useState } from "react";
|
||||
import { bech32ToHex } from "Util";
|
||||
@ -56,6 +57,10 @@ const DonatePage = () => {
|
||||
<p>
|
||||
Each contributor will get paid a percentage of all donations and NIP-05 orders, you can see the split amounts below
|
||||
</p>
|
||||
<div className="flex">
|
||||
<div className="mr10">Lightning Donation: </div>
|
||||
<ZapButton svc={"donate@snort.social"} />
|
||||
</div>
|
||||
<h3>Primary Developers</h3>
|
||||
{Developers.map(a => <ProfilePreview pubkey={a} key={a} actions={actions(a)} />)}
|
||||
<h4>Contributors</h4>
|
||||
|
Loading…
Reference in New Issue
Block a user