feat: add lud16 component and only render it in Ditto

environments/review-set-lightn-7857tt/deployments/4635
P. Reis 2024-05-22 20:01:33 -03:00
rodzic 8ae8780930
commit a898d69afe
2 zmienionych plików z 20 dodań i 0 usunięć

Wyświetl plik

@ -56,6 +56,7 @@ const messages = defineMessages({
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}' },
lud16Placeholder: { id: 'edit_profile.fields.lud16_placeholder', defaultMessage: 'user@example.com' },
cancel: { id: 'common.cancel', defaultMessage: 'Cancel' },
});
@ -358,6 +359,19 @@ const EditProfile: React.FC = () => {
</FormGroup>
)}
{features.accountLud16 && (
<FormGroup
labelText={<FormattedMessage id='edit_profile.fields.lud16_label' defaultMessage='Lightning Address' />}
>
<Input
type='email'
value={data.lud16}
onChange={handleTextChange('lud16')}
placeholder={intl.formatMessage(messages.lud16Placeholder)}
/>
</FormGroup>
)}
{features.accountWebsite && (
<FormGroup
labelText={<FormattedMessage id='edit_profile.fields.website_label' defaultMessage='Website' />}

Wyświetl plik

@ -157,6 +157,12 @@ const getInstanceFeatures = (instance: Instance) => {
v.software === DITTO,
]),
/**
* Ability to set one's lightning address on their profile.
* @see PATCH /api/v1/accounts/update_credentials
*/
accountLud16: v.software === DITTO,
/**
* Move followers to a different ActivityPub account.
* @see POST /api/pleroma/move_account