Skip to content

Commit a6e91fb

Browse files
committed
Update Button.component.tsx
1 parent 0036465 commit a6e91fb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/UI/Button.component.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,25 @@ interface IButtonProps {
77
buttonDisabled?: boolean;
88
color?: TButtonColors;
99
children: ReactNode;
10+
fullWidth?: boolean;
1011
}
1112

1213
/**
1314
* Renders a clickable button
14-
* @function PageTitle
15+
* @function Button
1516
* @param {void} handleButtonClick - Handle button click
1617
* @param {boolean?} buttonDisabled - Is button disabled?
17-
* @param {color?} TButtonColors - Color for button, either red or blue
18+
* @param {TButtonColors?} color - Color for button, either red or blue
1819
* @param {ReactNode} children - Children for button
20+
* @param {boolean?} fullWidth - Whether the button should be full-width on mobile
1921
* @returns {JSX.Element} - Rendered component
2022
*/
2123
const Button = ({
2224
handleButtonClick,
2325
buttonDisabled,
2426
color = 'blue',
2527
children,
28+
fullWidth = false,
2629
}: IButtonProps) => (
2730
<button
2831
onClick={handleButtonClick}
@@ -33,6 +36,7 @@ const Button = ({
3336
? 'bg-blue-500 hover:bg-blue-600'
3437
: 'bg-red-500 hover:bg-red-600'
3538
}
39+
${fullWidth ? 'w-full md:w-auto' : ''}
3640
`}
3741
>
3842
{children}

0 commit comments

Comments
 (0)