diff --git a/compass/app/auth/forgot_password/page.tsx b/compass/app/auth/forgot_password/page.tsx index e12f6b2..3401b20 100644 --- a/compass/app/auth/forgot_password/page.tsx +++ b/compass/app/auth/forgot_password/page.tsx @@ -1,5 +1,5 @@ "use client" -import Button from '@/components/Button49'; +import Button from '@/components/Button'; import Input from '@/components/Input' import InlineLink from '@/components/InlineLink'; import Paper from '@/components/auth/Paper'; @@ -41,10 +41,10 @@ export default function Page() { title="Enter your email address" placeholder="janedoe@gmail.com" value={confirmEmail} - iconKey={'EmailInputIcon'} + icon={'EmailInputIcon'} onChange={(e) => { setconfirmEmail(e.target.value); - setEmailError(''); // Reset the error when the user types + // setEmailError(''); // Reset the error when the user types }}/> {emailError && (

diff --git a/compass/app/auth/newPassword/page.tsx b/compass/app/auth/newPassword/page.tsx index 6b4aaef..96e4603 100644 --- a/compass/app/auth/newPassword/page.tsx +++ b/compass/app/auth/newPassword/page.tsx @@ -2,7 +2,7 @@ "use client"; import { useState, useEffect } from 'react'; import Button from '@/components/Button1'; -import Input from '@/components/Input1'; +import Input from '@/components/Input'; import Paper from '@/components/auth/Paper'; diff --git a/compass/app/page.tsx b/compass/app/page.tsx index 56bb65b..1587bc0 100644 --- a/compass/app/page.tsx +++ b/compass/app/page.tsx @@ -1,7 +1,7 @@ // pages/index.tsx "use client"; -import Button from '@/components/Button49'; +// import Button from '@/components/Button49'; import Button from '@/components/Button1'; import Input from '@/components/Input' import InlineLink from '@/components/InlineLink'; @@ -54,7 +54,7 @@ export default function Page() { />

Login

- +
diff --git a/compass/components/Input.tsx b/compass/components/Input.tsx index 5997296..b74302a 100644 --- a/compass/components/Input.tsx +++ b/compass/components/Input.tsx @@ -1,41 +1,33 @@ -import { Icons } from '@/utils/constants'; -import React, { FunctionComponent, InputHTMLAttributes, ReactElement, ReactNode } from 'react'; +import React, { FunctionComponent, InputHTMLAttributes, ReactNode, ChangeEvent } from 'react'; type InputProps = InputHTMLAttributes & { - iconKey?: keyof typeof Icons; // Use keyof typeof to ensure the key exists in Icons - title?: string; // Assuming title is always a string - type?: string; - placeholder?: string; + icon?: ReactNode; + title?: ReactNode; + type?:ReactNode; + placeholder?:ReactNode + valid?:boolean; + onChange: (event: ChangeEvent) => void; }; -const Input: FunctionComponent = ({ iconKey, type, title, placeholder, ...rest }) => { - const IconComponent = iconKey ? Icons[iconKey] : null; - +const Input: FunctionComponent = ({ icon, type, title, placeholder, onChange, valid = true, ...rest }) => { return ( -
- {title && ( -
- -
- )} -
- {IconComponent && ( - - - - )} - -
-
+
+ +
); }; diff --git a/compass/components/Input1.tsx b/compass/components/Input1.tsx deleted file mode 100644 index 0517a01..0000000 --- a/compass/components/Input1.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import React, { FunctionComponent, InputHTMLAttributes, ReactNode, ChangeEvent } from 'react'; - -type InputProps = InputHTMLAttributes & { - icon?: ReactNode; - title?: ReactNode; - type?:ReactNode; - placeholder?:ReactNode - valid?:boolean; - onChange: (event: ChangeEvent) => void; -}; - -const Input: FunctionComponent = ({ icon, type, title, placeholder, onChange, valid, ...rest }) => { - return ( -
- -
- ); -}; - -export default Input; diff --git a/compass/components/InputOld.tsx b/compass/components/InputOld.tsx new file mode 100644 index 0000000..5997296 --- /dev/null +++ b/compass/components/InputOld.tsx @@ -0,0 +1,42 @@ +import { Icons } from '@/utils/constants'; +import React, { FunctionComponent, InputHTMLAttributes, ReactElement, ReactNode } from 'react'; + +type InputProps = InputHTMLAttributes & { + iconKey?: keyof typeof Icons; // Use keyof typeof to ensure the key exists in Icons + title?: string; // Assuming title is always a string + type?: string; + placeholder?: string; +}; + +const Input: FunctionComponent = ({ iconKey, type, title, placeholder, ...rest }) => { + const IconComponent = iconKey ? Icons[iconKey] : null; + + return ( +
+ {title && ( +
+ +
+ )} +
+ {IconComponent && ( + + + + )} + +
+
+ ); +}; + +export default Input;