Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4791 Rev 4809
Línea 5... Línea 5...
5
import { addNotification } from '../../../redux/notification/notification.actions'
5
import { addNotification } from '../../../redux/notification/notification.actions'
6
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline'
6
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline'
Línea 7... Línea 7...
7
 
7
 
8
const NotificationsOption = ({ addNotification, sessionLink, Icon, title, url, }) => {
8
const NotificationsOption = ({ addNotification, sessionLink, Icon, title, url, }) => {
-
 
9
    const [notifications, setNotifications] = useState([])
9
    const [notifications, setNotifications] = useState([])
10
    const [displayMenu, setDisplayMenu] = useState(false)
10
    const [notificationsCount, setNotificationsCount] = useState(0)
11
    const [notificationsCount, setNotificationsCount] = useState(0)
Línea 11... Línea 12...
11
    const [loading, setLoading] = useState(false);
12
    const [loading, setLoading] = useState(false);
12
 
13
 
Línea 72... Línea 73...
72
                })
73
                })
73
                console.log('>>: err > ', err)
74
                console.log('>>: err > ', err)
74
            })
75
            })
75
    }
76
    }
Línea -... Línea 77...
-
 
77
 
-
 
78
    const handleClick = (e) => {
-
 
79
        if (window.innerWidth > 768) {
-
 
80
            e.preventDefault()
-
 
81
            setDisplayMenu(!displayMenu)
-
 
82
        }
-
 
83
    }
76
 
84
 
77
    return (
85
    return (
78
        <li>
86
        <li>
79
            <a href={url} className="header__option mobile" target='framename' >
87
            <a href={url} className="header__option mobile" target='framename' onClick={handleClick}>
80
                {Icon && <Icon className="header__option-icon" />}
88
                {Icon && <Icon className="header__option-icon" />}
81
                <span>{title}</span>
89
                <span>{title}</span>
82
                <span className={`badge ${notificationsCount ? 'd-block' : 'd-none'}`} style={{ top: '10px' }}>
90
                <span className={`badge ${notificationsCount ? 'd-block' : 'd-none'}`} style={{ top: '10px' }}>
83
                    {notificationsCount}
91
                    {notificationsCount}
84
                </span>
92
                </span>
85
            </a>
93
            </a>
86
            {!!notifications.length &&
94
            {!!notifications.length &&
87
                <nav className='nav__options-dropdown d-none d-md-block' style={{ maxHeight: '300px', overflow: 'auto' }}>
95
                <nav className={`nav__options-dropdown d-none d-md-block ${displayMenu && 'show'}`} style={{ maxHeight: '300px', overflow: 'auto' }}>
88
                    <ul>{notifications.map(({ message, link_mark_read, link, link_delete, time_elapsed }, index) =>
96
                    <ul>{notifications.map(({ message, link_mark_read, link, link_delete, time_elapsed }, index) =>
89
                        <li key={index}>
97
                        <li key={index}>
90
                            <div className="d-flex align-items-center" style={{ gap: '.5rem' }}>
98
                            <div className="d-flex align-items-center" style={{ gap: '.5rem' }}>
91
                                <a
99
                                <a