Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5104 Rev 5411
Línea 1... Línea 1...
1
/* eslint-disable camelcase */
1
/* eslint-disable camelcase */
2
import React, { useEffect, useState } from 'react'
2
import React, { useEffect, useState } from 'react'
3
import { useDispatch } from 'react-redux'
3
import { useDispatch, useSelector } from 'react-redux'
4
import { addNotification } from '../../../redux/notification/notification.actions'
4
import { addNotification } from '../../../redux/notification/notification.actions'
5
import { axios } from '../../../utils'
5
import { axios } from '../../../utils'
6
import EmptySection from '../../empty-section/EmptySection'
6
import EmptySection from '../../empty-section/EmptySection'
Línea 7... Línea 7...
7
 
7
 
8
const PeopleYouMayKnow = () => {
8
const PeopleYouMayKnow = () => {
9
  const [peopleYouMayKnow, setPeopleYouMayKnow] = useState([])
9
  const [peopleYouMayKnow, setPeopleYouMayKnow] = useState([])
10
  const [lookMore, setLookMore] = useState(false)
10
  const [lookMore, setLookMore] = useState(false)
-
 
11
  const dispatch = useDispatch()
Línea 11... Línea 12...
11
  const dispatch = useDispatch()
12
  const labels = useSelector(state => state.labels)
12
 
13
 
13
  const handleConnect = (url) => {
14
  const handleConnect = (url) => {
14
    axios.post(url)
15
    axios.post(url)
Línea 50... Línea 51...
50
    }
51
    }
51
    return infoFollows
52
    return infoFollows
52
  }
53
  }
Línea 53... Línea 54...
53
 
54
 
54
  return (
55
  return (
55
    <div className='peopleYouMayKnow'>
56
    <div className='suggests_widget'>
56
      <div className="sd-title d-flex align-items-center justify-content-between">
57
      <div className="suggests_widget-header">
57
        <h3>{`${LABELS.CONNECT_WITH}:`}</h3>
58
        <h3>{`${labels.CONNECT_WITH}:`}</h3>
58
        {peopleYouMayKnow.length >= 4 &&
59
        {peopleYouMayKnow.length >= 4 &&
59
          <label onClick={() => setLookMore(!lookMore)}>
60
          <label onClick={() => setLookMore(!lookMore)}>
60
            {lookMore ? LABELS.VIEW_LESS : LABELS.VIEW_MORE}
61
            {lookMore ? labels.VIEW_LESS : labels.VIEW_MORE}
61
          </label>}
62
          </label>}
62
      </div>
63
      </div>
63
      <div className='suggest-list'>
64
      <div className='suggest-list'>
64
        {peopleYouMayKnow.length
65
        {peopleYouMayKnow.length
Línea 73... Línea 74...
73
              {link_request &&
74
              {link_request &&
74
                <button
75
                <button
75
                  className="btn btn-primary"
76
                  className="btn btn-primary"
76
                  onClick={() => handleConnect(link_request)}
77
                  onClick={() => handleConnect(link_request)}
77
                >
78
                >
78
                  {LABELS.CONNECT}
79
                  {labels.CONNECT}
79
                </button>
80
                </button>
80
              }
81
              }
81
              {link_cancel &&
82
              {link_cancel &&
82
                <button
83
                <button
83
                  className="btn btn-secondary"
84
                  className="btn btn-secondary"
84
                  onClick={() => handleConnect(link_cancel)}
85
                  onClick={() => handleConnect(link_cancel)}
85
                >
86
                >
86
                  {LABELS.CANCEL}
87
                  {labels.CANCEL}
87
                </button>
88
                </button>
88
              }
89
              }
89
            </div>
90
            </div>
90
          )
91
          )
91
          : <EmptySection align='left' message={LABELS.DATATABLE_EMPTY} />
92
          : <EmptySection align='left' message={labels.DATATABLE_EMPTY} />
92
        }
93
        }
93
      </div>
94
      </div>
94
    </div>
95
    </div>
95
  )
96
  )
96
}
97
}