Skip to content

Commit 865a942

Browse files
authored
Merge pull request #86 from enowdivine/button_component
Button and LinkButton component created
2 parents 667ec2c + 30ec53f commit 865a942

3 files changed

Lines changed: 34 additions & 1 deletion

File tree

src/components/Banner/Banner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function Banner() {
55
<div>
66
<div className="bg-white">
77
<div
8-
className="p-4"
8+
className="p-4 text-danger"
99
style={{
1010
background:
1111
'repeating-linear-gradient(-55deg, #222, rgb(34, 34, 34) 10px, rgb(234, 179, 8) 10px, rgb(234, 179, 8) 20px)',

src/components/Button/Button.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
3+
type ButtonProps = React.ComponentProps<'button'>;
4+
5+
const Button: React.FC<ButtonProps> = ({ children, ...props }) => {
6+
return (
7+
<button
8+
type="button"
9+
className="p-4 px-8 text-white font-bold bg-red-600 rounded block w-[200px] overflow-hidden whitespace-nowrap overflow-ellipsis text-center"
10+
{...props}
11+
>
12+
{children}
13+
</button>
14+
);
15+
};
16+
17+
export default Button;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
3+
type LinkButtonProps = React.ComponentProps<'a'>;
4+
5+
const LinkButton: React.FC<LinkButtonProps> = ({ children, ...props }) => {
6+
return (
7+
<a
8+
className="p-4 px-8 text-white font-bold bg-red-600 rounded block w-[200px] overflow-hidden whitespace-nowrap overflow-ellipsis text-center"
9+
{...props}
10+
>
11+
{children}
12+
</a>
13+
);
14+
};
15+
16+
export default LinkButton;

0 commit comments

Comments
 (0)