feat: edit profile button

This commit is contained in:
Kieran 2023-12-14 13:21:30 +00:00
parent 4212fe8dc9
commit 86ed4e042e
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -1,7 +1,7 @@
import "./ProfilePage.css"; import "./ProfilePage.css";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { FormattedMessage } from "react-intl"; import { FormattedMessage } from "react-intl";
import { useLocation, useNavigate, useParams } from "react-router-dom"; import { Link, useLocation, useNavigate, useParams } from "react-router-dom";
import { import {
encodeTLVEntries, encodeTLVEntries,
EventKind, EventKind,
@ -193,14 +193,14 @@ export default function ProfilePage({ id: propId, state }: ProfilePageProps) {
targets={ targets={
lnurl?.lnurl && id lnurl?.lnurl && id
? [ ? [
{ {
type: "lnurl", type: "lnurl",
value: lnurl?.lnurl, value: lnurl?.lnurl,
weight: 1, weight: 1,
name: user?.display_name || user?.name, name: user?.display_name || user?.name,
zap: { pubkey: id }, zap: { pubkey: id },
} as ZapTarget, } as ZapTarget,
] ]
: undefined : undefined
} }
show={showLnQr} show={showLnQr}
@ -300,11 +300,6 @@ export default function ProfilePage({ id: propId, state }: ProfilePageProps) {
<div className="profile-actions"> <div className="profile-actions">
{renderIcons()} {renderIcons()}
{!isMe && id && <FollowButton pubkey={id} />} {!isMe && id && <FollowButton pubkey={id} />}
{isMe && id && (
<AsyncButton className="secondary">
<FormattedMessage defaultMessage="Edit" id="wEQDC6" />
</AsyncButton>
)}
</div> </div>
</div> </div>
); );
@ -329,9 +324,11 @@ export default function ProfilePage({ id: propId, state }: ProfilePageProps) {
)} )}
{isMe ? ( {isMe ? (
<> <>
<button className="md:hidden" type="button" onClick={() => navigate("/settings")}> <Link to="/settings">
<FormattedMessage {...messages.Settings} /> <button>
</button> <FormattedMessage defaultMessage="Edit" id="wEQDC6" />
</button>
</Link>
</> </>
) : ( ) : (
<> <>