Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1318 Rev 2468
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { useState } from 'react';
2
import { useState } from 'react';
3
import { useLayoutEffect } from 'react';
3
import { useLayoutEffect } from 'react';
-
 
4
import ProfileInfo from '../dashboard/components/home-section/ProfileInfo';
-
 
5
import SocialNetworks from '../dashboard/components/home-section/SocialNetworks';
4
import { axios } from '../utils';
6
import { axios } from '../utils';
Línea 5... Línea 7...
5
 
7
 
-
 
8
export default ({ image, fullName, country, visits, connections, description }) => {
6
export default () => {
9
 
-
 
10
  const [notifications, setNotifications] = useState([]);
7
  const [notifications, setNotifications] = useState([]);
11
 
8
  const handleNotifications = async () => {
12
  const handleNotifications = async () => {
9
    try {
-
 
10
      console.log('>>: _notifications ', notifications)
13
    try {
11
      const _notifications = await axios.get('/notifications');
14
      const _notifications = await axios.get('/notifications');
-
 
15
      setNotifications(_notifications.data.data)
12
      setNotifications(_notifications.data.data)
16
      console.log('>>: _notifications ', notifications)
13
    } catch (error) {
17
    } catch (error) {
14
      console.log('>>: error > ', error)
18
      console.log('>>: error > ', error)
15
    }
19
    }
-
 
20
  }
16
  }
21
 
17
  useLayoutEffect(() => {
22
  useLayoutEffect(() => {
18
    handleNotifications();
23
    handleNotifications();
-
 
24
  }, []);
19
  }, []);
25
 
20
  return (
26
  return (
21
    <section className="notifications-page">
27
    <section className="notifications-page">
-
 
28
      <div className="card notifications-grid">
-
 
29
        <div className='main-left-sidebar'>
-
 
30
          <ProfileInfo
-
 
31
            image={image}
-
 
32
            fullName={fullName}
-
 
33
            description={description}
-
 
34
            visits={visits}
-
 
35
            country={country}
-
 
36
            connections={connections}
-
 
37
          />
-
 
38
          <SocialNetworks />
22
      <div className="card">
39
        </div>
23
        <div className="card-body">
40
        <div className="card-body">
24
          <div className="container">
41
          <div className="container">
25
          <h2 className="card-title" style={{
42
            <h2 className="card-title" style={{
26
            fontSize: '1.7rem'
43
              fontSize: '1.7rem'
27
          }}>Notificaciones</h2>
44
            }}>Notificaciones</h2>
28
            <div className="messages-sec">
45
            <div className="messages-sec">
29
              <table className="table table-striped">
46
              <table className="table table-striped">
30
                <tbody>
47
                <tbody>
31
                  {
48
                  {
32
                    !!notifications.length && (
49
                    !!notifications.length && (
33
                      notifications.map((element, i) => {
50
                      notifications.map((element, i) => {
34
                        return(
51
                        return (
35
                          <tr key={i.toString()}>
52
                          <tr key={i.toString()}>
36
                            <td>
53
                            <td>
37
                              <div
54
                              <div
38
                                className="row w-100"
55
                                className="row w-100"
Línea 60... Línea 77...
60
              </table>
77
              </table>
61
            </div>
78
            </div>
62
          </div>
79
          </div>
63
        </div>
80
        </div>
64
      </div>
81
      </div>
65
    </section>
82
    </section >
66
  )
83
  )
67
}
84
}