From 42087518bad23a3de53bc229075a59143f6d4ce2 Mon Sep 17 00:00:00 2001 From: Yury Molodov Date: Sat, 1 Apr 2023 09:38:18 +0200 Subject: [PATCH] vmui: tips for working with the graph and legend (#4045) * feat: add tips for working with the graph and legend * feat: add the ability to collapse the legend * vmui/docs: add the ability to collapse the legend --------- Co-authored-by: Aliaksandr Valialkin --- .../components/Chart/GraphTips/GraphTips.tsx | 53 +++++++++++++++ .../Chart/GraphTips/contants/tips.tsx | 67 +++++++++++++++++++ .../src/components/Chart/GraphTips/style.scss | 49 ++++++++++++++ .../src/components/Chart/Legend/Legend.tsx | 47 +++++++------ .../src/components/Chart/Legend/style.scss | 1 - .../packages/vmui/src/hooks/useBoolean.ts | 22 ++++++ .../vmui/src/pages/CustomPanel/index.tsx | 16 +++-- .../vmui/src/pages/CustomPanel/style.scss | 6 ++ docs/CHANGELOG.md | 2 + 9 files changed, 237 insertions(+), 26 deletions(-) create mode 100644 app/vmui/packages/vmui/src/components/Chart/GraphTips/GraphTips.tsx create mode 100644 app/vmui/packages/vmui/src/components/Chart/GraphTips/contants/tips.tsx create mode 100644 app/vmui/packages/vmui/src/components/Chart/GraphTips/style.scss create mode 100644 app/vmui/packages/vmui/src/hooks/useBoolean.ts diff --git a/app/vmui/packages/vmui/src/components/Chart/GraphTips/GraphTips.tsx b/app/vmui/packages/vmui/src/components/Chart/GraphTips/GraphTips.tsx new file mode 100644 index 0000000000..6cbb459f24 --- /dev/null +++ b/app/vmui/packages/vmui/src/components/Chart/GraphTips/GraphTips.tsx @@ -0,0 +1,53 @@ +import React, { FC } from "preact/compat"; +import "./style.scss"; +import Button from "../../Main/Button/Button"; +import { TipIcon } from "../../Main/Icons"; +import Tooltip from "../../Main/Tooltip/Tooltip"; +import Modal from "../../Main/Modal/Modal"; +import useBoolean from "../../../hooks/useBoolean"; +import tips from "./contants/tips"; + +const GraphTips: FC = () => { + const { + value: showTips, + setFalse: handleCloseTips, + setTrue: handleOpenTips + } = useBoolean(false); + + return ( + <> + +