diff --git a/src/element/ProfilePreview.tsx b/src/element/ProfilePreview.tsx index b36da2e..e91b6d1 100644 --- a/src/element/ProfilePreview.tsx +++ b/src/element/ProfilePreview.tsx @@ -1,4 +1,6 @@ import "./ProfilePreview.css"; +import { ReactNode } from "react"; + import ProfileImage from "./ProfileImage"; import FollowButton from "./FollowButton"; import useProfile from "../feed/ProfileFeed"; @@ -8,7 +10,8 @@ export interface ProfilePreviewProps { pubkey: HexKey, options?: { about?: boolean - } + }, + actions?: ReactNode } export default function ProfilePreview(props: ProfilePreviewProps) { const pubkey = props.pubkey; @@ -24,7 +27,7 @@ export default function ProfilePreview(props: ProfilePreviewProps) { {options.about ?
{user?.about}
: undefined} /> - + {props.actions ?? } ) } \ No newline at end of file diff --git a/src/element/ZapButton.tsx b/src/element/ZapButton.tsx new file mode 100644 index 0000000..31304ab --- /dev/null +++ b/src/element/ZapButton.tsx @@ -0,0 +1,25 @@ +import { faBolt } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { useState } from "react"; +import useProfile from "../feed/ProfileFeed"; +import { HexKey } from "../nostr"; +import LNURLTip from "./LNURLTip"; + +const ZapButton = ({ pubkey }: { pubkey: HexKey }) => { + const profile = useProfile(pubkey)?.get(pubkey); + const [zap, setZap] = useState(false); + const svc = profile?.lud16 || profile?.lud06; + + if (!svc) return null; + + return ( + <> + setZap(true)}> + + + setZap(false)} /> + + ) +} + +export default ZapButton; \ No newline at end of file diff --git a/src/index.css b/src/index.css index b1b58ef..d009a94 100644 --- a/src/index.css +++ b/src/index.css @@ -266,6 +266,14 @@ body.scroll-lock { height: 100vh; } +.m5 { + margin: 5px; +} + +.m10 { + margin: 10px; +} + .mr10 { margin-right: 10px; } diff --git a/src/index.tsx b/src/index.tsx index e3ad111..b133429 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -22,6 +22,7 @@ import ErrorPage from './pages/ErrorPage'; import VerificationPage from './pages/Verification'; import MessagesPage from './pages/MessagesPage'; import ChatPage from './pages/ChatPage'; +import DonatePage from './pages/DonatePage'; /** * HTTP query provider @@ -72,6 +73,10 @@ const router = createBrowserRouter([ { path: "/messages/:id", element: + }, + { + path: "/donate", + element: } ] } diff --git a/src/pages/DonatePage.tsx b/src/pages/DonatePage.tsx new file mode 100644 index 0000000..41efd27 --- /dev/null +++ b/src/pages/DonatePage.tsx @@ -0,0 +1,29 @@ +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import ProfilePreview from "../element/ProfilePreview"; +import ZapButton from "../element/ZapButton"; + +const Developers = [ + "63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed", // kieran + "7fa56f5d6962ab1e3cd424e758c3002b8665f7b0d8dcee9fe9e288d7751ac194" // verbiricha +]; + +const DonatePage = () => { + return ( +
+

Help fund the development of Snort

+

+ Snort is an open source project built by passionate people in their free time +

+

+ Your donations are greatly appreciated +

+

+ Check out the code here: https://github.com/v0l/snort +

+

Developers

+ {Developers.map(a => } />)} +
+ ); +} + +export default DonatePage; \ No newline at end of file