From a77b56b522fed0463d4b04931f7926cecdc0843c Mon Sep 17 00:00:00 2001 From: jinapurapu <65002498+jinapurapu@users.noreply.github.com> Date: Fri, 16 Sep 2022 11:12:47 -0700 Subject: [PATCH] Toggle Bucket Naming Rules display by clicking text (#2311) --- .../AddBucket/BucketNamingRules.tsx | 163 +++++++++--------- 1 file changed, 82 insertions(+), 81 deletions(-) diff --git a/portal-ui/src/screens/Console/Buckets/ListBuckets/AddBucket/BucketNamingRules.tsx b/portal-ui/src/screens/Console/Buckets/ListBuckets/AddBucket/BucketNamingRules.tsx index 856a3c11d..b6c9c81e3 100644 --- a/portal-ui/src/screens/Console/Buckets/ListBuckets/AddBucket/BucketNamingRules.tsx +++ b/portal-ui/src/screens/Console/Buckets/ListBuckets/AddBucket/BucketNamingRules.tsx @@ -16,12 +16,12 @@ import React, { Fragment, useState } from "react"; import Grid from "@mui/material/Grid"; -import { Button, LinearProgress } from "@mui/material"; +import { LinearProgress } from "@mui/material"; import { AppState } from "../../../../../store"; import { useSelector } from "react-redux"; import ShowTextIcon from "../../../../../icons/ShowTextIcon"; import HideTextIcon from "../../../../../icons/HideTextIcon"; - +import { Button } from "mds"; import ValidRule from "./ValidRule"; import InvalidRule from "./InvalidRule"; import NARule from "./NARule"; @@ -56,88 +56,89 @@ const BucketNamingRules = ({ errorList }: { errorList: boolean[] }) => { uniqueName, ] = errorList; + const toggleNamingRules = () => { + setShowNamingRules(!showNamingRules); + }; + return ( - - {showNamingRules ? ( - - {" "} - Hide Bucket Naming Rules{" "} - - ) : ( - - View Bucket Naming Rules - - )} - - {showNamingRules && ( - - - {bucketName.length === 0 ? ( - - ) : lengthRule ? ( - - ) : ( - - )} - {bucketName.length === 0 ? ( - - ) : validCharacters ? ( - - ) : ( - - )} - {bucketName.length === 0 ? ( - - ) : noAdjacentPeriods ? ( - - ) : ( - - )} - {bucketName.length === 0 ? ( - - ) : notIPFormat ? ( - - ) : ( - - )} - - - {bucketName.length === 0 ? ( - - ) : noPrefix ? ( - - ) : ( - - )} - - {bucketName.length === 0 ? ( - - ) : noSuffix ? ( - - ) : ( - - )} - - {bucketName.length === 0 ? ( - - ) : uniqueName ? ( - - ) : ( - - )} - +