@@ -29,18 +29,9 @@ const meta: Meta<typeof CardView> = {
29
29
export default meta ;
30
30
31
31
const cardViewStyles = style ( {
32
- width : {
33
- default : 'screen' ,
34
- viewMode : {
35
- docs : 'full'
36
- }
37
- } ,
38
- height : {
39
- default : 'screen' ,
40
- viewMode : {
41
- docs : 600
42
- }
43
- }
32
+ width : 'screen' ,
33
+ maxWidth : 'full' ,
34
+ height : 600
44
35
} ) ;
45
36
46
37
type Item = {
@@ -101,7 +92,7 @@ function PhotoCard({item, layout}: {item: Item, layout: string}) {
101
92
) ;
102
93
}
103
94
104
- export const Example = ( args : CardViewProps < any > , { viewMode } ) => {
95
+ export const Example = ( args : CardViewProps < any > ) => {
105
96
let list = useAsyncList < Item , number | null > ( {
106
97
async load ( { signal, cursor, items} ) {
107
98
let page = cursor || 1 ;
@@ -126,7 +117,7 @@ export const Example = (args: CardViewProps<any>, {viewMode}) => {
126
117
{ ...args }
127
118
loadingState = { loadingState }
128
119
onLoadMore = { args . loadingState === 'idle' ? list . loadMore : undefined }
129
- styles = { cardViewStyles ( { viewMode } ) } >
120
+ styles = { cardViewStyles } >
130
121
< Collection items = { items } dependencies = { [ args . layout ] } >
131
122
{ item => < PhotoCard item = { item } layout = { args . layout || 'grid' } /> }
132
123
</ Collection >
@@ -157,12 +148,12 @@ Example.args = {
157
148
selectionMode : 'multiple'
158
149
} ;
159
150
160
- export const Empty = ( args : CardViewProps < any > , { viewMode } ) => {
151
+ export const Empty = ( args : CardViewProps < any > ) => {
161
152
return (
162
153
< CardView
163
154
aria-label = "Assets"
164
155
{ ...args }
165
- styles = { cardViewStyles ( { viewMode } ) }
156
+ styles = { cardViewStyles }
166
157
renderEmptyState = { ( ) => (
167
158
< IllustratedMessage size = "L" >
168
159
< EmptyIcon />
@@ -202,7 +193,7 @@ function TopicCard({topic}: {topic: Topic}) {
202
193
) ;
203
194
}
204
195
205
- export const CollectionCards = ( args : CardViewProps < any > , { viewMode } ) => {
196
+ export const CollectionCards = ( args : CardViewProps < any > ) => {
206
197
let list = useAsyncList < Topic , number | null > ( {
207
198
async load ( { signal, cursor} ) {
208
199
let page = cursor || 1 ;
@@ -224,7 +215,7 @@ export const CollectionCards = (args: CardViewProps<any>, {viewMode}) => {
224
215
{ ...args }
225
216
loadingState = { loadingState }
226
217
onLoadMore = { args . loadingState === 'idle' ? list . loadMore : undefined }
227
- styles = { cardViewStyles ( { viewMode } ) } >
218
+ styles = { cardViewStyles } >
228
219
< Collection items = { items } >
229
220
{ topic => < TopicCard topic = { topic } /> }
230
221
</ Collection >
0 commit comments