diff --git a/frontend/components/basic/buttons/Button.tsx b/frontend/components/basic/buttons/Button.tsx index f8bd1941d..6501c5244 100644 --- a/frontend/components/basic/buttons/Button.tsx +++ b/frontend/components/basic/buttons/Button.tsx @@ -72,9 +72,10 @@ export default function Button(props: ButtonProps): JSX.Element { // Setting the text color for the text and icon props.color == "mineshaft" && "text-gray-400", - props.color != "mineshaft" && props.color != "red" && "text-black", + props.color != "mineshaft" && props.color != "red" && props.color != "none" && "text-black", props.color == "red" && "text-gray-200", - activityStatus && props.color != "red" ? "group-hover:text-black" : "", + props.color == "none" && "text-gray-200 text-xl", + activityStatus && props.color != "red" && props.color != "none" ? "group-hover:text-black" : "", props.size == "icon" && "flex items-center justify-center" ); diff --git a/frontend/components/dashboard/GenerateSecretMenu.tsx b/frontend/components/dashboard/GenerateSecretMenu.tsx index 1d71749e5..0d1001733 100644 --- a/frontend/components/dashboard/GenerateSecretMenu.tsx +++ b/frontend/components/dashboard/GenerateSecretMenu.tsx @@ -14,7 +14,7 @@ const GenerateSecretMenu = () => { return
-
+
diff --git a/frontend/components/dashboard/SideBar.tsx b/frontend/components/dashboard/SideBar.tsx index 11f756ccb..5e77e7d75 100644 --- a/frontend/components/dashboard/SideBar.tsx +++ b/frontend/components/dashboard/SideBar.tsx @@ -3,29 +3,54 @@ import { faX } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Button from '../basic/buttons/Button'; +import ListBox from '../basic/Listbox'; import Toggle from '../basic/Toggle'; import DashboardInputField from './DashboardInputField'; import GenerateSecretMenu from './GenerateSecretMenu'; + +interface SecretProps { + key: string; + value: string; + pos: number; + visibility: string; +} + +interface SideBarProps { + toggleSidebar: (value: number) => void; + data: SecretProps[]; + modifyKey: (value: string) => void; + modifyValue: (value: string) => void; + modifyVisibility: (value: string) => void; +} + /** + * @param {object} obj + * @param {function} obj.toggleSidebar - function that opens or closes the sidebar + * @param {SecretProps[]} obj.data - data of a certain key valeu pair + * @param {function} obj.modifyKey - function that modifies the secret key + * @param {function} obj.modifyValue - function that modifies the secret value + * @param {function} obj.modifyVisibility - function that modifies the secret visibility * @returns the sidebar with 'secret's settings' */ -const SideBar = () => { - const [overrideEnabled, setOverrideEnabled] = useState(false) +const SideBar = ({ toggleSidebar, data, modifyKey, modifyValue, modifyVisibility }: SideBarProps) => { + const [overrideEnabled, setOverrideEnabled] = useState(false); return

Secret

- +
toggleSidebar(-1)}> + +
-
+

Key

{}} + onChangeHandler={modifyKey} type="varName" - position={1} - value={"KeyKeyKey"} + position={data[0].pos} + value={data[0].key} duplicates={[]} blurred={false} /> @@ -33,14 +58,14 @@ const SideBar = () => {

Value

{}} + onChangeHandler={modifyValue} type="value" - position={1} - value={"ValueValueValue"} + position={data[0].pos} + value={data[0].value} duplicates={[]} blurred={true} /> -
+
@@ -51,9 +76,9 @@ const SideBar = () => {
{}} + onChangeHandler={modifyValue} type="value" - position={1} + position={data[0].pos} value={"ValueValueValue"} duplicates={[]} blurred={true} @@ -62,11 +87,20 @@ const SideBar = () => {
-
-

Comments & notes

-
- Leave your comment here... -
+
+
+

Group

+ {}} + data={["Group1"]} + isFull={true} + /> +
+
+

Comments & notes

+
+ Leave your comment here...
diff --git a/frontend/pages/dashboard/[id].js b/frontend/pages/dashboard/[id].js index db1f4a746..ef4db42bd 100644 --- a/frontend/pages/dashboard/[id].js +++ b/frontend/pages/dashboard/[id].js @@ -56,14 +56,16 @@ const KeyPair = ({ modifyValue, modifyVisibility, isBlurred, - duplicates + duplicates, + toggleSidebar, + sidebarSecretNumber }) => { return ( -
-
+
+
-
+
-
+
toggleSidebar(keyPair.pos)} className="cursor-pointer w-9 h-9 bg-mineshaft-700 hover:bg-chicago-700 rounded-md flex flex-row justify-center items-center duration-200">
-
+
-
+
{data .filter( (keyPair) => @@ -582,6 +590,8 @@ export default function Dashboard() { index !== data?.map((item) => item.key).indexOf(item) )} + toggleSidebar={toggleSidebar} + sidebarSecretNumber={sidebarSecretNumber} /> ))}
@@ -631,6 +641,8 @@ export default function Dashboard() { index !== data?.map((item) => item.key).indexOf(item) )} + toggleSidebar={toggleSidebar} + sidebarSecretNumber={sidebarSecretNumber} /> ))}