Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3585 Rev 3657
Línea 1... Línea 1...
1
import React from 'react';
1
import React from 'react';
2
import { axios } from '../../utils';
2
import { axios } from '../../utils';
3
import { useDispatch } from 'react-redux';
3
import { useDispatch } from 'react-redux';
-
 
4
import { styled, Typography } from '@mui/material';
4
import { addNotification } from '../../redux/notification/notification.actions';
5
import { addNotification } from '../../redux/notification/notification.actions';
5
import styled from 'styled-components';
-
 
Línea 6... Línea 6...
6
 
6
 
Línea 7... Línea 7...
7
import { useFetch } from '@hooks';
7
import { useFetch } from '@hooks';
8
 
8
 
Línea 17... Línea 17...
17
    gap: 0.5rem;
17
    gap: 0.5rem;
18
    margin-top: 0.5rem;
18
    margin-top: 0.5rem;
19
  }
19
  }
20
`;
20
`;
Línea 21... Línea 21...
21
 
21
 
22
const StyledEventContainer = styled.div`
22
const StyledEventContainer = styled('div')(({ theme }) => ({
23
  display: flex;
23
  display: 'flex',
24
  flex-direction: column;
24
  flexDirection: 'column',
25
  cursor: pointer;
25
  cursor: 'pointer',
26
  padding: 0.5rem;
26
  padding: '0.5rem',
27
  border-radius: ${(props) => props.theme.border.radius};
-
 
28
  background-color: ${(props) => props.background || 'transparent'};
-
 
29
  h4 {
-
 
30
    color: ${(props) => props.theme.font.color.title};
-
 
31
  }
-
 
32
  b {
-
 
33
    color: ${(props) => props.theme.font.color.title};
-
 
34
    font-weight: 600;
-
 
35
  }
-
 
36
  span {
-
 
37
    color: ${(props) => props.color || props.theme.font.color.primary};
-
 
38
    font-weight: 400;
-
 
39
  }
27
  borderRadius: theme.shape.borderRadius
Línea 40... Línea 28...
40
`;
28
}));
41
 
29
 
42
const EventsList = () => {
30
const EventsList = () => {
Línea 84... Línea 72...
84
          eventsAndTasks.map(
72
          eventsAndTasks.map(
85
            ({ id, allDay, url, title, backgroundColor, start, end, textColor, source }) => {
73
            ({ id, allDay, url, title, backgroundColor, start, end, textColor, source }) => {
86
              return (
74
              return (
87
                <li key={id}>
75
                <li key={id}>
88
                  <StyledEventContainer
76
                  <StyledEventContainer
89
                    color={textColor}
77
                    sx={{
90
                    background={backgroundColor}
78
                      backgroundColor,
-
 
79
                      color: textColor
-
 
80
                    }}
91
                    onClick={() =>
81
                    onClick={() =>
92
                      source === 'external' ? window.open(url, '_blank') : getAdminAuth(url)
82
                      source === 'external' ? window.open(url, '_blank') : getAdminAuth(url)
93
                    }
83
                    }
94
                  >
84
                  >
95
                    <h4>
85
                    <Typography variant='h4'>
96
                      <b>Evento: </b>
86
                      <b>Evento: </b>
97
                      {title}
87
                      {title}
98
                    </h4>
88
                    </Typography>
99
                    <span>
89
                    <Typography variant='h4'>
100
                      <b>Inicio: </b>
90
                      <b>Inicio: </b>
101
                      {formatDate(start, allDay)}
91
                      {formatDate(start, allDay)}
102
                    </span>
92
                    </Typography>
103
                    {end && (
93
                    {end && (
104
                      <span>
94
                      <Typography variant='h4'>
105
                        <b>Fin: </b>
95
                        <b>Fin: </b>
106
                        {formatDate(end, allDay)}
96
                        {formatDate(end, allDay)}
107
                      </span>
97
                      </Typography>
108
                    )}
98
                    )}
-
 
99
                    <Typography variant='h4'>
-
 
100
                      <b>Tipo: </b>
-
 
101
                      {source === 'external' ? 'Externo' : 'Interno'}
-
 
102
                    </Typography>
109
                  </StyledEventContainer>
103
                  </StyledEventContainer>
110
                </li>
104
                </li>
111
              );
105
              );
112
            }
106
            }
113
          )
107
          )