fix: messages link
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Kieran 2023-08-17 20:06:04 +01:00
parent f6a46e3523
commit 3b11f63573
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 31 additions and 3 deletions

View File

@ -1,6 +1,8 @@
import { Link } from "react-router-dom";
import { KieranPubKey } from "Const";
import { FormattedMessage } from "react-intl";
import { TLVEntryType, encodeTLVEntries, NostrPrefix } from "@snort/system";
import { bech32ToHex } from "SnortUtils";
export default function HelpPage() {
return (
@ -12,7 +14,16 @@ export default function HelpPage() {
<FormattedMessage
defaultMessage="If you have an enquiry about your NIP-05 order please DM {link}"
values={{
link: <Link to={`/messages/${KieranPubKey}`}>Kieran</Link>,
link: (
<Link
to={`/messages/${encodeTLVEntries("chat4" as NostrPrefix, {
type: TLVEntryType.Author,
length: 64,
value: bech32ToHex(KieranPubKey),
})}`}>
Kieran
</Link>
),
}}
/>
</p>

View File

@ -2,7 +2,15 @@ import "./ProfilePage.css";
import { useEffect, useState } from "react";
import { useIntl, FormattedMessage } from "react-intl";
import { useNavigate, useParams } from "react-router-dom";
import { encodeTLV, EventKind, HexKey, NostrPrefix, tryParseNostrLink } from "@snort/system";
import {
encodeTLV,
encodeTLVEntries,
EventKind,
HexKey,
NostrPrefix,
TLVEntryType,
tryParseNostrLink,
} from "@snort/system";
import { LNURL } from "@snort/shared";
import { useUserProfile } from "@snort/system-react";
@ -325,7 +333,16 @@ export default function ProfilePage() {
)}
{loginPubKey && (
<>
<IconButton onClick={() => navigate(`/messages/${hexToBech32(NostrPrefix.PublicKey, id)}`)}>
<IconButton
onClick={() =>
navigate(
`/messages/${encodeTLVEntries("chat4" as NostrPrefix, {
type: TLVEntryType.Author,
length: 64,
value: id,
})}`
)
}>
<Icon name="envelope" size={16} />
</IconButton>
</>