import "./ProfilePage.css"; import Nostrich from "../nostrich.jpg"; import { useState } from "react"; import { useSelector } from "react-redux"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faQrcode } from "@fortawesome/free-solid-svg-icons"; import { useNavigate, useParams } from "react-router-dom"; import useProfile from "../feed/ProfileFeed"; import FollowButton from "../element/FollowButton"; import { extractLnAddress, parseId } from "../Util"; import Timeline from "../element/Timeline"; import { extractLinks } from '../Text' import LNURLTip from "../element/LNURLTip"; import Copy from "../element/Copy"; export default function ProfilePage() { const params = useParams(); const navigate = useNavigate(); const id = parseId(params.id); const user = useProfile(id); const loginPubKey = useSelector(s => s.login.publicKey); const isMe = loginPubKey === id; const [showLnQr, setShowLnQr] = useState(false); function details() { const lnurl = extractLnAddress(user?.lud16 || user?.lud06 || ""); return ( <>

{user?.name}

{isMe ?
navigate("/settings")}>Settings
: }

{extractLinks([user?.about])}

{user?.website ? {user?.website} : null} {lnurl ?
setShowLnQr(true)}>
  ⚡️ {lnurl}
: null} setShowLnQr(false)} /> ) } return ( <>
{details()}
Notes
Reactions
Followers
Follows
) }