@@ -4,13 +4,17 @@ import yfm from '@doc-tools/transform';
44import { Meta , StoryFn } from '@storybook/react' ;
55
66import { BasicCardProps } from '../../../models' ;
7+ import { IconPosition } from '../../../models/constructor-items/sub-blocks' ;
78import BasicCard from '../BasicCard' ;
89
910import data from './data.json' ;
1011
1112const getCardWithBorderTitle = ( border : string ) =>
1213 data . withBorder . title . replace ( '{{border}}' , border ) ;
1314
15+ const getCardWithIconTitle = ( border : string ) =>
16+ data . withIcon . title . replace ( '{{position}}' , border ) ;
17+
1418export default {
1519 component : BasicCard ,
1620 title : 'Components/Cards/BasicCard' ,
@@ -25,13 +29,19 @@ const DefaultTemplate: StoryFn<BasicCardProps> = (args) => (
2529const WithIconTemplate : StoryFn < BasicCardProps > = ( args ) => (
2630 < div style = { { display : 'flex' } } >
2731 < div style = { { maxWidth : '400px' , padding : '0 8px' } } >
28- < BasicCard { ...args } icon = { data . withIcon . icons [ 0 ] } />
29- </ div >
30- < div style = { { maxWidth : '400px' , padding : '0 8px' } } >
31- < BasicCard { ...args } icon = { data . withIcon . icons [ 1 ] } />
32+ < BasicCard
33+ { ...args }
34+ icon = { data . withIcon . icons [ 0 ] }
35+ title = { getCardWithIconTitle ( 'top' ) }
36+ />
3237 </ div >
3338 < div style = { { maxWidth : '400px' , padding : '0 8px' } } >
34- < BasicCard { ...args } icon = { data . withIcon . icons [ 2 ] } />
39+ < BasicCard
40+ { ...args }
41+ icon = { data . withIcon . icons [ 1 ] }
42+ iconPosition = { IconPosition . Left }
43+ title = { getCardWithIconTitle ( 'left' ) }
44+ />
3545 </ div >
3646 </ div >
3747) ;
0 commit comments