Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 5441 Rev 5851
Línea 3... Línea 3...
3
import { addNotification } from '../../../redux/notification/notification.actions'
3
import { addNotification } from '../../../redux/notification/notification.actions'
4
import Spinner from '../../../shared/loading-spinner/Spinner'
4
import Spinner from '../../../shared/loading-spinner/Spinner'
5
import { axios } from '../../../utils'
5
import { axios } from '../../../utils'
6
import { useSelector } from 'react-redux'
6
import { useSelector } from 'react-redux'
Línea 7... Línea 7...
7
 
7
 
8
const SocialNetworks = () => {
8
const SocialNetworks = ({ moodle, microlearning }) => {
9
  const [loading, setLoading] = useState(false)
9
  const [loading, setLoading] = useState(false)
Línea 10... Línea 10...
10
  const labels = useSelector(state => state.labels)
10
  const labels = useSelector((state) => state.labels)
11
 
11
 
12
  const handleOnRoom = async () => {
12
  const handleOnRoom = async () => {
13
    try {
13
    try {
14
      setLoading(true)
14
      setLoading(true)
15
      const response = await axios.post('/moodle')
15
      const response = await axios.post('/moodle')
16
      if (response.data.success) {
16
      if (response.data.success) {
17
        const form = document.createElement('form')
17
        const form = document.createElement('form')
18
        form.setAttribute('method', 'post')
18
        form.setAttribute('method', 'post')
19
        form.setAttribute('action', response.data.data.url)
19
        form.setAttribute('action', response.data.data.url)
20
        form.setAttribute('target', '_blank')
20
        form.setAttribute('target', '_blank')
21
        Object.keys(response.data.data).forEach(key => {
21
        Object.keys(response.data.data).forEach((key) => {
22
          if (key !== 'url') {
22
          if (key !== 'url') {
23
            const value = response.data.data[key]
23
            const value = response.data.data[key]
24
            const hiddenField = document.createElement('input')
24
            const hiddenField = document.createElement('input')
Línea 33... Línea 33...
33
      }
33
      }
34
    } catch (error) {
34
    } catch (error) {
35
      console.log('>>: error > ', error)
35
      console.log('>>: error > ', error)
36
      addNotification({
36
      addNotification({
37
        style: 'danger',
37
        style: 'danger',
38
        msg: 'Ha ocurrido un error en la comunicacion con ON ROOM'
38
        msg: 'Ha ocurrido un error en la comunicacion con ON ROOM',
39
      })
39
      })
40
    } finally {
40
    } finally {
41
      setLoading(false)
41
      setLoading(false)
42
    }
42
    }
43
  }
43
  }
Línea 44... Línea 44...
44
 
44
 
45
  return (
45
  return (
46
    <div className='app-widget'>
46
    <div className="app-widget">
-
 
47
      {loading && <Spinner />}
47
      {loading && <Spinner />}
48
      <span
-
 
49
        className="d-flex flex-column align-items-center gap-2 cursor-pointer"
-
 
50
        onClick={() => handleOnRoom()}
48
      <span className='d-flex flex-column align-items-center gap-2 cursor-pointer' onClick={() => handleOnRoom()}>
51
      >
49
        <img src="/images/logo-onroom.png" alt="" />
52
        <img src={moodle.image} alt="" />
50
        CESA ON ROOM
53
        {moodle.name}
51
      </span>
54
      </span>
52
      <div className='d-flex align-items-center justify-content-center gap-2'>
55
      <div className="d-flex align-items-center justify-content-center gap-2">
53
        <a
56
        <a
54
          href='https://play.google.com/store/apps/details?id=com.cesams.twogetskills'
57
          href="https://play.google.com/store/apps/details?id=com.cesams.twogetskills"
55
          target="_blank"
58
          target="_blank"
56
          rel="noreferrer"
59
          rel="noreferrer"
57
        >
60
        >
58
          <img src="/images/logo-2getskills-android.jpeg" alt="" />
61
          <img src={microlearning.playStore} alt="" />
59
        </a>
62
        </a>
60
        <a
63
        <a
61
          href='https://apps.apple.com/us/app/2getskills/id1575789638'
64
          href="https://apps.apple.com/us/app/2getskills/id1575789638"
62
          target="_blank"
65
          target="_blank"
63
          rel="noreferrer"
66
          rel="noreferrer"
64
        >
67
        >
65
          <img src="/images/logo-2getskillsa-apple.jpeg" alt="" />
68
          <img src={microlearning.appStore} alt="" />
66
        </a>
69
        </a>
67
      </div>
70
      </div>
68
      <span>{labels.MICRO_LEARNING}</span>
71
      <span>{labels.MICRO_LEARNING}</span>
69
    </div>
72
    </div>