Skip to content

Commit 52ef64b

Browse files
committed
reworked the logic using actions
1 parent 6b76bf5 commit 52ef64b

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

packages/react-core/src/components/Card/examples/CardHeaderWraps.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import { Card, CardBody, CardHeader, Button, CardTitle, Flex, FlexItem } from '@patternfly/react-core';
1+
import { Card, CardBody, CardHeader, Button, CardTitle } from '@patternfly/react-core';
22

33
export const CardBasic: React.FunctionComponent = () => (
44
<Card ouiaId="BasicCard">
5-
<CardHeader hasWrap>
6-
{' '}
7-
<Flex columnGap={{ default: 'columnGapXl' }} justifyContent={{ default: 'justifyContentSpaceBetween' }}>
8-
<FlexItem>
9-
<CardTitle>This is a longer card title that takes up more space</CardTitle>
10-
</FlexItem>
11-
<FlexItem>
12-
<Button variant="primary" ouiaId="Primary">
5+
<CardHeader
6+
hasWrap
7+
actions={{
8+
hasNoOffset: true,
9+
actions: [
10+
<Button variant="primary" ouiaId="Primary" key="primary">
1311
Primary action
14-
</Button>
15-
<Button variant="secondary" ouiaId="Secondary">
12+
</Button>,
13+
<Button variant="secondary" ouiaId="Secondary" key="secondary">
1614
Secondary action
17-
</Button>
18-
<Button variant="tertiary" ouiaId="Tertiary">
15+
</Button>,
16+
<Button variant="tertiary" ouiaId="Tertiary" key="tertiary">
1917
Tertiary action
2018
</Button>
21-
</FlexItem>
22-
</Flex>
19+
]
20+
}}
21+
>
22+
<CardTitle>This is a longer card title that takes up more space</CardTitle>
2323
</CardHeader>
2424
<CardBody>This is the card body</CardBody>
2525
</Card>

0 commit comments

Comments
 (0)