diff --git a/src/common/component/styled/Input.js b/src/common/component/styled/Input.js index a414e6e8..08e0d598 100644 --- a/src/common/component/styled/Input.js +++ b/src/common/component/styled/Input.js @@ -4,6 +4,20 @@ import styled from "styled-components"; const StyledWrapper = styled.div` width: 100%; position: relative; + display: flex; + overflow: hidden; + border-radius: 4px; + border: 1px solid #e5e7eb; + box-shadow: 0px 1px 2px rgba(31, 41, 55, 0.08); + .prefix { + padding: 8px 16px; + font-weight: 400; + font-size: 14px; + line-height: 20px; + color: #9ca3af; + background: #f3f4f6; + border-right: 1px solid #e5e7eb; + } .view { position: absolute; top: 50%; @@ -15,15 +29,18 @@ const StyledWrapper = styled.div` const StyledInput = styled.input` width: 100%; background: #ffffff; - border: 1px solid #e5e7eb; - box-shadow: 0px 1px 2px rgba(31, 41, 55, 0.08); - border-radius: 4px; + font-weight: normal; font-size: 14px; line-height: 20px; color: #333; padding: 8px; outline: none; + &:not(.inner) { + border-radius: 4px; + border: 1px solid #e5e7eb; + box-shadow: 0px 1px 2px rgba(31, 41, 55, 0.08); + } &.higher { padding: 12px 8px; } @@ -51,14 +68,19 @@ const StyledInput = styled.input` } `; -export default function Input({ type = "text", ...rest }) { +export default function Input({ + type = "text", + prefix = "", + className, + ...rest +}) { const [inputType, setInputType] = useState(type); const togglePasswordVisible = () => { setInputType((prev) => (prev == "password" ? "text" : "password")); }; return type == "password" ? ( - - + +
{inputType == "password" ? ( @@ -67,8 +89,13 @@ export default function Input({ type = "text", ...rest }) { )}
+ ) : prefix ? ( + + {prefix} + + ) : ( - + ); }