import { makeStyles } from '@material-ui/core' import { useSelector } from 'react-redux'; import { useState } from 'react'; import { getAuthorizationState } from '../../../../../redux/authorization/selector' import { Carousel } from 'react-responsive-carousel'; import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline'; import Avatar from '@mui/material/Avatar'; import { firstLetter, slicedWord, timeStampEU,prodBaseURL } from '../../../../../helpers' import DeleteModal from './DeleteModal'; const useStyles = makeStyles({ container: { width: '100%', backgroundColor: '#ffffff', position:'relative', }, nameTile: { position:'absolute', color: '#ffffff', backgroundColor: 'rgb(0,0,0)', borderRadius: 10, padding:8, fontSize: 18, zIndex:10, top: '7%', left: '50%', marginLeft: '-45%', opacity: 0.7, transition: 'opacity .35s ease-in-out' }, timeTile: { position:'absolute', color: '#ffffff', backgroundColor: 'rgb(0,0,0)', borderRadius: 10, padding:4, fontSize: 15, top: '1%', left: '50%', marginLeft: '-45%', opacity: 0.7, transition: 'opacity .35s ease-in-out' }, iconDeleteWrapper: { position: 'absolute', top: '1%', right: '9%', }, iconDelete: { '&:hover': { opacity: 1, color: '#fa0000', animation: `$shake 0.5s`, } }, '@keyframes shake': { '0%': { transform: 'translate(0.5px, 0.5px) rotate(0deg)'}, '10%': { transform: 'translate(-0.5px, -1px) rotate(-1deg)'}, '20%': { transform: 'translate(-1.5px, 0px) rotate(1deg)'}, '30%': { transform: 'translate(1.5px, 1px) rotate(0deg)'}, '40%': { transform: 'translate(0.5px, -0.5px) rotate(1deg)'}, '50%': { transform: 'translate(-0.5px, 1px) rotate(-1deg)'}, '60%': { transform: 'translate(-1.5px, 0.5px) rotate(0deg)'}, '70%': { transform: 'translate(1.5px, 0.5px) rotate(-1deg)'}, '80%': { transform: 'translate(-0.5px, -0.5px) rotate(1deg)'}, '90%': { transform: 'translate(0.5px, 1px) rotate(0deg)'}, '100%': { transform: 'translate(0.5px, -1px) rotate(-1deg)'}, }, }) const SettingsPicture = () => { const classes = useStyles() const { name, lastName, avatarsArr, online } = useSelector(getAuthorizationState) const [modal, setModal] = useState(false); const [index, setIndex] = useState(0); const handleClick = (): void => setModal(true) return (
{modal && } setIndex(i)} selectedItem={index}> {avatarsArr.map(({ avatarUrl, updatedAt }) =>
pic

{timeStampEU(updatedAt)}

)}
{`${firstLetter(name)}${slicedWord(name, 15, 1)} ${firstLetter(lastName)}${slicedWord(lastName, 15, 1)}`} {online === 'true' ? 'online' : `last seen ${timeStampEU(online)}`} {avatarsArr.length > 1 &&
}
) } export default SettingsPicture