File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff 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 */
2123const 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 }
You can’t perform that action at this time.
0 commit comments