Skip to content

Commit 88db27a

Browse files
committed
Update Button.component.tsx
1 parent 64f31f5 commit 88db27a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/components/UI/Button.component.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@ const Button = ({
3232
isHero = false,
3333
href,
3434
}: IButtonProps) => {
35+
const getColorClasses = (buttonColor: TButtonColors) => {
36+
if (buttonColor === 'blue') {
37+
return 'bg-blue-500 hover:bg-blue-600';
38+
}
39+
return 'bg-red-500 hover:bg-red-600';
40+
};
41+
3542
const buttonClasses = isHero
36-
? 'inline-block px-8 py-4 text-sm tracking-wider uppercase bg-white text-gray-900 hover:bg-gray-400 hover:text-white shadow-md'
37-
: `px-2 lg:px-4 py-2 font-bold border border-gray-400 border-solid rounded text-white ${
38-
color === 'blue'
39-
? 'bg-blue-500 hover:bg-blue-600'
40-
: 'bg-red-500 hover:bg-red-600'
41-
}`;
43+
? 'inline-block px-8 py-4 text-sm tracking-wider uppercase bg-white bg-opacity-90 text-gray-900 hover:bg-gray-400 hover:bg-opacity-95 hover:text-white hover:shadow-md'
44+
: `px-2 lg:px-4 py-2 font-bold border border-gray-400 border-solid rounded text-white ${getColorClasses(color)}`;
4245

4346
const classes = `${buttonClasses} ease-in-out transition-all duration-300 disabled:opacity-50 ${
4447
fullWidth ? 'w-full md:w-auto' : ''

0 commit comments

Comments
 (0)