Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 1507 Rev 2137
Línea 1... Línea 1...
1
import React, { useState, useLayoutEffect, useEffect } from 'react'
1
import React, { useState, useLayoutEffect, useEffect } from 'react'
2
import { useDispatch } from 'react-redux'
2
import { useDispatch } from 'react-redux'
3
import { Link } from 'react-router-dom'
-
 
4
import { Container, Grid, IconButton } from '@mui/material'
3
import { Container, Grid } from '@mui/material'
5
import DeleteOutline from '@mui/icons-material/DeleteOutline'
-
 
6
import styled from 'styled-components'
4
import styled from 'styled-components'
Línea 7... Línea 5...
7
 
5
 
8
import { axios } from '../../utils'
6
import { axios } from '../../utils'
9
import { getBackendVars } from '../../services/backendVars'
7
import { getBackendVars } from '../../services/backendVars'
Línea 12... Línea 10...
12
import Options from '../../components/UI/Option'
10
import Options from '../../components/UI/Option'
13
import ConfirmModal from '../../components/modals/ConfirmModal'
11
import ConfirmModal from '../../components/modals/ConfirmModal'
14
import EmptySection from '../../components/UI/EmptySection'
12
import EmptySection from '../../components/UI/EmptySection'
15
import ProfileInfo from '../../components/widgets/default/ProfileWidget'
13
import ProfileInfo from '../../components/widgets/default/ProfileWidget'
16
import WidgetWrapper from '../../components/widgets/WidgetLayout'
14
import WidgetWrapper from '../../components/widgets/WidgetLayout'
17
import Paraphrase from '../../components/UI/Paraphrase'
-
 
Línea 18... Línea 15...
18
 
15
 
19
const StyledNotificationList = styled(WidgetWrapper.Body)`
16
const StyledNotificationList = styled(WidgetWrapper.Body)`
20
  max-height: 60vh;
17
  max-height: 60vh;
21
  overflow: auto;
18
  overflow: auto;
Línea 22... Línea -...
22
`
-
 
23
 
-
 
24
const StyledNotificationItem = styled.div`
-
 
25
  position: relative;
-
 
26
  display: flex;
-
 
27
  flex-direction: column;
-
 
28
  margin-bottom: 0.5rem;
-
 
29
  p {
-
 
30
    margin-bottom: 0;
-
 
31
  }
-
 
32
`
-
 
33
 
-
 
34
const StyledActionButton = styled(IconButton)`
-
 
35
  position: absolute !important;
-
 
36
  right: 0.5rem;
-
 
37
  top: 50%;
-
 
38
  transform: translateY(-50%);
-
 
39
`
19
`
40
 
20
 
41
const NotificationsPage = () => {
21
const NotificationsPage = () => {
42
  const [userInfo, setuserInfo] = useState({})
22
  const [userInfo, setuserInfo] = useState({})
43
  const [notifications, setNotifications] = useState([])
23
  const [notifications, setNotifications] = useState([])
Línea 207... Línea 187...
207
      />
187
      />
208
    </>
188
    </>
209
  )
189
  )
210
}
190
}
Línea 211... Línea -...
211
 
-
 
212
const Item = ({ link_delete, link, message, time_elapsed, onDelete }) => {
-
 
213
  return (
-
 
214
    <StyledNotificationItem>
-
 
215
      <Link to={link}>
-
 
216
        <Paraphrase>{message}</Paraphrase>
-
 
217
      </Link>
-
 
218
      <span>{time_elapsed}</span>
-
 
219
 
-
 
220
      <StyledActionButton onClick={() => onDelete(link_delete)}>
-
 
221
        <DeleteOutline />
-
 
222
      </StyledActionButton>
-
 
223
    </StyledNotificationItem>
-
 
224
  )
-
 
225
}
-
 
226
 
-
 
227
NotificationsPage.Item = Item
-
 
228
 
191