import React, { useCallback, useState, useEffect } from "react"; import FloatingLabel from "react-bootstrap/FloatingLabel"; import Form from "react-bootstrap/Form"; import Button from "react-bootstrap/esm/Button"; import { useDropzone } from "react-dropzone"; import { Link } from "react-router-dom"; import { CMyAvatar } from "../components/Avatar"; import { actionSetUserInfo } from "../actions"; import { connect } from "react-redux"; const ProfilePage = ({ myProfile, onChanges }) => { const [login, setLogin] = useState(myProfile.login); const [nick, setNick] = useState(myProfile.nick); const [img, setImg] = useState(null); console.log(img) const { getRootProps, getInputProps, isDragActive } = useDropzone({ accept: "image/*", maxFiles: 1, onDrop: (acceptedFiles) => { setImg(acceptedFiles[0]); }, }); return (

My profile

{isDragActive ? (

Drop the files here ...

) : ( )}
{ setLogin(e.target.value); }} />
{ setNick(e.target.value); }} />
Сhange password
); }; export const CProfilePage = connect( (state) => ({ myProfile: state.promise?.myProfile?.payload || {}, }), { onChanges: actionSetUserInfo } )(ProfilePage);