Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 3177 Rev 3730
Línea -... Línea 1...
-
 
1
/* eslint-disable react/prop-types */
1
import React from "react";
2
import React from "react";
2
import { useState, useEffect } from "react";
3
import { useState, useEffect } from "react";
3
import { Button, Modal } from "react-bootstrap";
4
import { Button, Modal } from "react-bootstrap";
4
import { useForm } from "react-hook-form";
5
import { useForm } from "react-hook-form";
5
import styled from "styled-components";
6
import styled from "styled-components";
6
import { axios } from "../../../../../utils";
7
import { axios } from "../../../../../utils";
7
import Spinner from "../../../../loading-spinner/Spinner";
8
import Spinner from "../../../../loading-spinner/Spinner";
8
import DropzoneComponent from "../../../../dropzone/DropzoneComponent";
9
import DropzoneComponent from "../../../../dropzone/DropzoneComponent";
9
import { profileTypes } from "../../../Profile.types";
10
import { profileTypes } from "../../../Profile.types";
10
import FormErrorFeedback from "../../../../form-error-feedback/FormErrorFeedback";
11
import FormErrorFeedback from "../../../../form-error-feedback/FormErrorFeedback";
-
 
12
import { addNotification } from "../../../../../redux/notification/notification.actions";
Línea 11... Línea 13...
11
 
13
 
12
const StyledSpinnerContainer = styled.div`
14
const StyledSpinnerContainer = styled.div`
13
  position: absolute;
15
  position: absolute;
14
  left: 0;
16
  left: 0;
Línea 20... Línea 22...
20
  justify-content: center;
22
  justify-content: center;
21
  align-items: center;
23
  align-items: center;
22
  z-index: 300;
24
  z-index: 300;
23
`;
25
`;
Línea 24... Línea 26...
24
 
26
 
25
const ProfileImg = (props) => {
-
 
26
  // props destructuring
-
 
27
  const {
27
const ProfileImg = ({
28
    entityId,
28
  entityId = '',
29
    profileId,
29
  profileId = '',
30
    image,
30
  image = '',
31
    imageProfileCover,
31
  imageProfileCover = '',
32
    profileType,
-
 
33
    addNotification,
32
  profileType = ''
Línea 34... Línea -...
34
  } = props;
-
 
35
 
33
}) => {
36
  // react hook form
34
 
37
  const {
35
  const {
38
    register,
36
    register,
39
    errors,
37
    errors,
40
    handleSubmit,
38
    handleSubmit,
41
    setValue,
39
    setValue,
-
 
40
    clearErrors,
42
    clearErrors,
41
    setError,
Línea 43... Línea 42...
43
    setError,
42
    getValues
44
  } = useForm();
43
  } = useForm();
45
 
44
 
Línea 54... Línea 53...
54
            }`,
53
            }`,
55
          uid: Date.now(),
54
          uid: Date.now(),
56
        };
55
        };
57
      case profileTypes.COMPANY:
56
      case profileTypes.COMPANY:
58
        return {
57
        return {
59
          path: `/storage/type/company/code/${entityId}/${image && `filename/${image}`
58
          path: `/storage/type/company/code/${entityId}/${image && `filename/${image}`}`,
60
            }`,
-
 
61
          uid: Date.now(),
59
          uid: Date.now(),
62
        };
60
        }
63
        break;
-
 
64
      default:
61
      default:
65
        break;
62
        break;
66
    }
63
    }
67
  });
64
  });