From ab2f405205e6d0ecf5c8cd66ba089d98b6539354 Mon Sep 17 00:00:00 2001 From: Alex Khomenko Date: Sat, 6 Mar 2021 10:51:09 +0200 Subject: [PATCH] Search: Make items more compact (#31734) --- public/app/features/search/components/SearchItem.tsx | 3 ++- public/app/features/search/constants.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/app/features/search/components/SearchItem.tsx b/public/app/features/search/components/SearchItem.tsx index b60e4f97151..e3658fb3438 100644 --- a/public/app/features/search/components/SearchItem.tsx +++ b/public/app/features/search/components/SearchItem.tsx @@ -5,7 +5,7 @@ import { TagList, Card, useStyles, Icon, IconName } from '@grafana/ui'; import { GrafanaTheme } from '@grafana/data'; import { DashboardSectionItem, OnToggleChecked } from '../types'; import { SearchCheckbox } from './SearchCheckbox'; -import { SEARCH_ITEM_HEIGHT } from '../constants'; +import { SEARCH_ITEM_HEIGHT, SEARCH_ITEM_MARGIN } from '../constants'; export interface Props { item: DashboardSectionItem; @@ -76,6 +76,7 @@ const getStyles = (theme: GrafanaTheme) => { return { container: css` padding: ${theme.spacing.sm} ${theme.spacing.md}; + margin-bottom: ${SEARCH_ITEM_MARGIN}px; `, metaContainer: css` display: flex; diff --git a/public/app/features/search/constants.ts b/public/app/features/search/constants.ts index c772ce435e6..a23810441b2 100644 --- a/public/app/features/search/constants.ts +++ b/public/app/features/search/constants.ts @@ -1,7 +1,7 @@ export const NO_ID_SECTIONS = ['Recent', 'Starred']; // Height of the search result item -export const SEARCH_ITEM_HEIGHT = 62; -export const SEARCH_ITEM_MARGIN = 8; +export const SEARCH_ITEM_HEIGHT = 58; +export const SEARCH_ITEM_MARGIN = 4; export const DEFAULT_SORT = { label: 'A\u2013Z', value: 'alpha-asc' }; export const SECTION_STORAGE_KEY = 'search.sections'; export const GENERAL_FOLDER_ID = 0;