From ba9fc598055b939d912e4b0fef7f6872aeb1ad99 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 21 Jul 2024 01:35:52 -0600 Subject: [PATCH 1/3] refactor(databases): show hide and show icon in enviroment tab --- .../environment/show-mariadb-environment.tsx | 31 +++++++++++++++---- .../environment/show-mongo-environment.tsx | 30 ++++++++++++++---- .../environment/show-mysql-environment.tsx | 30 ++++++++++++++---- .../environment/show-postgres-environment.tsx | 30 ++++++++++++++---- .../environment/show-redis-environment.tsx | 30 ++++++++++++++---- 5 files changed, 121 insertions(+), 30 deletions(-) diff --git a/components/dashboard/mariadb/environment/show-mariadb-environment.tsx b/components/dashboard/mariadb/environment/show-mariadb-environment.tsx index 807dcae0..61f64cd8 100644 --- a/components/dashboard/mariadb/environment/show-mariadb-environment.tsx +++ b/components/dashboard/mariadb/environment/show-mariadb-environment.tsx @@ -14,9 +14,11 @@ import { FormItem, FormMessage, } from "@/components/ui/form"; +import { Toggle } from "@/components/ui/toggle"; import { api } from "@/utils/api"; import { zodResolver } from "@hookform/resolvers/zod"; -import React, { useEffect } from "react"; +import { EyeIcon, EyeOffIcon } from "lucide-react"; +import React, { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; @@ -32,6 +34,7 @@ interface Props { } export const ShowMariadbEnvironment = ({ mariadbId }: Props) => { + const [isEnvVisible, setIsEnvVisible] = useState(true); const { mutateAsync, isLoading } = api.mariadb.saveEnvironment.useMutation(); const { data, refetch } = api.mariadb.one.useQuery( @@ -74,11 +77,26 @@ export const ShowMariadbEnvironment = ({ mariadbId }: Props) => { return (