Skip to content

Commit d17690b

Browse files
committed
remove use of viewMode
1 parent 1115893 commit d17690b

File tree

2 files changed

+14
-32
lines changed

2 files changed

+14
-32
lines changed

packages/@react-spectrum/s2/chromatic/CardView.stories.tsx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,17 @@ const meta: Meta<typeof CardView> = {
2727
export default meta;
2828

2929
const cardViewStyles = style({
30-
width: {
31-
default: 'screen',
32-
viewMode: {
33-
docs: 'full'
34-
}
35-
},
36-
height: {
37-
default: 'screen',
38-
viewMode: {
39-
docs: 600
40-
}
41-
}
30+
width: 'screen',
31+
maxWidth: 'full',
32+
height: 600
4233
});
4334

44-
export const Empty = (args: CardViewProps<any>, {viewMode}) => {
35+
export const Empty = (args: CardViewProps<any>) => {
4536
return (
4637
<CardView
4738
aria-label="Assets"
4839
{...args}
49-
styles={cardViewStyles({viewMode})}
40+
styles={cardViewStyles}
5041
renderEmptyState={() => (
5142
<IllustratedMessage size="L">
5243
<EmptyIcon />

packages/@react-spectrum/s2/stories/CardView.stories.tsx

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,9 @@ const meta: Meta<typeof CardView> = {
2929
export default meta;
3030

3131
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
4435
});
4536

4637
type Item = {
@@ -101,7 +92,7 @@ function PhotoCard({item, layout}: {item: Item, layout: string}) {
10192
);
10293
}
10394

104-
export const Example = (args: CardViewProps<any>, {viewMode}) => {
95+
export const Example = (args: CardViewProps<any>) => {
10596
let list = useAsyncList<Item, number | null>({
10697
async load({signal, cursor, items}) {
10798
let page = cursor || 1;
@@ -126,7 +117,7 @@ export const Example = (args: CardViewProps<any>, {viewMode}) => {
126117
{...args}
127118
loadingState={loadingState}
128119
onLoadMore={args.loadingState === 'idle' ? list.loadMore : undefined}
129-
styles={cardViewStyles({viewMode})}>
120+
styles={cardViewStyles}>
130121
<Collection items={items} dependencies={[args.layout]}>
131122
{item => <PhotoCard item={item} layout={args.layout || 'grid'} />}
132123
</Collection>
@@ -157,12 +148,12 @@ Example.args = {
157148
selectionMode: 'multiple'
158149
};
159150

160-
export const Empty = (args: CardViewProps<any>, {viewMode}) => {
151+
export const Empty = (args: CardViewProps<any>) => {
161152
return (
162153
<CardView
163154
aria-label="Assets"
164155
{...args}
165-
styles={cardViewStyles({viewMode})}
156+
styles={cardViewStyles}
166157
renderEmptyState={() => (
167158
<IllustratedMessage size="L">
168159
<EmptyIcon />
@@ -202,7 +193,7 @@ function TopicCard({topic}: {topic: Topic}) {
202193
);
203194
}
204195

205-
export const CollectionCards = (args: CardViewProps<any>, {viewMode}) => {
196+
export const CollectionCards = (args: CardViewProps<any>) => {
206197
let list = useAsyncList<Topic, number | null>({
207198
async load({signal, cursor}) {
208199
let page = cursor || 1;
@@ -224,7 +215,7 @@ export const CollectionCards = (args: CardViewProps<any>, {viewMode}) => {
224215
{...args}
225216
loadingState={loadingState}
226217
onLoadMore={args.loadingState === 'idle' ? list.loadMore : undefined}
227-
styles={cardViewStyles({viewMode})}>
218+
styles={cardViewStyles}>
228219
<Collection items={items}>
229220
{topic => <TopicCard topic={topic} />}
230221
</Collection>

0 commit comments

Comments
 (0)