diff --git a/compass/components/Button.tsx b/compass/components/Button.tsx new file mode 100644 index 0000000..bf6dd55 --- /dev/null +++ b/compass/components/Button.tsx @@ -0,0 +1,24 @@ +import { FunctionComponent, ReactNode } from 'react'; + +type ButtonProps = { + children: ReactNode; + onClick?: () => void; // make the onClick handler optional + type?: "button" | "submit" | "reset"; // specify possible values for type + disabled?: boolean; +}; + +const Button: FunctionComponent = ({ children, type, disabled, onClick }) => { + const buttonClassName = `inline-block rounded border ${disabled ? 'bg-gray-400 text-gray-600 cursor-not-allowed' : 'border-purple-600 bg-purple-600 text-white hover:bg-transparent hover:text-purple-600 focus:outline-none focus:ring active:text-purple-500'} px-12 py-3 text-sm font-semibold`; + return ( + + ); +}; + +export default Button; diff --git a/compass/components/Input.tsx b/compass/components/Input.tsx new file mode 100644 index 0000000..0517a01 --- /dev/null +++ b/compass/components/Input.tsx @@ -0,0 +1,34 @@ +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;