-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement HSButton implement HSInput mend implement login design resolve eslint errors rebase from develop fix hovering styles button rebase form develop set up formik implement stage 1 of valifation usin formik Reducing boilerplate reduce duplicate codes
- Loading branch information
1 parent
9339be3
commit b0931bf
Showing
9 changed files
with
343 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Link } from 'react-router-dom'; | ||
|
||
interface MyButtonProps { | ||
path?: string; | ||
title: string; | ||
styles?: string; | ||
click?: () => void; | ||
icon?: JSX.Element; | ||
target?: '_blank' | '_self' | '_parent' | '_top'; | ||
onChange?: React.ChangeEventHandler<HTMLAnchorElement>; | ||
} | ||
|
||
function HSButton({ | ||
path, | ||
click, | ||
title, | ||
icon, | ||
styles, | ||
target, | ||
onChange, | ||
}: MyButtonProps) { | ||
return ( | ||
<Link | ||
target={target} | ||
type="submit" | ||
onChange={onChange} | ||
rel="noopener noreferrer" | ||
to={path!} | ||
onClick={click} | ||
className={`${styles} bg-primary text-white px-6 py-3 rounded-md flex justify-center items-center gap-2 text-sm active:scale-[.98] active:duration-75 hover:scale-[1.01] ease-in transition-all`} | ||
> | ||
{title} {icon} | ||
</Link> | ||
); | ||
} | ||
|
||
export default HSButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
interface MyInputProps { | ||
id?: string; | ||
name?: string; | ||
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void; | ||
onBlurTextArea?: (event: React.FocusEvent<HTMLTextAreaElement>) => void; | ||
values?: string | number; | ||
style?: string; | ||
label?: string; | ||
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void; | ||
onChangeTextArea?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void; | ||
placeholder: string; | ||
type?: string; | ||
text?: string; | ||
icon?: JSX.Element; | ||
} | ||
|
||
function HSInput({ | ||
id, | ||
name, | ||
onBlur, | ||
onBlurTextArea, | ||
values, | ||
style, | ||
label, | ||
onChange, | ||
onChangeTextArea, | ||
placeholder, | ||
type, | ||
text, | ||
icon, | ||
}: MyInputProps) { | ||
return ( | ||
<div className="flex flex-col gap-2 w-full group"> | ||
<label htmlFor={id} className="text-md font-medium"> | ||
{label} | ||
</label> | ||
{type === 'input' ? ( | ||
<div | ||
className={`${style} relative bg-grayLight text-black duration-100 outline-none justify-between flex items-center gap-2 px-3 w-full rounded-md font-light group-hover:border-grayDark`} | ||
> | ||
{icon && <p>{icon}</p>} | ||
<input | ||
type={text} | ||
value={values} | ||
onBlur={onBlur} | ||
id={id} | ||
name={name} | ||
onChange={onChange} | ||
placeholder={placeholder} | ||
className="w-full h-full bg-transparent py-3 outline-none" | ||
/> | ||
</div> | ||
) : ( | ||
<textarea | ||
id={id} | ||
name={name} | ||
onBlur={onBlurTextArea} | ||
cols={30} | ||
rows={10} | ||
placeholder={placeholder} | ||
onChange={onChangeTextArea} | ||
value={values} | ||
className="text-black text-xs md:text-sm duration-150 w-full outline-none rounded-md border-[1px] group-hover:border-grayDark px-5 py-3" | ||
> | ||
{values} | ||
</textarea> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
export default HSInput; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap'); | ||
* { | ||
font-family: 'Lexend', sans-serif; | ||
} |
Oops, something went wrong.