From 9ef8c589092d68701b69cbd9db0d7479c9c1ec96 Mon Sep 17 00:00:00 2001 From: Ritesh Hiremath Date: Mon, 28 Oct 2024 20:04:55 +0530 Subject: [PATCH] Added some changes to code and guidance page Signed-off-by: Ritesh Hiremath --- .../components/circularprogress/code.js | 69 ++++++++++++++++++- .../components/circularprogress/guidance.js | 16 ++++- 2 files changed, 81 insertions(+), 4 deletions(-) diff --git a/src/sections/Projects/Sistent/components/circularprogress/code.js b/src/sections/Projects/Sistent/components/circularprogress/code.js index 4abbe7c78fec..3abd7d211c4d 100644 --- a/src/sections/Projects/Sistent/components/circularprogress/code.js +++ b/src/sections/Projects/Sistent/components/circularprogress/code.js @@ -4,13 +4,15 @@ import { useLocation } from "@reach/router"; import { SistentThemeProvider, CircularProgress, + Box, } from "@layer5/sistent"; import { Row } from "../../../../../reusecore/Layout"; import { SistentLayout } from "../../sistent-layout"; import { CodeBlock } from "../button/code-block"; import TabButton from "../../../../../reusecore/Button"; import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; - +import WarningIcon from "@mui/icons-material/Warning"; +import ReportIcon from "@mui/icons-material/Report"; const codes = [ ` @@ -44,6 +46,18 @@ const codes = [ `, + ` + import ReportIcon from "@mui/icons-material/Report"; + import WarningIcon from "@mui/icons-material/Warning"; + + + + + + + + + ` ]; @@ -219,6 +233,59 @@ export const CircularprogressCode = () => {
+ + + +

Circular Progress with Centered Icon Overlay Examples

+
+

+ By default, any children nested inside the Circular Progress will be centered, allowing icons or text to overlay seamlessly. +

+ + +

+ + + + + + + + + + + + + + + + + + + + + +
+ +
diff --git a/src/sections/Projects/Sistent/components/circularprogress/guidance.js b/src/sections/Projects/Sistent/components/circularprogress/guidance.js index 7759295f18e8..485612d2ac4f 100644 --- a/src/sections/Projects/Sistent/components/circularprogress/guidance.js +++ b/src/sections/Projects/Sistent/components/circularprogress/guidance.js @@ -7,13 +7,15 @@ import { Row } from "../../../../../reusecore/Layout"; import TabButton from "../../../../../reusecore/Button"; import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; + export const CircularprogressGuidance = () => { const { isDark } = useStyledDarkMode(); const location = useLocation(); const [size, setSize] = useState(40); // default size const [thickness, setThickness] = useState(4); // default thickness - + const maxSize = 80; + const maxThickness = 10; return (
@@ -90,7 +92,11 @@ export const CircularprogressGuidance = () => { label="Increase Size" size="medium" style={{ marginLeft: "20px" }} - onClick={() => setSize(size + 10)} // Increase size on click + onClick={() => { + if (size < maxSize) { + setSize(size + 10); + } + }} /> @@ -111,7 +117,11 @@ export const CircularprogressGuidance = () => { label="Increase Thickness" size="medium" style={{ marginLeft: "20px" }} - onClick={() => setThickness(thickness + 2)} + onClick={() => { + if (thickness < maxThickness) { + setThickness(thickness + 2); + } + }} />