-
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.
- Loading branch information
1 parent
0ed6379
commit 5f7ac9e
Showing
8 changed files
with
242 additions
and
134 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
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
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,11 +1,14 @@ | ||
import Input from "@/common/Input.jsx"; | ||
|
||
function InputWithTimer({text, setText, timer, ...otherProps}) | ||
{ | ||
return <div className="w-full flex items-center relative"> | ||
<Input text={text} setText={setText} {...otherProps}/> | ||
<span className="absolute text-body-s text-red-400 font-bold right-4">5:00</span> | ||
</div> | ||
function InputWithTimer({ text, setText, timer, ...otherProps }) { | ||
return ( | ||
<div className="w-full flex items-center relative"> | ||
<Input text={text} setText={setText} {...otherProps} /> | ||
<span className="absolute text-body-s text-red-400 font-bold right-4"> | ||
{timer} | ||
</span> | ||
</div> | ||
); | ||
} | ||
|
||
export default InputWithTimer; | ||
export default InputWithTimer; |
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 |
---|---|---|
@@ -1,20 +1,33 @@ | ||
function Button({styleType, children, type="button", className, ...otherProps}) | ||
{ | ||
const isSubmit = !(type === "reset" || type === "button"); | ||
function Button({ | ||
styleType, | ||
children, | ||
type = "button", | ||
className, | ||
...otherProps | ||
}) { | ||
const isSubmit = !(type === "reset" || type === "button"); | ||
|
||
const filledStyle = `bg-black text-white active:bg-neutral-700 active:text-neutral-200 | ||
const filledStyle = `bg-black text-white active:bg-neutral-700 active:text-neutral-200 | ||
hover:bg-neutral-700 disabled:bg-neutral-600 disabled:text-neutral-400 | ||
${isSubmit ? "group-[:invalid]:bg-neutral-600 group-[:invalid]:text-neutral-400" : ""}`; | ||
|
||
const ghostStyle = `bg-white text-black shadow-[0_0_0_2px_inset_currentColor] | ||
const ghostStyle = `bg-white text-black shadow-[0_0_0_2px_inset_currentColor] | ||
active:bg-neutral-50 active:text-neutral-400 hover:bg-neutral-50 | ||
disabled:text-neutral-200 ${isSubmit ? "group-[:invalid]:text-neutral-200" : ""}`; | ||
|
||
const defaultStyle = `px-6 py-4 text-body-m font-bold text-center | ||
const defaultStyle = `px-6 py-4 text-body-m font-bold text-center | ||
disabled:cursor-default ${isSubmit ? "group-[:invalid]:cursor-default" : ""}`; | ||
|
||
const typedStyle = styleType === "filled" ? filledStyle : ghostStyle; | ||
return <button className={`${defaultStyle} ${typedStyle} ${className}`} type={type} {...otherProps}>{children}</button> | ||
const typedStyle = styleType === "filled" ? filledStyle : ghostStyle; | ||
return ( | ||
<button | ||
className={`${defaultStyle} ${typedStyle} ${className}`} | ||
type={type} | ||
{...otherProps} | ||
> | ||
{children} | ||
</button> | ||
); | ||
} | ||
|
||
export default Button; | ||
export default Button; |
Oops, something went wrong.