From dacb719bdd96440cb89b322493149ea87b517518 Mon Sep 17 00:00:00 2001 From: ashik-75 Date: Tue, 12 Sep 2023 16:46:28 +0600 Subject: [PATCH 1/3] add svg & qrcode --- .../Layouts/Menu/utils/constants.ts | 12 +++ ui/src/pages/CSS/SvgFormatter/index.tsx | 46 ++++++++++++ ui/src/pages/CSS/SvgFormatter/utils/helper.ts | 35 +++++++++ ui/src/pages/Data/QRcode/QRcode.module.scss | 23 ++++++ ui/src/pages/Data/QRcode/index.tsx | 74 +++++++++++++++++++ ui/src/pages/Data/QRcode/utils/helper.ts | 39 ++++++++++ ui/src/pages/Routes/utils/constant.tsx | 12 +++ ui/src/pages/info/Mimetype/index.tsx | 7 +- .../pages/info/Mimetype/utils/constants.tsx | 5 +- ui/src/pages/pages.ts | 4 + 10 files changed, 250 insertions(+), 7 deletions(-) create mode 100644 ui/src/pages/CSS/SvgFormatter/index.tsx create mode 100644 ui/src/pages/CSS/SvgFormatter/utils/helper.ts create mode 100644 ui/src/pages/Data/QRcode/QRcode.module.scss create mode 100644 ui/src/pages/Data/QRcode/index.tsx create mode 100644 ui/src/pages/Data/QRcode/utils/helper.ts diff --git a/ui/src/components/Layouts/Menu/utils/constants.ts b/ui/src/components/Layouts/Menu/utils/constants.ts index d620e4f3..69d94bf0 100644 --- a/ui/src/components/Layouts/Menu/utils/constants.ts +++ b/ui/src/components/Layouts/Menu/utils/constants.ts @@ -41,6 +41,12 @@ export const MENU_ITEMS = [ icon: "Box", show: IN_DEVELOPMENT, }, + { + name: "Svg Formatter", + url: "/css/svg-formatter", + icon: "Command", + show: IN_DEVELOPMENT, + }, ], }, { @@ -91,6 +97,12 @@ export const MENU_ITEMS = [ icon: "BadgeHelp", show: true, }, + { + name: "QR Code", + url: "/generator/qrcode", + icon: "QrCode", + show: true, + }, { name: "Sorting", url: "/generator/sorting", diff --git a/ui/src/pages/CSS/SvgFormatter/index.tsx b/ui/src/pages/CSS/SvgFormatter/index.tsx new file mode 100644 index 00000000..9cda991e --- /dev/null +++ b/ui/src/pages/CSS/SvgFormatter/index.tsx @@ -0,0 +1,46 @@ +import { Card, Form, Input } from "antd"; +import CodeHighlightWithCopy from "components/General/CodeHighlightWithCopy"; +import PageGrid from "components/Layouts/PageGrid"; +import React, { ChangeEvent, useState } from "react"; +import { combineSVGPaths } from "./utils/helper"; + +const { TextArea } = Input; + +const SvgFormatter: React.FC = () => { + const [value, setValue] = useState(""); + const [combinedSVG, setCombinedSVG] = useState(""); + + const handleChange = (e: ChangeEvent) => { + const newValue = e.target.value; + setValue(newValue); + + const combinedSvgOutput = combineSVGPaths(newValue); + setCombinedSVG(combinedSvgOutput); + }; + return ( + + +
+ +