Skip to content

Commit ea54e0b

Browse files
committed
Add actionsAsLinks prop to dev page
1 parent 68589b5 commit ea54e0b

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

pages/app-layout/split-panel-with-custom-header.page.tsx

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import * as toolsContent from './utils/tools-content';
2121

2222
type SplitPanelDemoContext = React.Context<
2323
AppContextType<{
24+
actionsAsLinks: boolean;
2425
description?: string;
2526
headerText?: string;
2627
renderActions: boolean;
@@ -61,12 +62,15 @@ export default function () {
6162
header={urlParams.headerText || ''}
6263
i18nStrings={splitPaneli18nStrings}
6364
headerActions={
64-
urlParams.renderActions && (
65+
urlParams.renderActions &&
66+
(urlParams.actionsAsLinks ? (
67+
<Link>Action</Link>
68+
) : (
6569
<SpaceBetween direction="horizontal" size="xs">
6670
<Button>Button</Button>
6771
<Button>Button</Button>
6872
</SpaceBetween>
69-
)
73+
))
7074
}
7175
headerDescription={urlParams.description}
7276
headerInfo={
@@ -88,19 +92,27 @@ export default function () {
8892
</Header>
8993
</div>
9094
<SpaceBetween size="l">
95+
<Toggle
96+
checked={urlParams.renderInfoLink}
97+
onChange={({ detail }) => setUrlParams({ ...urlParams, renderInfoLink: detail.checked })}
98+
>
99+
With info link
100+
</Toggle>
91101
<SpaceBetween direction="horizontal" size="xl">
92-
<Toggle
93-
checked={urlParams.renderInfoLink}
94-
onChange={({ detail }) => setUrlParams({ ...urlParams, renderInfoLink: detail.checked })}
95-
>
96-
With info link
97-
</Toggle>
98102
<Toggle
99103
checked={urlParams.renderActions}
100104
onChange={({ detail }) => setUrlParams({ ...urlParams, renderActions: detail.checked })}
101105
>
102106
With action buttons
103107
</Toggle>
108+
{urlParams.renderActions && (
109+
<Toggle
110+
checked={urlParams.actionsAsLinks}
111+
onChange={({ detail }) => setUrlParams({ ...urlParams, actionsAsLinks: detail.checked })}
112+
>
113+
As links
114+
</Toggle>
115+
)}
104116
</SpaceBetween>
105117
<FormField label="Header text">
106118
<Input

0 commit comments

Comments
 (0)