EditProfile: reenable birthdays with TextInput (for now)

This commit is contained in:
Alex Gleason 2022-07-04 13:17:01 -05:00
parent 388d887583
commit d168302e72
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 18 additions and 11 deletions

View file

@ -4,9 +4,19 @@ import { defineMessages, useIntl, FormattedMessage } from 'react-intl';
import { updateNotificationSettings } from 'soapbox/actions/accounts';
import { patchMe } from 'soapbox/actions/me';
import snackbar from 'soapbox/actions/snackbar';
import BirthdayInput from 'soapbox/components/birthday_input';
import List, { ListItem } from 'soapbox/components/list';
import { Button, Column, Form, FormActions, FormGroup, Input, Textarea, HStack, Toggle, FileInput } from 'soapbox/components/ui';
import {
Button,
Column,
FileInput,
Form,
FormActions,
FormGroup,
HStack,
Input,
Textarea,
Toggle,
} from 'soapbox/components/ui';
import Streamfield, { StreamfieldComponent } from 'soapbox/components/ui/streamfield/streamfield';
import { useAppSelector, useAppDispatch, useOwnAccount, useFeatures } from 'soapbox/hooks';
import { normalizeAccount } from 'soapbox/normalizers';
@ -222,10 +232,6 @@ const EditProfile: React.FC = () => {
};
};
const handleBirthdayChange = (date: string) => {
updateData('birthday', date);
};
const handleHideNetworkChange: React.ChangeEventHandler<HTMLInputElement> = e => {
const hide = e.target.checked;
@ -309,9 +315,12 @@ const EditProfile: React.FC = () => {
<FormGroup
labelText={<FormattedMessage id='edit_profile.fields.birthday_label' defaultMessage='Birthday' />}
>
<BirthdayInput
<Input
type='text'
value={data.birthday}
onChange={handleBirthdayChange}
onChange={handleTextChange('birthday')}
placeholder='YYYY-MM-DD'
pattern='\d{4}-\d{2}-\d{2}'
/>
</FormGroup>
)}

View file

@ -148,9 +148,7 @@ const getInstanceFeatures = (instance: Instance) => {
* @see POST /api/v1/accounts
* @see PATCH /api/v1/accounts/update_credentials
*/
// birthdays: v.software === PLEROMA && gte(v.version, '2.4.50'),
// FIXME: temporarily disabled until they can be deleted on the backend.
birthdays: false,
birthdays: v.software === PLEROMA && v.build === SOAPBOX && gte(v.version, '2.4.50'),
/** Whether people who blocked you are visible through the API. */
blockersVisible: features.includes('blockers_visible'),