Skip to content

Commit c4c8e9d

Browse files
committed
Add CardBody
1 parent e395ca9 commit c4c8e9d

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

client/dashboard/components/action-list/action-item.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
padding: $grid-unit-20 0;
66
border-bottom: 1px solid $gray-100;
77

8-
&:first-child {
9-
padding-top: $grid-unit-10;
10-
}
11-
128
&:last-child {
13-
padding-bottom: $grid-unit-10;
149
border-bottom: none;
1510
}
1611

client/dashboard/components/action-list/index.tsx

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
__experimentalVStack as VStack,
33
__experimentalText as Text,
44
Card,
5+
CardBody,
56
} from '@wordpress/components';
67
import { forwardRef } from 'react';
78
import ActionItem from './action-item';
@@ -14,21 +15,25 @@ function UnforwardedActionList(
1415
) {
1516
return (
1617
<Card className="action-list" ref={ ref }>
17-
{ ( title || description ) && (
18-
<VStack className="action-list__heading" spacing={ 2 }>
19-
{ title && (
20-
<Text size="15px" weight={ 500 } lineHeight="20px">
21-
{ title }
22-
</Text>
23-
) }
24-
{ description && (
25-
<Text variant="muted" lineHeight="20px">
26-
{ description }
27-
</Text>
28-
) }
18+
<CardBody>
19+
{ ( title || description ) && (
20+
<VStack className="action-list__heading" spacing={ 2 }>
21+
{ title && (
22+
<Text size="15px" weight={ 500 } lineHeight="20px">
23+
{ title }
24+
</Text>
25+
) }
26+
{ description && (
27+
<Text variant="muted" lineHeight="20px">
28+
{ description }
29+
</Text>
30+
) }
31+
</VStack>
32+
) }
33+
<VStack className="action-list__actions" spacing={ 0 }>
34+
{ children }
2935
</VStack>
30-
) }
31-
<VStack spacing={ 0 }>{ children }</VStack>
36+
</CardBody>
3237
</Card>
3338
);
3439
}

client/dashboard/components/action-list/style.scss

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
@import "@wordpress/base-styles/variables";
33

44
.action-list {
5-
padding: $grid-unit-10 $grid-unit-30;
6-
7-
&:has(.action-list__heading) {
8-
padding: $grid-unit-20 $grid-unit-30;
9-
}
10-
115
.action-list__heading {
126
padding-top: $grid-unit-10;
137
padding-bottom: $grid-unit-15;
148
}
9+
10+
.action-list__heading ~ .action-list__actions {
11+
margin: -$grid-unit-10 0;
12+
}
13+
14+
.action-list__actions {
15+
margin: -$grid-unit-20 0;
16+
}
1517
}

0 commit comments

Comments
 (0)