Skip to content

Commit

Permalink
Fix(Button): Add Button Styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Kara-Zor-El committed Jul 16, 2024
1 parent 4bd57e8 commit 72bc771
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
12 changes: 10 additions & 2 deletions components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import React from 'react';
import Link from 'next/link';

enum ButtonType {
NAVBAR = '',
LIGHT = 'light-btn',
SOCIAL = 'social-btn',
}

interface Props {
onClick?: () => void;
href?: string;
className?: string;
type: ButtonType;
}

interface LabelProps extends Props {
Expand All @@ -21,13 +28,14 @@ const Button: React.FC<LabelProps | ChildrenProps> = ({
onClick,
href,
className,
type,
}) => {
return href ? (
<Link href={href}>
<span className={`${className}`}>{label || children}</span>
<span className={`${className} ${type}`}>{label || children}</span>
</Link>
) : (
<button onClick={onClick} className={`${className}`}>
<button onClick={onClick} className={`${className} ${type}`}>
{label || children}
</button>
);
Expand Down
19 changes: 19 additions & 0 deletions styles/Button.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.socialMedia {
@apply flex gap-4;
@apply justify-center;
> img {
@apply bg-socials;
@apply rounded-lg;
@apply w-10 h-10;
@apply p-2;
@apply shadow-md;
@apply hover:shadow-lg;
}
}

.lightBtn {
@apply bg-color-2;
@apply rounded-lg border-2 border-black;
@apply p-2;
@apply font-bold;
}

0 comments on commit 72bc771

Please sign in to comment.