Línea 3... |
Línea 3... |
3 |
import { axios } from '../../../../../utils'
|
3 |
import { axios } from '../../../../../utils'
|
4 |
import { addNotification } from '../../../../../redux/notification/notification.actions'
|
4 |
import { addNotification } from '../../../../../redux/notification/notification.actions'
|
5 |
import Avatar from '../../../../../shared/Avatar/Avatar'
|
5 |
import Avatar from '../../../../../shared/Avatar/Avatar'
|
6 |
import { useDispatch } from 'react-redux'
|
6 |
import { useDispatch } from 'react-redux'
|
7 |
import CoverModal from '../../../../../shared/profile/edit/cover-section/CoverModal'
|
7 |
import CoverModal from '../../../../../shared/profile/edit/cover-section/CoverModal'
|
- |
|
8 |
import ImageModal from '../../../../../shared/profile/edit/profile-info/profile-img/ImageModal'
|
8 |
import { profileTypes } from '../../../../../shared/profile/Profile.types'
|
9 |
import { profileTypes } from '../../../../../shared/profile/Profile.types'
|
9 |
import EditIcon from '@mui/icons-material/EditOutlined'
|
10 |
import EditIcon from '@mui/icons-material/EditOutlined'
|
Línea 10... |
Línea 11... |
10 |
|
11 |
|
11 |
const GroupActions = ({ cover, groupId, name, image, groupType, linkInmail, actionLinks, accessibility, imageProfileCover }) => {
|
12 |
const GroupActions = ({ cover, groupId, name, image, groupType, linkInmail, actionLinks, accessibility, imageProfileCover, imageSizeCover }) => {
|
12 |
const [modalToShow, setModalToShow] = useState(null)
|
13 |
const [modalToShow, setModalToShow] = useState(null)
|
- |
|
14 |
const [coverImg, setCoverImg] = useState({ path: `/storage/type/group-cover/code/${groupId}/${cover ? `filename/${cover}` : ""}` })
|
13 |
const [coverImg, setCoverImg] = useState({ path: `/storage/type/group-cover/code/${groupId}/${cover ? `filename/${cover}` : ""}` })
|
15 |
const [profileImg, setProfileImg] = useState({ path: `/storage/type/group/code/${groupId}/${image ? `filename/${image}` : ""}` })
|
14 |
const dispatch = useDispatch();
|
16 |
const dispatch = useDispatch();
|
Línea 15... |
Línea 17... |
15 |
const PATH = window.location.pathname
|
17 |
const PATH = window.location.pathname
|
Línea 38... |
Línea 40... |
38 |
<EditIcon />
|
40 |
<EditIcon />
|
39 |
</button>
|
41 |
</button>
|
40 |
}
|
42 |
}
|
41 |
</div>
|
43 |
</div>
|
42 |
<div className="group__actions-body">
|
44 |
<div className="group__actions-body">
|
- |
|
45 |
<div onClick={() => PATH.includes('edit') && setModalToShow('image')}>
|
43 |
<Avatar imageUrl={`/storage/type/group/code/${groupId}/${image ? `filename/${image}` : ""}`} size='xl' name={name} />
|
46 |
<Avatar imageUrl={profileImg.path} size='xl' name={name} />
|
- |
|
47 |
</div>
|
44 |
<h1>{name}</h1>
|
48 |
<h1>{name}</h1>
|
45 |
<span>{groupType}</span>
|
49 |
<span>{groupType}</span>
|
46 |
<div className="row" style={{ gap: '.5rem' }}>
|
50 |
<div className="row" style={{ gap: '.5rem' }}>
|
47 |
{linkInmail &&
|
51 |
{linkInmail &&
|
48 |
<a href={linkInmail} className="button btn btn-primary">
|
52 |
<a href={linkInmail} className="button btn btn-primary">
|
Línea 90... |
Línea 94... |
90 |
groupId={groupId}
|
94 |
groupId={groupId}
|
91 |
handleCoverSectionModalOpen={() => closeModal()}
|
95 |
handleCoverSectionModalOpen={() => closeModal()}
|
92 |
imageSizeCover={imageProfileCover}
|
96 |
imageSizeCover={imageProfileCover}
|
93 |
setCoverImg={(newImage) => setCoverImg(newImage)}
|
97 |
setCoverImg={(newImage) => setCoverImg(newImage)}
|
94 |
/>
|
98 |
/>
|
- |
|
99 |
<ImageModal
|
- |
|
100 |
handleModalOpen={() => closeModal()}
|
- |
|
101 |
isModalOpen={modalToShow === 'image'}
|
- |
|
102 |
groupId={groupId}
|
- |
|
103 |
imageProfileCover={imageSizeCover}
|
- |
|
104 |
profileType={profileTypes.USER}
|
- |
|
105 |
setProfileImg={(newImage) => setProfileImg(newImage)}
|
- |
|
106 |
/>
|
95 |
</>
|
107 |
</>
|
96 |
)
|
108 |
)
|
97 |
}
|
109 |
}
|
Línea 98... |
Línea 110... |
98 |
|
110 |
|
99 |
export default GroupActions
|
111 |
export default GroupActions
|