mattermost-mobile/app/screens/edit_profile/components/user_profile_picture.tsx
Joseph Baylon 25ae8fdb88
Detox/E2E: Account e2e tests in Gekidou (#6584)
* Detox/E2E: Account e2e tests in Gekidou

* Fix suite title

* Changed ldap port to number

* Fix testIDs for settings

* Added zephyr test case keys
2022-08-18 03:18:46 -07:00

40 lines
1.2 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import ProfilePicture from '@components/profile_picture';
import {USER_PROFILE_PICTURE_SIZE} from '@constants/profile';
import EditProfilePicture from './edit_profile_picture';
import type UserModel from '@typings/database/models/servers/user';
import type {NewProfileImage} from '@typings/screens/edit_profile';
type Props = {
currentUser: UserModel;
lockedPicture: boolean;
onUpdateProfilePicture: (newProfileImage: NewProfileImage) => void;
}
const UserProfilePicture = ({currentUser, lockedPicture, onUpdateProfilePicture}: Props) => {
if (lockedPicture) {
return (
<ProfilePicture
author={currentUser}
size={USER_PROFILE_PICTURE_SIZE}
showStatus={false}
testID={`edit_profile.${currentUser.id}.profile_picture`}
/>
);
}
return (
<EditProfilePicture
onUpdateProfilePicture={onUpdateProfilePicture}
user={currentUser}
/>
);
};
export default UserProfilePicture;