From 32068c2df20e1fa40ae26de5c02a39826d9fde17 Mon Sep 17 00:00:00 2001 From: Viren070 Date: Fri, 17 Jan 2025 22:56:18 +0000 Subject: [PATCH] feat: refactor credential input and service input and use different svg for reset icon --- .../src/components/CredentialInput.module.css | 27 ++++++----------- .../src/components/CredentialInput.tsx | 30 +++++++++++++------ .../frontend/src/components/ServiceInput.tsx | 10 ------- 3 files changed, 30 insertions(+), 37 deletions(-) diff --git a/packages/frontend/src/components/CredentialInput.module.css b/packages/frontend/src/components/CredentialInput.module.css index 35186437..68becc4d 100644 --- a/packages/frontend/src/components/CredentialInput.module.css +++ b/packages/frontend/src/components/CredentialInput.module.css @@ -1,35 +1,25 @@ .credentialsInputContainer { - position: relative; display: flex; - align-items: center; } - -.credentialInput { - flex: 1; - padding-right: 40px; /* Space for the reset button */ -} - .resetCredentialButton { - position: absolute; - right: 10px; + margin-top: 5px; + margin-left: 5px; top: 6px; + padding: 0; background-color: transparent; border: none; - color: rgb(104, 104, 104); + color: rgb(255, 255, 255); border-radius: var(--borderRadius); cursor: pointer; - transition: - color 0.3s ease, - transform 0.2s; + transition: transform 0.2s; } .resetCredentialButton:hover { - color: black; - transform: scale(1.2) rotateZ(180deg) translateY(2px); + transform: scale(1.2); } .resetCredentialButton:active { - transform: scale(0.9) rotateZ(180deg) translateY(2px); + transform: scale(0.9); } .showHideButton { @@ -37,11 +27,12 @@ padding-top: 5px; padding-left: 5px; border: none; + transform: scale(1); transition: transform 0.2s; } .showHideButton:hover { - transform: scale(1.1); + transform: scale(1.2); cursor: pointer; } diff --git a/packages/frontend/src/components/CredentialInput.tsx b/packages/frontend/src/components/CredentialInput.tsx index 7597afd8..4aece097 100644 --- a/packages/frontend/src/components/CredentialInput.tsx +++ b/packages/frontend/src/components/CredentialInput.tsx @@ -125,17 +125,29 @@ const CredentialInput: React.FC = ({ onClick={() => setCredential('')} > - - - + + + + {' '} + + {' '} + {' '} + {' '} + {' '} + {' '} diff --git a/packages/frontend/src/components/ServiceInput.tsx b/packages/frontend/src/components/ServiceInput.tsx index 2c21db71..c4cf9f4c 100644 --- a/packages/frontend/src/components/ServiceInput.tsx +++ b/packages/frontend/src/components/ServiceInput.tsx @@ -19,10 +19,6 @@ interface ServiceInputProps { canMoveDown: boolean; } -function isEncrypted(value: string): boolean { - return value.match(/^E-[0-9a-fA-F]{32}-[0-9a-fA-F]+$/) !== null; -} - const ServiceInput: React.FC = ({ serviceName, enabled, @@ -132,12 +128,6 @@ const ServiceInput: React.FC = ({ )} - {field.value && isEncrypted(field.value) && ( - - {'. '}Encrypted. To modify this, please reset the API key - using the button to the right - - )}