@@ -4,7 +4,11 @@ import Box from '@material-ui/core/Box';
44import Button , { ButtonProps } from '@material-ui/core/Button' ;
55import { buttonStylesByNames , ColorName } from '../../utils/style' ;
66
7+ /**
8+ * Note: You can change these const to control default appearance of the AppButton component
9+ */
710const APP_BUTTON_VARIANT = 'contained' ; // | 'text' | 'outlined'
11+ const APP_BUTTON_MARGIN = 1 ;
812
913const useStyles = makeStyles ( ( theme : Theme ) => ( {
1014 box : {
@@ -31,24 +35,24 @@ interface Props extends Omit<ButtonProps, 'color'> {
3135}
3236
3337/**
34- * Application styled Material UI Button
38+ * Application styled Material UI Button with Box around to specify margins using props
3539 * @class AppButton
3640 * @param {string } [color] - name of color from Material UI palette 'primary', 'secondary', 'warning', and so on
3741 * @param {string } [children] - content to render, overrides .label and .text
3842 * @param {string } [label] - text to render, alternate to .text
3943 * @param {string } [text] - text to render, alternate to .label
4044 */
4145const AppButton : React . FC < Props > = ( {
42- className,
4346 children,
47+ className,
4448 color = 'default' ,
4549 label,
46- text,
4750 m = 0 ,
48- mt = 1 ,
49- mb = 1 ,
50- ml = 1 ,
51- mr = 1 ,
51+ mt = APP_BUTTON_MARGIN ,
52+ mb = APP_BUTTON_MARGIN ,
53+ ml = APP_BUTTON_MARGIN ,
54+ mr = APP_BUTTON_MARGIN ,
55+ text,
5256 underline = 'none' ,
5357 ...restOfProps
5458} ) => {
0 commit comments