Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 2101 Rev 2610
Línea 23... Línea 23...
23
    const [loading, setLoading] = useState(false);
23
    const [loading, setLoading] = useState(false);
24
    const handleOnRoom = async () => {
24
    const handleOnRoom = async () => {
25
        try {
25
        try {
26
            setLoading(true)
26
            setLoading(true)
27
            const response = await axios.post('/moodle');
27
            const response = await axios.post('/moodle');
28
            if(response.data.success) {
28
            if (response.data.success) {
29
                let form = document.createElement('form');
29
                let form = document.createElement('form');
30
                form.setAttribute('method', 'post');
30
                form.setAttribute('method', 'post');
31
                form.setAttribute('action', response.data.data.url);
31
                form.setAttribute('action', response.data.data.url);
32
                form.setAttribute('target', '_blank');
32
                form.setAttribute('target', '_blank');
33
                Object.keys(response.data.data).forEach(key => {
33
                Object.keys(response.data.data).forEach(key => {
34
                    if(key != 'url') {
34
                    if (key != 'url') {
35
                        const value = response.data.data[key];
35
                        const value = response.data.data[key];
36
                        let hiddenField = document.createElement('input');
36
                        let hiddenField = document.createElement('input');
37
                        hiddenField.setAttribute('type', 'hidden');
37
                        hiddenField.setAttribute('type', 'hidden');
38
                        hiddenField.setAttribute('name', key);
38
                        hiddenField.setAttribute('name', key);
39
                        hiddenField.setAttribute('value', value);
39
                        hiddenField.setAttribute('value', value);
Línea 47... Línea 47...
47
            console.log('>>: error > ', error)
47
            console.log('>>: error > ', error)
48
            addNotification({
48
            addNotification({
49
                style: "danger",
49
                style: "danger",
50
                msg: "Ha ocurrido un error en la comunicacion con ON ROOM",
50
                msg: "Ha ocurrido un error en la comunicacion con ON ROOM",
51
            });
51
            });
52
        }finally{
52
        } finally {
53
            setLoading(false)
53
            setLoading(false)
54
        }
54
        }
55
    }
55
    }
56
  return (
56
    return (
57
    <div className={styles.widget + ' border-gray'}>
57
        <div className={styles.widget + ' border-gray'}>
58
        <div className={styles.widget__app}>
58
            <div className={styles.widget__app}>
59
            <a href="#" onClick={() => handleOnRoom()}>
59
                <a href="#" onClick={() => handleOnRoom()}>
60
                <img
60
                    <img
61
                    className={styles.widget__app__img}
61
                        className={styles.widget__app__img}
62
                    src="/images/logo-onroom.png"
62
                        src="/images/logo-onroom.png"
63
                    alt=""
63
                        alt=""
64
                />
64
                    />
65
            </a>
65
                </a>
66
            <a href="#" onClick={() => handleOnRoom()} className={styles.widget__app__title} title="">
66
                <a href="#" onClick={() => handleOnRoom()} className={styles.widget__app__title} title="">
67
                CESA ON ROOM
67
                    CESA ON ROOM
68
            </a>
68
                </a>
69
        </div>
69
            </div>
70
        <div className={styles.widget__app}>
70
            <div className={styles.widget__app}>
71
            <div className="row">
71
                <div className="row" style={{ gap: '5px' }}>
72
                <div className="col-md col-sm-12 col-12">
72
                    <div className="col-md col-sm-12 col-12">
73
                    <a
73
                        <a
74
                        href='https://play.google.com/store/apps/details?id=com.cesams.twogetskills'
74
                            href='https://play.google.com/store/apps/details?id=com.cesams.twogetskills'
75
                        target="_blank"
75
                            target="_blank"
76
                    >
76
                        >
77
                        <img
77
                            <img
78
                            className={styles.widget__app__img}
78
                                className={styles.widget__app__img}
79
                            src="/images/logo-2getskills-android.jpeg"
79
                                src="/images/logo-2getskills-android.jpeg"
80
                            alt=""
80
                                alt=""
81
                        />
81
                            />
82
                    </a>
82
                        </a>
83
                </div>
83
                    </div>
84
                <div className="col-md col-sm-12 col-12">
84
                    <div className="col-md col-sm-12 col-12">
85
                    <a
85
                        <a
86
                        href='https://apps.apple.com/us/app/2getskills/id1575789638'
86
                            href='https://apps.apple.com/us/app/2getskills/id1575789638'
87
                        target="_blank"
87
                            target="_blank"
88
                    >
88
                        >
89
                        <img
89
                            <img
90
                            className={styles.widget__app__img}
90
                                className={styles.widget__app__img}
91
                            src="/images/logo-2getskillsa-apple.jpeg"
91
                                src="/images/logo-2getskillsa-apple.jpeg"
92
                            alt=""
92
                                alt=""
-
 
93
                            />
93
                        />
94
                        </a>
94
                    </a>
95
                    </div>
95
                </div>
96
                </div>
-
 
97
                <a href="#" className={styles.widget__app__title} title="">
-
 
98
                    Microaprendizaje
-
 
99
                </a>
96
            </div>
100
            </div>
-
 
101
            {loading && (
97
            <a href="#" className={styles.widget__app__title} title="">
102
                <StyledSpinnerContainer>
98
                Microaprendizaje
103
                    <Spinner />
-
 
104
                </StyledSpinnerContainer>
99
            </a>
105
            )}
100
        </div>
106
        </div>
101
        {loading && (
-
 
102
          <StyledSpinnerContainer>
-
 
103
            <Spinner />
-
 
104
          </StyledSpinnerContainer>
-
 
105
        )}
-
 
106
    </div>
-
 
107
  )
107
    )
108
}
108
}