Skip to content

Conversation

@jinapurapu
Copy link
Contributor

@jinapurapu jinapurapu commented Sep 13, 2022

Adds show/hide rules toggle to text adjacent to button.
Screen Shot 2022-09-15 at 12 28 34 PM
Screen Shot 2022-09-15 at 12 28 20 PM

reivaj05
reivaj05 previously approved these changes Sep 14, 2022
@kaankabalak
Copy link
Contributor

@jinapurapu, as we already have the same toggle function associated with both spans, we can do something like the following to avoid repetition in our code:

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 651877c3..afcf5ff3 100644
--- a/portal-ui/src/screens/Console/Buckets/ListBuckets/AddBucket/BucketNamingRules.tsx
+++ b/portal-ui/src/screens/Console/Buckets/ListBuckets/AddBucket/BucketNamingRules.tsx
@@ -63,26 +63,15 @@ const BucketNamingRules = ({ errorList }: { errorList: boolean[] }) => {
   return (
     <Fragment>
       <Grid item xs={12}>
-        {showNamingRules ? (
-          <span
-            onClick={() => {
-              toggleNamingRules();
-            }}
-            style={{ color: "#0288D1", textDecoration: "underline" }}
-          >
-            {" "}
-            Hide Bucket Naming Rules{" "}
-          </span>
-        ) : (
-          <span
-            onClick={() => {
-              toggleNamingRules();
-            }}
-            style={{ color: "#0288D1", textDecoration: "underline" }}
-          >
-            View Bucket Naming Rules
-          </span>
-        )}
+        <span
+          onClick={() => {
+            toggleNamingRules();
+          }}
+          style={{ color: "#0288D1", textDecoration: "underline", cursor: "pointer", fontSize: "14px" }}
+        >
+          {showNamingRules ? "Hide" : "View"}
+          {" Bucket Naming Rules"}
+        </span>
         <Button
           variant="text"
           size="small"

@jinapurapu jinapurapu force-pushed the clickable_bucket_rules_text branch from 3a25139 to e256f65 Compare September 15, 2022 19:30
bexsoft
bexsoft previously approved these changes Sep 15, 2022
Copy link
Collaborator

@bexsoft bexsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@bexsoft bexsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bexsoft bexsoft merged commit a77b56b into minio:master Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants