From 3068c2fab8cb020e7fec424597e032da6ee8df13 Mon Sep 17 00:00:00 2001 From: Justus Onuoha Date: Fri, 17 Jun 2022 14:06:51 +0100 Subject: [PATCH] chore: Extend input component --- src/__tests__/components/input.test.tsx | 4 +- src/components/Input/Input.tsx | 63 +++++++++++++------------ src/theme/Apeswap/index.ts | 3 -- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/__tests__/components/input.test.tsx b/src/__tests__/components/input.test.tsx index bd9c13ab..2cfaefb3 100644 --- a/src/__tests__/components/input.test.tsx +++ b/src/__tests__/components/input.test.tsx @@ -9,10 +9,10 @@ it("renders correctly", () => { expect(asFragment()).toMatchInlineSnapshot(`
diff --git a/src/components/Input/Input.tsx b/src/components/Input/Input.tsx index ae3d687d..bd87fcab 100644 --- a/src/components/Input/Input.tsx +++ b/src/components/Input/Input.tsx @@ -3,39 +3,42 @@ import { Input as ThemeUIInput, Box } from "theme-ui"; import { InputProps, sizes, iconSizes } from "./types"; import { Svg } from "../Svg"; -const Input: React.FC = ({ size = sizes.MD, icon, width, sx, ...props }) => { - return ( - - ( + ({ size = sizes.MD, icon, width = "200px", ...props }, ref) => { + return ( + - {icon && ( - + - - - )} - - ); -}; + /> + {icon && ( + + + + )} + + ); + } +); export default Input; diff --git a/src/theme/Apeswap/index.ts b/src/theme/Apeswap/index.ts index fc961245..daadd338 100644 --- a/src/theme/Apeswap/index.ts +++ b/src/theme/Apeswap/index.ts @@ -92,19 +92,16 @@ const Apeswap: Theme = { background: "white3", borderRadius: 10, height: "32px", - width: "200px", }, md: { background: "white3", borderRadius: 10, height: "36px", - width: "200px", }, lg: { background: "white3", borderRadius: 14, height: "48px", - width: "200px", }, }, textarea: {