11import React from 'react' ;
22
3- import { MeteorProviderMock } from './providers' ;
3+ import { MeteorProviderMock } from './mocks/ providers' ;
44
55export const rocketChatDecorator = ( fn ) => {
66 const linkElement = document . getElementById ( 'theme-styles' ) || document . createElement ( 'link' ) ;
77 if ( linkElement . id !== 'theme-styles' ) {
8- require ( '../../ app/theme/client/main.css' ) ;
9- require ( '../../ app/theme/client/vendor/fontello/css/fontello.css' ) ;
10- require ( '../../ app/theme/client/rocketchat.font.css' ) ;
8+ require ( '../app/theme/client/main.css' ) ;
9+ require ( '../app/theme/client/vendor/fontello/css/fontello.css' ) ;
10+ require ( '../app/theme/client/rocketchat.font.css' ) ;
1111 linkElement . setAttribute ( 'id' , 'theme-styles' ) ;
1212 linkElement . setAttribute ( 'rel' , 'stylesheet' ) ;
1313 linkElement . setAttribute ( 'href' , 'https://open.rocket.chat/theme.css' ) ;
1414 document . head . appendChild ( linkElement ) ;
1515 }
1616
1717 // eslint-disable-next-line import/no-unresolved
18- const { default : icons } = require ( '!!raw-loader!../../ private/public/icons.svg' ) ;
18+ const { default : icons } = require ( '!!raw-loader!../private/public/icons.svg' ) ;
1919
2020 return < MeteorProviderMock >
2121 < style > { `
@@ -29,3 +29,13 @@ export const rocketChatDecorator = (fn) => {
2929 </ div >
3030 </ MeteorProviderMock > ;
3131} ;
32+
33+ export const fullHeightDecorator = ( storyFn ) =>
34+ < div style = { { display : 'flex' , flexDirection : 'column' , maxHeight : '100vh' } } >
35+ { storyFn ( ) }
36+ </ div > ;
37+
38+ export const centeredDecorator = ( storyFn ) =>
39+ < div style = { { display : 'flex' , alignItems : 'center' , justifyContent : 'center' , minHeight : '100vh' } } >
40+ { storyFn ( ) }
41+ </ div > ;
0 commit comments