Browse Source

update dropdown shadow

tumao 4 years ago
parent
commit
fd12df6548

+ 2 - 1
client/src/components/grid/ToolBar.tsx

@@ -79,7 +79,8 @@ const CustomToolBar: FC<ToolBarType> = props => {
                 startIcon={Icon}
                 color="primary"
                 disabled={disabled}
-                variant="contained"
+                // use contained variant as default
+                variant={c.btnVariant || 'contained'}
                 tooltip={c.tooltip}
                 className={classes.btn}
               >

+ 1 - 0
client/src/components/grid/Types.ts

@@ -40,6 +40,7 @@ export type ToolBarConfig = Partial<TableSwitchType> &
     type?: 'iconBtn' | 'buttton' | 'switch' | 'select' | 'groupSelect';
     position?: 'right' | 'left';
     component?: ReactElement;
+    btnVariant?: 'contained' | 'outlined' | 'text';
   };
 
 export type TableHeadType = {

+ 7 - 2
client/src/components/menu/SimpleMenu.tsx

@@ -8,6 +8,10 @@ import CustomButton from '../customButton/CustomButton';
 import { makeStyles, Theme } from '@material-ui/core';
 
 const getStyles = makeStyles((theme: Theme) => ({
+  menuPaper: {
+    boxShadow: '0px 4px 24px rgba(0, 0, 0, 0.08)',
+    borderRadius: '4px',
+  },
   menuItem: {
     minWidth: '160px',
     padding: theme.spacing(1),
@@ -49,9 +53,10 @@ const SimpleMenu: FC<SimpleMenuType> = props => {
         keepMounted
         open={Boolean(anchorEl)}
         onClose={handleClose}
+        classes={{ paper: classes.menuPaper }}
         getContentAnchorEl={null}
-        anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}
-        transformOrigin={{ vertical: 'top', horizontal: 'center' }}
+        // anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}
+        // transformOrigin={{ vertical: 'top', horizontal: 'center' }}
       >
         <div>
           {menuItems.map((v, i) =>