|
@@ -5,7 +5,8 @@ import { getAuthorizationState } from '../../../../../redux/authorization/select
|
|
|
import { Carousel } from 'react-responsive-carousel';
|
|
|
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
|
|
import Avatar from '@mui/material/Avatar';
|
|
|
-import { firstLetter, slicedWord, timeStampEU,prodAwsS3 } from '../../../../../helpers'
|
|
|
+import { firstLetter, slicedWord, timeStampEU, prodAwsS3 } from '../../../../../helpers'
|
|
|
+import transparentPic from './../../../../../img/transparentPic.png'
|
|
|
import DeleteModal from './DeleteModal';
|
|
|
|
|
|
|
|
@@ -15,7 +16,7 @@ const useStyles = makeStyles({
|
|
|
backgroundColor: '#ffffff',
|
|
|
position:'relative',
|
|
|
},
|
|
|
- nameTile: {
|
|
|
+ nameTitle: {
|
|
|
position:'absolute',
|
|
|
color: '#ffffff',
|
|
|
backgroundColor: 'rgb(0,0,0)',
|
|
@@ -23,13 +24,13 @@ const useStyles = makeStyles({
|
|
|
padding:8,
|
|
|
fontSize: 18,
|
|
|
zIndex:10,
|
|
|
- top: '7%',
|
|
|
+ top: '6%',
|
|
|
left: '50%',
|
|
|
marginLeft: '-45%',
|
|
|
opacity: 0.7,
|
|
|
transition: 'opacity .35s ease-in-out'
|
|
|
},
|
|
|
- timeTile: {
|
|
|
+ timeTitle: {
|
|
|
position:'absolute',
|
|
|
color: '#ffffff',
|
|
|
backgroundColor: 'rgb(0,0,0)',
|
|
@@ -42,6 +43,33 @@ const useStyles = makeStyles({
|
|
|
opacity: 0.7,
|
|
|
transition: 'opacity .35s ease-in-out'
|
|
|
},
|
|
|
+ countryTitle: {
|
|
|
+ position:'absolute',
|
|
|
+ color: '#ffffff',
|
|
|
+ backgroundColor: 'rgb(0,0,0)',
|
|
|
+ borderRadius: 10,
|
|
|
+ padding:4,
|
|
|
+ fontSize: 15,
|
|
|
+ top: '13%',
|
|
|
+ left: '50%',
|
|
|
+ marginLeft: '-45%',
|
|
|
+ opacity: 0.7,
|
|
|
+ transition: 'opacity .35s ease-in-out'
|
|
|
+ },
|
|
|
+ credentialsTitle: {
|
|
|
+ position:'absolute',
|
|
|
+ color: '#ffffff',
|
|
|
+ fontSize: 100,
|
|
|
+ top: '30%',
|
|
|
+ left: '38%',
|
|
|
+ },
|
|
|
+ credentialsLowTitle: {
|
|
|
+ position:'absolute',
|
|
|
+ color: '#ffffff',
|
|
|
+ fontSize: 25,
|
|
|
+ top: '90%',
|
|
|
+ left: '9%',
|
|
|
+ },
|
|
|
iconDeleteWrapper: {
|
|
|
position: 'absolute',
|
|
|
top: '1%',
|
|
@@ -71,26 +99,39 @@ const useStyles = makeStyles({
|
|
|
|
|
|
const SettingsPicture = () => {
|
|
|
const classes = useStyles()
|
|
|
- const { name, lastName, avatarsArr, online } = useSelector(getAuthorizationState)
|
|
|
+ const { name, lastName, avatarsArr, online,createdAt,color,country } = useSelector(getAuthorizationState)
|
|
|
const [modal, setModal] = useState<boolean>(false);
|
|
|
const [index, setIndex] = useState<number>(0);
|
|
|
const handleClick = (): void => setModal(true)
|
|
|
+ const isDefault = avatarsArr.length === 0 ? false: true
|
|
|
|
|
|
return (
|
|
|
<div className={classes.container}>
|
|
|
{modal &&
|
|
|
<DeleteModal setModal={setModal} index={index} setIndex={setIndex}/>}
|
|
|
<Carousel onChange={(i)=> setIndex(i)} selectedItem={index}>
|
|
|
- {avatarsArr.map(({ avatarUrl, updatedAt }) =>
|
|
|
+ {isDefault ?
|
|
|
+ avatarsArr.map(({ avatarUrl, updatedAt }) =>
|
|
|
<div key={avatarUrl}>
|
|
|
<img alt='pic' src={`${prodAwsS3}/${avatarUrl}`}/>
|
|
|
<p className="legend">{timeStampEU(updatedAt)}</p>
|
|
|
- </div>)}
|
|
|
+ </div>) :
|
|
|
+ [
|
|
|
+ <div>
|
|
|
+ <img alt='transparentPic' src={transparentPic}
|
|
|
+ style={{ backgroundColor: color }} />
|
|
|
+ <p className="legend">{timeStampEU(createdAt)}</p>
|
|
|
+ </div>
|
|
|
+ ]
|
|
|
+ }
|
|
|
</Carousel>
|
|
|
- <span className={classes.nameTile}>{`${firstLetter(name)}${slicedWord(name, 15, 1)}
|
|
|
+ <span className={classes.nameTitle}>{`${firstLetter(name)}${slicedWord(name, 15, 1)}
|
|
|
${firstLetter(lastName)}${slicedWord(lastName, 15, 1)}`}</span>
|
|
|
- <span className={classes.timeTile}>{online === 'true' ? 'online' : `last seen ${timeStampEU(online)}`}</span>
|
|
|
- {avatarsArr.length > 1 &&
|
|
|
+ <span className={classes.timeTitle}>{online === 'true' ? 'online' : `last seen ${timeStampEU(online)}`}</span>
|
|
|
+ <span className={classes.countryTitle}>{country}</span>
|
|
|
+ {!isDefault&&<span className={classes.credentialsTitle}>{`${firstLetter(name)}${firstLetter(lastName)}`}</span>}
|
|
|
+ {!isDefault&&<span className={classes.credentialsLowTitle}>{`${firstLetter(name)}${firstLetter(lastName)}`}</span>}
|
|
|
+ {avatarsArr.length > 0 &&
|
|
|
<div className={classes.iconDeleteWrapper}>
|
|
|
<Avatar className={classes.iconDelete} onClick={handleClick}
|
|
|
sx={{width: 36, height: 36, backgroundColor: 'rgb(0,0,0)',
|