Web:Client:Fix event handler functions.

This commit is contained in:
Vlada Gazizova 2022-11-21 18:34:19 +03:00
parent 891d6f7f71
commit 54dbeb7f73

View File

@ -158,13 +158,8 @@ const Appearance = (props) => {
const standard = document.querySelector(".standard");
const custom = document.querySelector(".custom");
standard?.addEventListener("mouseover", (e) => {
onColorCheckImgHover(e.target.id);
});
custom?.addEventListener("mouseover", (e) => {
onColorCheckImgHover(e.target.id);
});
standard?.addEventListener("mouseover", onColorCheckImgHover);
custom?.addEventListener("mouseover", onColorCheckImgHover);
return () => {
window.removeEventListener("resize", onCheckView);
@ -230,7 +225,8 @@ const Appearance = (props) => {
]);
const onColorCheckImgHover = useCallback(
(id) => {
(e) => {
const id = e.target.id;
if (!id) return;
const colorCheckImg = appearanceTheme.find((theme) => theme.id == id).text