From 7e670c8afed8b46ffa4008413a03ccb1cdb68fda Mon Sep 17 00:00:00 2001 From: "ruiyi.jiang" Date: Tue, 20 Dec 2022 21:15:33 +0800 Subject: [PATCH] unify grid row height --- client/src/components/advancedSearch/Types.ts | 1 + .../customButton/CustomIconButton.tsx | 2 +- client/src/components/grid/ActionBar.tsx | 18 +++++++++++++++ client/src/components/grid/Table.tsx | 22 +++++++++---------- client/src/pages/collections/Types.ts | 7 ++++++ client/src/pages/preview/Preview.tsx | 1 - client/src/pages/query/Styles.ts | 8 ++++++- client/src/pages/search/VectorSearch.tsx | 1 + client/src/pages/user/User.tsx | 19 ++-------------- 9 files changed, 48 insertions(+), 31 deletions(-) diff --git a/client/src/components/advancedSearch/Types.ts b/client/src/components/advancedSearch/Types.ts index 1f217fb6..23430828 100644 --- a/client/src/components/advancedSearch/Types.ts +++ b/client/src/components/advancedSearch/Types.ts @@ -48,6 +48,7 @@ export interface CopyButtonProps { label: string; value: string; others?: any; + size?: 'medium' | 'small' | undefined; } export interface DialogProps { diff --git a/client/src/components/customButton/CustomIconButton.tsx b/client/src/components/customButton/CustomIconButton.tsx index 8882962a..c7284456 100644 --- a/client/src/components/customButton/CustomIconButton.tsx +++ b/client/src/components/customButton/CustomIconButton.tsx @@ -11,7 +11,7 @@ const getStyles = makeStyles((theme: Theme) => ({ display: 'inline-block', }, iconBtn: { - padding: theme.spacing(1), + padding: theme.spacing(0.5), }, })); diff --git a/client/src/components/grid/ActionBar.tsx b/client/src/components/grid/ActionBar.tsx index e03d1bbc..ca8e35b8 100644 --- a/client/src/components/grid/ActionBar.tsx +++ b/client/src/components/grid/ActionBar.tsx @@ -5,6 +5,7 @@ import { Theme, createStyles, Button, + Typography, } from '@material-ui/core'; import Icons from '../icons/Icons'; import { ActionBarType } from './Types'; @@ -37,6 +38,10 @@ const useStyles = makeStyles((theme: Theme) => color: '#fff', }, }, + link: { + textDecoration: 'underline', + color: theme.palette.common.black, + } }) ); @@ -73,6 +78,18 @@ const ActionBar: FC = props => { ? v.renderIconFn && v.renderIconFn(row) : Icons[v.icon]()} + ) : v.linkButton ? ( + { + e.stopPropagation(); + v.onClick(e, row); + }} + > + {v.text} + ) : (