Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
const colorMap: Record<string, string> = {
mygreen: 'bg-mygreen',
myyellow: 'bg-myyellow',
myred: 'bg-myred',
};

const hoverMap: Record<string, string> = {
mygreen: 'hover:bg-mygreen',
myyellow: 'hover:bg-myyellow',
myred: 'hover:bg-myred',
};

interface ButtonProps {
color?: string;
hover?: string;
text: string;
onClick?: () => void;
}

function Button({ color, hover, text, onClick }: ButtonProps) {
function Button({ color = 'mygreen', hover = 'mygreen', text, onClick }: ButtonProps) {
return (
<div className="flex items-center justify-center">
<button className={`btn bg-${color} hover:bg-${hover} `} onClick={onClick}>
<button className={`btn ${colorMap[color] || 'bg-mygreen'} ${hoverMap[hover] || 'hover:bg-mygreen'}`} onClick={onClick}>
{text}
</button>
</div>
Expand Down
11 changes: 0 additions & 11 deletions src/pages/Auth/Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -531,17 +531,6 @@ function Auth() {
))}
</ul>
)}

{errors.password && (
<ul
className="px-2 text-xs mt-1"
style={{ color: "red" }}
>
{errors.password.map((error, index) => (
<li key={index}>{error}</li>
))}
</ul>
)}
</div>
<div className="mt-4 text-sm text-gray-600 text-right font-bold tracking-wider">
<Link to="#" onClick={handleForgotPasswordRequest}>
Expand Down
Loading