diff --git a/frontend/src/app/components/checkbox/CheckBox.jsx b/frontend/src/app/components/checkbox/CheckBox.jsx new file mode 100644 index 0000000..e1a10e6 --- /dev/null +++ b/frontend/src/app/components/checkbox/CheckBox.jsx @@ -0,0 +1,42 @@ +"use client"; +import { useState } from "react"; +import CheckIcon from "../icons/check"; +import styles from "./styles.module.css"; +import CloseIcon from "../icons/close"; +import CheckedIcon from "../icons/switchIcons/checked"; +import UnCheckedIcon from "../icons/switchIcons/unchecked"; + +const CustomCheckbox = ({ checked, onChange, id }) => { + const [isChecked, setIsChecked] = useState(false); + return ( + <> + { + setIsChecked(!isChecked); + onChange; + }} + /> + + + > + ); +}; + +export default CustomCheckbox; diff --git a/frontend/src/app/components/checkbox/styles.module.css b/frontend/src/app/components/checkbox/styles.module.css new file mode 100644 index 0000000..aa0ae6f --- /dev/null +++ b/frontend/src/app/components/checkbox/styles.module.css @@ -0,0 +1,46 @@ +.switch { + display: flex; + width: 53px; + + height: 33px; + align-items: center; + background-color: white; + cursor: pointer; + padding: 0 2px; + border-radius: 150px; + position: relative; + border: 2px solid #6d6d6d; + overflow: hidden; +} + +.check { + display: none; +} + +/* The knob (replaces ::before) */ +.knob { + width: 25px; + height: 25px; + background-color: #6d6d6d; + border-radius: 50%; + display: flex; + justify-content: center; + align-items: center; + + transition: all 0.15s ease-in-out; +} +.knob:hover { + box-shadow: 0 0 0px 5px #33333327; + background-color: #333; +} + +.check:checked + .switch .knob { + transform: translateX(75%); + background-color: white; +} + +/* Optional background change */ +.check:checked + .switch { + background-color: #8187ff; + border: 2px solid #8187ff; +} diff --git a/frontend/src/app/components/icons/switchIcons/checked.jsx b/frontend/src/app/components/icons/switchIcons/checked.jsx new file mode 100644 index 0000000..89629b7 --- /dev/null +++ b/frontend/src/app/components/icons/switchIcons/checked.jsx @@ -0,0 +1,30 @@ +import React from "react"; + +const CheckedIcon = ({ + width = 20, + height = 20, + color = "white", + strokeWidth = 1.5, + ...props +}) => { + return ( + + ); +}; + +export default CheckedIcon; diff --git a/frontend/src/app/components/icons/switchIcons/unchecked.jsx b/frontend/src/app/components/icons/switchIcons/unchecked.jsx new file mode 100644 index 0000000..6bec211 --- /dev/null +++ b/frontend/src/app/components/icons/switchIcons/unchecked.jsx @@ -0,0 +1,39 @@ +import React from "react"; + +const UnCheckedIcon = ({ + width = 20, + height = 20, + color = "white", + strokeWidth = 1.5, + + viewBox = "0 0 28 28", + ...props +}) => { + return ( + + ); +}; + +export default UnCheckedIcon; diff --git a/frontend/src/app/components/topHeader/TopHeader.jsx b/frontend/src/app/components/topHeader/TopHeader.jsx index 0373e35..12a55eb 100644 --- a/frontend/src/app/components/topHeader/TopHeader.jsx +++ b/frontend/src/app/components/topHeader/TopHeader.jsx @@ -65,7 +65,7 @@ const TopHeader = (props) => { {props.state === "add" ? ( <>
{props.buttonText}
Auto Scaling
+Readiness
+Liveness
+