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 {
7
7
buttonDisabled ?: boolean ;
8
8
color ?: TButtonColors ;
9
9
children : ReactNode ;
10
+ fullWidth ?: boolean ;
10
11
}
11
12
12
13
/**
13
14
* Renders a clickable button
14
- * @function PageTitle
15
+ * @function Button
15
16
* @param {void } handleButtonClick - Handle button click
16
17
* @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
18
19
* @param {ReactNode } children - Children for button
20
+ * @param {boolean? } fullWidth - Whether the button should be full-width on mobile
19
21
* @returns {JSX.Element } - Rendered component
20
22
*/
21
23
const Button = ( {
22
24
handleButtonClick,
23
25
buttonDisabled,
24
26
color = 'blue' ,
25
27
children,
28
+ fullWidth = false ,
26
29
} : IButtonProps ) => (
27
30
< button
28
31
onClick = { handleButtonClick }
@@ -33,6 +36,7 @@ const Button = ({
33
36
? 'bg-blue-500 hover:bg-blue-600'
34
37
: 'bg-red-500 hover:bg-red-600'
35
38
}
39
+ ${ fullWidth ? 'w-full md:w-auto' : '' }
36
40
` }
37
41
>
38
42
{ children }
You can’t perform that action at this time.
0 commit comments