|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
import { Box, Button, Icon, TextInput, Margins, Avatar } from '@rocket.chat/fuselage'; |
|
|
|
|
import React, { useState, useCallback } from 'react'; |
|
|
|
|
|
|
|
|
|
import { useSetting } from '../../../contexts/SettingsContext'; |
|
|
|
|
import { useToastMessageDispatch } from '../../../contexts/ToastMessagesContext'; |
|
|
|
|
import { useTranslation } from '../../../contexts/TranslationContext'; |
|
|
|
|
import { useFileInput } from '../../../hooks/useFileInput'; |
|
|
|
|
@ -9,6 +10,7 @@ import UserAvatarSuggestions from './UserAvatarSuggestions'; |
|
|
|
|
|
|
|
|
|
function UserAvatarEditor({ currentUsername, username, setAvatarObj, suggestions, disabled, etag }) { |
|
|
|
|
const t = useTranslation(); |
|
|
|
|
const rotateImages = useSetting('FileUpload_RotateImages'); |
|
|
|
|
const [avatarFromUrl, setAvatarFromUrl] = useState(''); |
|
|
|
|
const [newAvatarSource, setNewAvatarSource] = useState(); |
|
|
|
|
const [urlEmpty, setUrlEmpty] = useState(true); |
|
|
|
|
@ -58,7 +60,17 @@ function UserAvatarEditor({ currentUsername, username, setAvatarObj, suggestions |
|
|
|
|
<Box display='flex' flexDirection='column' fontScale='p2m'> |
|
|
|
|
{t('Profile_picture')} |
|
|
|
|
<Box display='flex' flexDirection='row' mbs='x4'> |
|
|
|
|
<UserAvatar size='x124' url={url} username={currentUsername} etag={etag} style={{ objectFit: 'contain' }} mie='x4' /> |
|
|
|
|
<UserAvatar |
|
|
|
|
size='x124' |
|
|
|
|
url={url} |
|
|
|
|
username={currentUsername} |
|
|
|
|
etag={etag} |
|
|
|
|
style={{ |
|
|
|
|
objectFit: 'contain', |
|
|
|
|
imageOrientation: rotateImages ? 'from-image' : 'none', |
|
|
|
|
}} |
|
|
|
|
mie='x4' |
|
|
|
|
/> |
|
|
|
|
<Box display='flex' flexDirection='column' flexGrow='1' justifyContent='space-between' mis='x4'> |
|
|
|
|
<Box display='flex' flexDirection='row' mbs='none'> |
|
|
|
|
<Margins inline='x4'> |
|
|
|
|
|