Edit profile
This commit is contained in:
parent
f14c426170
commit
cd35a29638
42 changed files with 2124 additions and 356 deletions
41
ts/state/smart/ProfileEditorModal.ts
Normal file
41
ts/state/smart/ProfileEditorModal.ts
Normal file
|
@ -0,0 +1,41 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import { get } from 'lodash';
|
||||
import { mapDispatchToProps } from '../actions';
|
||||
import {
|
||||
ProfileEditorModal,
|
||||
PropsDataType as ProfileEditorModalPropsType,
|
||||
} from '../../components/ProfileEditorModal';
|
||||
import { PropsDataType } from '../../components/ProfileEditor';
|
||||
import { StateType } from '../reducer';
|
||||
import { getIntl } from '../selectors/user';
|
||||
import { getMe } from '../selectors/conversations';
|
||||
import { selectRecentEmojis } from '../selectors/emojis';
|
||||
|
||||
function mapStateToProps(
|
||||
state: StateType
|
||||
): PropsDataType & ProfileEditorModalPropsType {
|
||||
const { avatarPath, aboutText, aboutEmoji, firstName, familyName } = getMe(
|
||||
state
|
||||
);
|
||||
const recentEmojis = selectRecentEmojis(state);
|
||||
const skinTone = get(state, ['items', 'skinTone'], 0);
|
||||
|
||||
return {
|
||||
aboutEmoji,
|
||||
aboutText,
|
||||
avatarPath,
|
||||
familyName,
|
||||
firstName: String(firstName),
|
||||
hasError: state.globalModals.profileEditorHasError,
|
||||
i18n: getIntl(state),
|
||||
recentEmojis,
|
||||
skinTone,
|
||||
};
|
||||
}
|
||||
|
||||
const smart = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
export const SmartProfileEditorModal = smart(ProfileEditorModal);
|
Loading…
Add table
Add a link
Reference in a new issue