Discriminator in username
This commit is contained in:
parent
58f0012f14
commit
00f82a6d39
54 changed files with 2706 additions and 892 deletions
34
ts/state/smart/EditUsernameModalBody.tsx
Normal file
34
ts/state/smart/EditUsernameModalBody.tsx
Normal file
|
@ -0,0 +1,34 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { connect } from 'react-redux';
|
||||
import { mapDispatchToProps } from '../actions';
|
||||
|
||||
import type { PropsDataType } from '../../components/EditUsernameModalBody';
|
||||
import { EditUsernameModalBody } from '../../components/EditUsernameModalBody';
|
||||
|
||||
import type { StateType } from '../reducer';
|
||||
import { getIntl } from '../selectors/user';
|
||||
import {
|
||||
getUsernameReservationState,
|
||||
getUsernameReservationObject,
|
||||
getUsernameReservationError,
|
||||
} from '../selectors/username';
|
||||
import { getMe } from '../selectors/conversations';
|
||||
|
||||
function mapStateToProps(state: StateType): PropsDataType {
|
||||
const i18n = getIntl(state);
|
||||
const { username } = getMe(state);
|
||||
|
||||
return {
|
||||
i18n,
|
||||
currentUsername: username,
|
||||
state: getUsernameReservationState(state),
|
||||
reservation: getUsernameReservationObject(state),
|
||||
error: getUsernameReservationError(state),
|
||||
};
|
||||
}
|
||||
|
||||
const smart = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
export const SmartEditUsernameModalBody = smart(EditUsernameModalBody);
|
Loading…
Add table
Add a link
Reference in a new issue