mirror of
https://github.com/grafana/grafana.git
synced 2024-12-29 10:21:41 -06:00
Storybook: Fix decorator height (#41468)
* fix(storybook): make sure story background fills available height * fix(storybook): add decorator to prevent badge filling all available height * docs(badge): use centered story * revert(badge): remove obsolete Meta typing
This commit is contained in:
parent
8adefa32fd
commit
cd5277befd
6
packages/grafana-ui/.storybook/preview-head.html
Normal file
6
packages/grafana-ui/.storybook/preview-head.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!-- Make sure iframe dom elements fill all available space for background consistency -->
|
||||
<style>
|
||||
#root {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
@ -2,11 +2,12 @@ import React from 'react';
|
||||
import { Story } from '@storybook/react';
|
||||
import { Badge, BadgeProps } from '@grafana/ui';
|
||||
import { iconOptions } from '../../utils/storybook/knobs';
|
||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||
|
||||
export default {
|
||||
title: 'Data Display/Badge',
|
||||
component: Badge,
|
||||
decorators: [],
|
||||
decorators: [withCenteredStory],
|
||||
parameters: {
|
||||
docs: {},
|
||||
},
|
||||
|
@ -11,7 +11,7 @@ const PaddedStory: React.FunctionComponent<{}> = ({ children }) => {
|
||||
width: '100%',
|
||||
padding: '20px',
|
||||
display: 'flex',
|
||||
minHeight: '80vh',
|
||||
minHeight: '100%',
|
||||
background: `${theme.colors.background.primary}`,
|
||||
}}
|
||||
>
|
||||
|
@ -5,7 +5,7 @@ const RightAlignedStory: React.FunctionComponent<{}> = ({ children }) => {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
height: '100vh ',
|
||||
minHeight: '100%',
|
||||
display: 'flex',
|
||||
alignItems: 'flex-start',
|
||||
justifyContent: 'flex-end',
|
||||
|
@ -21,7 +21,7 @@ const ThemeableStory: React.FunctionComponent<{ handleSassThemeChange: SassTheme
|
||||
width: '100%',
|
||||
padding: '20px',
|
||||
display: 'flex',
|
||||
minHeight: '80vh',
|
||||
minHeight: '100%',
|
||||
background: `${theme.colors.background.primary}`,
|
||||
}}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user