Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 4945 Rev 5070
Línea 1... Línea 1...
1
/* eslint-disable react/prop-types */
1
/* eslint-disable react/prop-types */
2
import React from "react";
2
import React from 'react'
3
import Modal from "react-bootstrap/Modal";
3
import Button from 'react-bootstrap/Button'
4
import Button from "react-bootstrap/Button";
4
import Modal from 'react-bootstrap/Modal'
5
import styled from "styled-components";
5
import styled from 'styled-components'
6
import Spinner from "../loading-spinner/Spinner";
6
import Spinner from '../loading-spinner/Spinner'
7
import "../../css/shared/global.scss";
7
import '../../css/shared/global.scss'
Línea 8... Línea 8...
8
 
8
 
9
const StyledModalBody = styled.div`
9
const StyledModalBody = styled.div`
10
  width: 100%;
10
  width: 100%;
11
  height: 100%;
11
  height: 100%;
12
  display: flex;
12
  display: flex;
13
  justify-content: space-evenly;
13
  justify-content: space-evenly;
14
  align-items: center;
14
  align-items: center;
15
  margin-top: 1rem;
15
  margin-top: 1rem;
Línea 16... Línea 16...
16
`;
16
`
17
 
17
 
18
const StyledModal = styled.div`
18
const StyledModal = styled.div`
19
  .modal {
19
  .modal {
20
    width: 200px;
20
    width: 200px;
Línea 21... Línea 21...
21
  }
21
  }
22
`;
22
`
23
 
23
 
24
const ConfirmModal = (props) => {
24
const ConfirmModal = (props) => {
25
  // props destructuring
25
  // props destructuring
26
  const {
26
  const {
27
    show,
27
    show,
28
    onClose,
28
    onClose,
29
    title = "¿Estás seguro?",
29
    title = '¿Estás seguro?',
30
    loading,
30
    loading,
31
    onAccept,
31
    onAccept,
Línea 32... Línea 32...
32
    message,
32
    message,
33
    acceptLabel = "Enviar",
33
    acceptLabel = 'Enviar'
34
  } = props;
34
  } = props
35
 
35
 
36
  return (
36
  return (
37
    <StyledModal>
37
    <StyledModal>
38
      <Modal
38
      <Modal
39
        size="sm"
39
        size="sm"
40
        show={show}
40
        show={show}
41
        onHide={onClose}
41
        onHide={onClose}
42
        style={{ overflowY: "scroll" }}
42
        style={{ overflowY: 'scroll' }}
43
      >
43
      >
Línea 49... Línea 49...
49
          <StyledModalBody>
49
          <StyledModalBody>
50
            <Button
50
            <Button
51
              size="lg"
51
              size="lg"
52
              onClick={onClose}
52
              onClick={onClose}
53
            >
53
            >
54
              Cancelar
54
              {LABELS.CANCEL}
55
            </Button>
55
            </Button>
56
            <Button size="lg" type="submit" onClick={onAccept}>
56
            <Button size="lg" type="submit" onClick={onAccept}>
57
              {acceptLabel}
57
              {acceptLabel}
58
            </Button>
58
            </Button>
59
          </StyledModalBody>
59
          </StyledModalBody>
Línea 63... Línea 63...
63
            <Spinner />
63
            <Spinner />
64
          </div>
64
          </div>
65
        }
65
        }
66
      </Modal>
66
      </Modal>
67
    </StyledModal>
67
    </StyledModal>
68
  );
68
  )
69
};
69
}
Línea 70... Línea 70...
70
 
70