From d061a6f66da9a57ea3f267247313a78dc30bebda Mon Sep 17 00:00:00 2001 From: gaev-art <61547416+gaev-art@users.noreply.github.com> Date: Tue, 11 Jan 2022 14:29:09 +0300 Subject: [PATCH] fixed closing the menu when removing the mouse from the block (#518) --- .../settings-page/settings-page.jsx | 92 ++++++++++--------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/app/javascript/components/settings-page/settings-page.jsx b/app/javascript/components/settings-page/settings-page.jsx index 914ae991..5ce0e1d1 100644 --- a/app/javascript/components/settings-page/settings-page.jsx +++ b/app/javascript/components/settings-page/settings-page.jsx @@ -1,16 +1,16 @@ -import { faEllipsisH, faPlus } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import React, { useRef, useState } from "react"; -import style from "./style.module.css"; +import {faEllipsisH, faPlus} from '@fortawesome/free-solid-svg-icons'; +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; +import React, {useRef, useState} from 'react'; +import style from './style.module.css'; export const SettingsPage = () => { const fileInput = useRef(null); const [isOpenMenu, setIsOpenMenu] = useState(false); const [dataForm, setDataForm] = useState({ - nickName: "", - firstName: "", - lastName: "", - avatar: null, + nickName: '', + firstName: '', + lastName: '', + avatar: null }); const onChangeHandler = (element) => { @@ -18,7 +18,7 @@ export const SettingsPage = () => { const reader = new FileReader(); reader.readAsDataURL(element.target.files[0]); reader.onloadend = () => { - setDataForm({ ...dataForm, avatar: reader.result }); + setDataForm({...dataForm, avatar: reader.result}); }; } }; @@ -34,37 +34,39 @@ export const SettingsPage = () => { {dataForm.avatar ? (