birth_date -> birthday, hide_birth_date -> show_birthday
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
97d09317ae
commit
bae4455f8c
|
@ -9,7 +9,7 @@ import 'react-datepicker/dist/react-datepicker.css';
|
||||||
import { getFeatures } from 'soapbox/utils/features';
|
import { getFeatures } from 'soapbox/utils/features';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
birthDatePlaceholder: { id: 'edit_profile.fields.birth_date_placeholder', defaultMessage: 'Your birth date' },
|
birthDatePlaceholder: { id: 'edit_profile.fields.birthday_placeholder', defaultMessage: 'Your birth date' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapStateToProps = state => {
|
const mapStateToProps = state => {
|
||||||
|
@ -17,7 +17,7 @@ const mapStateToProps = state => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
supportsBirthDates: features.birthDates,
|
supportsBirthDates: features.birthDates,
|
||||||
minAge: state.getIn(['instance', 'pleroma', 'metadata', 'birth_date_min_age']),
|
minAge: state.getIn(['instance', 'pleroma', 'metadata', 'birthday_min_age']),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ const mapStateToProps = (state, props) => ({
|
||||||
needsApproval: state.getIn(['instance', 'approval_required']),
|
needsApproval: state.getIn(['instance', 'approval_required']),
|
||||||
supportsEmailList: getFeatures(state.get('instance')).emailList,
|
supportsEmailList: getFeatures(state.get('instance')).emailList,
|
||||||
supportsAccountLookup: getFeatures(state.get('instance')).accountLookup,
|
supportsAccountLookup: getFeatures(state.get('instance')).accountLookup,
|
||||||
birthDateRequired: state.getIn(['instance', 'pleroma', 'metadata', 'birth_date_required']),
|
birthDateRequired: state.getIn(['instance', 'pleroma', 'metadata', 'birthday_required']),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default @connect(mapStateToProps)
|
export default @connect(mapStateToProps)
|
||||||
|
@ -223,7 +223,7 @@ class RegistrationForm extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (birthDate) {
|
if (birthDate) {
|
||||||
params.set('birth_date', birthDate.toISOString().slice(0, 10));
|
params.set('birthday', birthDate.toISOString().slice(0, 10));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ class Account extends ImmutablePureComponent {
|
||||||
|
|
||||||
if (!account) return null;
|
if (!account) return null;
|
||||||
|
|
||||||
const birthDate = account.getIn(['pleroma', 'birth_date']);
|
const birthDate = account.getIn(['pleroma', 'birthday']);
|
||||||
if (!birthDate) return null;
|
if (!birthDate) return null;
|
||||||
|
|
||||||
const formattedBirthDate = intl.formatDate(birthDate, { day: 'numeric', month: 'short', year: 'numeric' });
|
const formattedBirthDate = intl.formatDate(birthDate, { day: 'numeric', month: 'short', year: 'numeric' });
|
||||||
|
|
|
@ -50,7 +50,7 @@ const messages = defineMessages({
|
||||||
error: { id: 'edit_profile.error', defaultMessage: 'Profile update failed' },
|
error: { id: 'edit_profile.error', defaultMessage: 'Profile update failed' },
|
||||||
bioPlaceholder: { id: 'edit_profile.fields.bio_placeholder', defaultMessage: 'Tell us about yourself.' },
|
bioPlaceholder: { id: 'edit_profile.fields.bio_placeholder', defaultMessage: 'Tell us about yourself.' },
|
||||||
displayNamePlaceholder: { id: 'edit_profile.fields.display_name_placeholder', defaultMessage: 'Name' },
|
displayNamePlaceholder: { id: 'edit_profile.fields.display_name_placeholder', defaultMessage: 'Name' },
|
||||||
birthDatePlaceholder: { id: 'edit_profile.fields.birth_date_placeholder', defaultMessage: 'Your birth date' },
|
birthDatePlaceholder: { id: 'edit_profile.fields.birthday_placeholder', defaultMessage: 'Your birth date' },
|
||||||
});
|
});
|
||||||
|
|
||||||
const makeMapStateToProps = () => {
|
const makeMapStateToProps = () => {
|
||||||
|
@ -113,8 +113,8 @@ class EditProfile extends ImmutablePureComponent {
|
||||||
const strangerNotifications = account.getIn(['pleroma', 'notification_settings', 'block_from_strangers']);
|
const strangerNotifications = account.getIn(['pleroma', 'notification_settings', 'block_from_strangers']);
|
||||||
const acceptsEmailList = account.getIn(['pleroma', 'accepts_email_list']);
|
const acceptsEmailList = account.getIn(['pleroma', 'accepts_email_list']);
|
||||||
const discoverable = account.getIn(['source', 'pleroma', 'discoverable']);
|
const discoverable = account.getIn(['source', 'pleroma', 'discoverable']);
|
||||||
const birthDate = account.getIn(['pleroma', 'birth_date']);
|
const birthDate = account.getIn(['pleroma', 'birthday']);
|
||||||
const hideBirthDate = account.getIn(['pleroma', 'hide_birth_date']);
|
const showBirthDate = account.getIn(['source', 'pleroma', 'show_birthday']);
|
||||||
|
|
||||||
const initialState = account.withMutations(map => {
|
const initialState = account.withMutations(map => {
|
||||||
map.merge(map.get('source'));
|
map.merge(map.get('source'));
|
||||||
|
@ -124,7 +124,7 @@ class EditProfile extends ImmutablePureComponent {
|
||||||
map.set('accepts_email_list', acceptsEmailList);
|
map.set('accepts_email_list', acceptsEmailList);
|
||||||
map.set('hide_network', hidesNetwork(account));
|
map.set('hide_network', hidesNetwork(account));
|
||||||
map.set('discoverable', discoverable);
|
map.set('discoverable', discoverable);
|
||||||
map.set('hide_birth_date', hideBirthDate);
|
map.set('show_birthday', showBirthDate);
|
||||||
if (birthDate) map.set('birthDate', new Date(birthDate));
|
if (birthDate) map.set('birthDate', new Date(birthDate));
|
||||||
unescapeParams(map, ['display_name', 'bio']);
|
unescapeParams(map, ['display_name', 'bio']);
|
||||||
});
|
});
|
||||||
|
@ -166,8 +166,8 @@ class EditProfile extends ImmutablePureComponent {
|
||||||
hide_follows: state.hide_network,
|
hide_follows: state.hide_network,
|
||||||
hide_followers_count: state.hide_network,
|
hide_followers_count: state.hide_network,
|
||||||
hide_follows_count: state.hide_network,
|
hide_follows_count: state.hide_network,
|
||||||
birth_date: state.birthDate?.toISOString().slice(0, 10),
|
birthday: state.birthDate?.toISOString().slice(0, 10),
|
||||||
hide_birth_date: state.hide_birth_date,
|
show_birthday: state.show_birthday,
|
||||||
}, this.getFieldParams().toJS());
|
}, this.getFieldParams().toJS());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ class EditProfile extends ImmutablePureComponent {
|
||||||
rows={3}
|
rows={3}
|
||||||
/>
|
/>
|
||||||
<BirthDateInput
|
<BirthDateInput
|
||||||
hint={<FormattedMessage id='edit_profile.fields.birth_date_label' defaultMessage='Birth date' />}
|
hint={<FormattedMessage id='edit_profile.fields.birthday_label' defaultMessage='Birth date' />}
|
||||||
value={this.state.birthDate}
|
value={this.state.birthDate}
|
||||||
onChange={this.handleBirthDateChange}
|
onChange={this.handleBirthDateChange}
|
||||||
/>
|
/>
|
||||||
|
@ -345,10 +345,10 @@ class EditProfile extends ImmutablePureComponent {
|
||||||
onChange={this.handleCheckboxChange}
|
onChange={this.handleCheckboxChange}
|
||||||
/>
|
/>
|
||||||
{supportsBirthDates && <Checkbox
|
{supportsBirthDates && <Checkbox
|
||||||
label={<FormattedMessage id='edit_profile.fields.hide_birth_date_label' defaultMessage='Hide my birth date' />}
|
label={<FormattedMessage id='edit_profile.fields.show_birthday_label' defaultMessage='Show my birth date' />}
|
||||||
hint={<FormattedMessage id='edit_profile.hints.hide_birth_date' defaultMessage='Your birth date will not be shown on your profile.' />}
|
hint={<FormattedMessage id='edit_profile.hints.show_birthday' defaultMessage='Your birth date will be visible on your profile.' />}
|
||||||
name='hide_birth_date'
|
name='show_birthday'
|
||||||
checked={this.state.hide_birth_date}
|
checked={this.state.show_birthday}
|
||||||
onChange={this.handleCheckboxChange}
|
onChange={this.handleCheckboxChange}
|
||||||
/>}
|
/>}
|
||||||
{supportsEmailList && <Checkbox
|
{supportsEmailList && <Checkbox
|
||||||
|
|
|
@ -83,7 +83,7 @@ class ProfileInfoPanel extends ImmutablePureComponent {
|
||||||
getBirthDate = () => {
|
getBirthDate = () => {
|
||||||
const { account, intl } = this.props;
|
const { account, intl } = this.props;
|
||||||
|
|
||||||
const birthDate = account.getIn(['pleroma', 'birth_date']);
|
const birthDate = account.getIn(['pleroma', 'birthday']);
|
||||||
if (!birthDate) return null;
|
if (!birthDate) return null;
|
||||||
|
|
||||||
const formattedBirthDate = intl.formatDate(birthDate, { day: 'numeric', month: 'long', year: 'numeric' });
|
const formattedBirthDate = intl.formatDate(birthDate, { day: 'numeric', month: 'long', year: 'numeric' });
|
||||||
|
|
Loading…
Reference in New Issue