Search: Make items more compact (#31734)

This commit is contained in:
Alex Khomenko 2021-03-06 10:51:09 +02:00 committed by GitHub
parent 0b6b8de6f8
commit ab2f405205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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;

View File

@ -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;