Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 583 | Rev 598 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 583 Rev 597
Línea 4... Línea 4...
4
import { addNotification } from 'store/notification/notification.actions'
4
import { addNotification } from 'store/notification/notification.actions'
5
import { useDispatch, useSelector } from 'react-redux'
5
import { useDispatch, useSelector } from 'react-redux'
6
import styled from 'styled-components'
6
import styled from 'styled-components'
Línea 7... Línea 7...
7
 
7
 
-
 
8
import Spinner from '../UI/Spinner'
8
import Spinner from '../UI/Spinner'
9
import StyledContainer from '../widgets/WidgetLayout'
Línea 9... Línea 10...
9
import ConfirmationBox from '../UI/ConfirmBox'
10
import ConfirmModal from '../modals/ConfirmModal'
Línea 10... Línea 11...
10
 
11
 
11
import styles from './ProfileItem.module.scss'
12
import styles from './ProfileItem.module.scss'
Línea 17... Línea 18...
17
  width: 100%;
18
  width: 100%;
18
  height: 100%;
19
  height: 100%;
19
  background: rgba(255, 255, 255, 0.4);
20
  background: rgba(255, 255, 255, 0.4);
20
  place-items: center;
21
  place-items: center;
21
  z-index: 50;
22
  z-index: 50;
22
  .titulo {
-
 
23
    color: #1b273e !important;
-
 
24
  }
-
 
25
`
23
`
26
const ProfileItem = ({
24
const ProfileItem = ({
27
  image,
25
  image,
28
  name,
26
  name,
29
  email,
27
  email,
Línea 174... Línea 172...
174
    { label: btnLeaveTitle, url: link_leave, color: 'tertiary' },
172
    { label: btnLeaveTitle, url: link_leave, color: 'tertiary' },
175
    { label: 'Personificar', url: link_impersonate, color: 'tertiary' },
173
    { label: 'Personificar', url: link_impersonate, color: 'tertiary' },
176
  ]
174
  ]
Línea 177... Línea 175...
177
 
175
 
-
 
176
  return (
178
  return (
177
    <>
179
    <div className={styles.profile_item}>
178
      <StyledContainer>
180
      <div className={styles.profile_item_header}>
179
        <div className={styles.profile_item_header}>
181
        {image && <img src={image} alt="group image" />}
180
          {image && <img src={image} alt="group image" />}
182
        <div className={styles.profile_item_header_info}>
181
          <div className={styles.profile_item_header_info}>
183
          <h3 className="titulo">{name}</h3>
182
            <h3 className="titulo">{name}</h3>
184
 
183
 
185
          {isTopData && email && <h4>{email}</h4>}
184
            {isTopData && email && <h4>{email}</h4>}
186
          {network && <h4>{network}</h4>}
185
            {network && <h4>{network}</h4>}
187
          {status && <h4>{status}</h4>}
186
            {status && <h4>{status}</h4>}
188
          {isTopData && (
187
            {isTopData && (
189
            <ul>
188
              <ul>
190
              {link_view && (
189
                {link_view && (
191
                <li>
190
                  <li>
192
                  <Link
191
                    <Link
193
                    to={link_view}
192
                      to={link_view}
194
                    data-link={link_view}
193
                      data-link={link_view}
195
                    className="btn btn-secondary ellipsis"
194
                      className="btn btn-secondary ellipsis"
196
                  >
195
                    >
197
                    {btnAcceptTitle}
196
                      {btnAcceptTitle}
198
                  </Link>
197
                    </Link>
199
                </li>
198
                  </li>
200
              )}
199
                )}
201
              {link_inmail && (
200
                {link_inmail && (
202
                <li>
201
                  <li>
203
                  <Link
202
                    <Link
204
                    to={link_inmail}
203
                      to={link_inmail}
205
                    data-link={link_inmail}
204
                      data-link={link_inmail}
206
                    className="btn "
205
                      className="btn "
207
                  >
206
                    >
208
                    {labels.message}
207
                      {labels.message}
209
                  </Link>
208
                    </Link>
210
                </li>
209
                  </li>
211
              )}
210
                )}
212
            </ul>
211
              </ul>
-
 
212
            )}
213
          )}
213
          </div>
214
        </div>
-
 
215
      </div>
-
 
216
      <div><hr /></div>
214
        </div>
217
      <ul className="position-relative">
215
        <StyledContainer.Actions>
218
        {linksOptions.map((option) => {
216
          {linksOptions.map(({ label, url }) => {
219
          const breakOptions = [link_view, link_edit, link_inmail]
217
            const breakOptions = [link_view, link_edit, link_inmail]
220
 
218
 
221
          if (!option.url) {
219
            if (!url) {
222
            return null
220
              return null
223
          }
221
            }
224
 
222
 
225
          if (option.url === link_view && isTopData) {
223
            if (url === link_view && isTopData) {
226
            return null
224
              return null
227
          }
225
            }
228
 
226
 
229
          if (option.url === link_inmail && isTopData) {
227
            if (url === link_inmail && isTopData) {
230
            return null
228
              return null
Línea 231... Línea 229...
231
          }
229
            }
232
 
-
 
233
          return (
230
 
-
 
231
            return (
234
            <li key={option.label}>
232
              <Link
235
              <Link
233
                key={url}
236
                to={option.url}
234
                to={url}
237
                title={option.label}
235
                title={label}
238
                className="position-relative"
236
                className="position-relative"
239
                onClick={(e) => {
237
                onClick={(e) => {
240
                  if (option.url === link_unfollow) {
238
                  if (url === link_unfollow) {
241
                    e.preventDefault()
239
                    e.preventDefault()
242
                    handleUnfollow(option.url)
240
                    handleUnfollow(url)
Línea 243... Línea 241...
243
                    return
241
                    return
244
                  }
242
                  }
245
 
243
 
246
                  if (option.url === link_admin) {
244
                  if (url === link_admin) {
247
                    e.preventDefault()
245
                    e.preventDefault()
Línea 248... Línea 246...
248
                    getManageUrl()
246
                    getManageUrl()
249
                    return
247
                    return
250
                  }
248
                  }
251
 
249
 
252
                  if (option.url === link_impersonate) {
250
                  if (url === link_impersonate) {
Línea 253... Línea 251...
253
                    e.preventDefault()
251
                    e.preventDefault()
254
                    getImpersonateUrl(option.url)
252
                    getImpersonateUrl(url)
255
                    return
253
                    return
256
                  }
254
                  }
257
 
255
 
258
                  if (!breakOptions.includes(option.url)) {
256
                  if (!breakOptions.includes(url)) {
259
                    e.preventDefault()
257
                    e.preventDefault()
260
                    showConfirm(option.url)
258
                    showConfirm(url)
261
                  }
259
                  }
262
                }}
260
                }}
263
              >
261
              >
264
                <button className={`btn `}>{option.label}</button>
262
                <button className={`btn `}>{label}</button>
265
              </Link>
263
              </Link>
266
            </li>
264
            )
267
          )
265
          })}
268
        })}
266
        </StyledContainer.Actions>
269
        <ConfirmationBox
267
        {loading && (
270
          show={isShowConfirmation}
-
 
271
          onClose={() => closeConfirm()}
268
          <StyledSpinnerContainer>
272
          onAccept={() => onConfirm(confirmUrl.current)}
269
            <Spinner />
273
        />
270
          </StyledSpinnerContainer>
274
      </ul>
271
        )}
275
 
272
      </StyledContainer>
276
      {loading && (
273
      <ConfirmModal
277
        <StyledSpinnerContainer>
274
        show={isShowConfirmation}
278
          <Spinner />
275
        onClose={() => closeConfirm()}
Línea 279... Línea 276...
279
        </StyledSpinnerContainer>
276
        onAccept={() => onConfirm(confirmUrl.current)}