|
|
|
@ -55,6 +55,7 @@ const messages = defineMessages({
|
|
|
|
|
displayNamePlaceholder: { id: 'edit_profile.fields.display_name_placeholder', defaultMessage: 'Name' },
|
|
|
|
|
websitePlaceholder: { id: 'edit_profile.fields.website_placeholder', defaultMessage: 'Display a Link' },
|
|
|
|
|
locationPlaceholder: { id: 'edit_profile.fields.location_placeholder', defaultMessage: 'Location' },
|
|
|
|
|
nip05Placeholder: { id: 'edit_profile.fields.nip05_placeholder', defaultMessage: 'user@{domain}' },
|
|
|
|
|
cancel: { id: 'common.cancel', defaultMessage: 'Cancel' },
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -75,6 +76,11 @@ interface AccountCredentialsSource {
|
|
|
|
|
sensitive?: boolean;
|
|
|
|
|
/** Default language to use for authored statuses. (ISO 6391) */
|
|
|
|
|
language?: string;
|
|
|
|
|
/** Nostr metadata. */
|
|
|
|
|
nostr?: {
|
|
|
|
|
/** Nostr NIP-05 identifier. */
|
|
|
|
|
nip05?: string;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -120,6 +126,8 @@ interface AccountCredentials {
|
|
|
|
|
location?: string;
|
|
|
|
|
/** User's birthday. */
|
|
|
|
|
birthday?: string;
|
|
|
|
|
/** Nostr NIP-05 identifier. */
|
|
|
|
|
nip05?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Convert an account into an update_credentials request object. */
|
|
|
|
@ -142,6 +150,7 @@ const accountToCredentials = (account: Account): AccountCredentials => {
|
|
|
|
|
website: account.website,
|
|
|
|
|
location: account.location,
|
|
|
|
|
birthday: account.pleroma?.birthday ?? undefined,
|
|
|
|
|
nip05: account.source?.nostr?.nip05 ?? '',
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -308,6 +317,19 @@ const EditProfile: React.FC = () => {
|
|
|
|
|
/>
|
|
|
|
|
</FormGroup>
|
|
|
|
|
|
|
|
|
|
{features.nip05 && (
|
|
|
|
|
<FormGroup
|
|
|
|
|
labelText={<FormattedMessage id='edit_profile.fields.nip05_label' defaultMessage='Username' />}
|
|
|
|
|
>
|
|
|
|
|
<Input
|
|
|
|
|
type='text'
|
|
|
|
|
value={data.nip05}
|
|
|
|
|
onChange={handleTextChange('nip05')}
|
|
|
|
|
placeholder={intl.formatMessage(messages.nip05Placeholder, { domain: location.host })}
|
|
|
|
|
/>
|
|
|
|
|
</FormGroup>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{features.birthdays && (
|
|
|
|
|
<FormGroup
|
|
|
|
|
labelText={<FormattedMessage id='edit_profile.fields.birthday_label' defaultMessage='Birthday' />}
|
|
|
|
|