@@ -4,12 +4,10 @@ import React, { useContext } from 'react';
44
55import { Container , FormField , Header , SegmentedControl , SpaceBetween } from '~components' ;
66import Button from '~components/button' ;
7- import { I18nProvider } from '~components/i18n' ;
8- import messages from '~components/i18n/messages/all.en' ;
97import PanelLayout , { PanelLayoutProps } from '~components/panel-layout' ;
108
119import AppContext , { AppContextType } from '../app/app-context' ;
12- import ScreenshotArea from '../utils/screenshot-area ' ;
10+ import { SimplePage } from '../app/templates ' ;
1311
1412interface NestedPanelLayoutProps {
1513 outerPanelPosition : PanelLayoutProps . PanelPosition ;
@@ -87,72 +85,62 @@ export default function NestedPanelLayoutPage() {
8785 } = useContext ( AppContext as PageContext ) ;
8886
8987 return (
90- < I18nProvider messages = { [ messages ] } locale = "en" >
91- < ScreenshotArea disableAnimations = { true } gutters = { false } >
92- < SpaceBetween size = "l" >
93- < Container
94- header = {
95- < Header variant = "h1" description = "Demonstrates how panel layouts can be nested within each other" >
96- Nested Panel Layout Demo
97- </ Header >
98- }
99- >
100- < SpaceBetween size = "m" >
101- < p >
102- This page demonstrates nested panel layouts, where one panel layout contains another panel layout in
103- either its panel or main content area.
104- </ p >
105- < p >
106- Each panel layout maintains its own resize behavior and can be configured with different panel positions
107- and constraints.
108- </ p >
88+ < SimplePage title = "Nested Panel Layout Demo" i18n = { { } } screenshotArea = { { } } >
89+ < SpaceBetween size = "l" >
90+ < Container >
91+ < p >
92+ This page demonstrates nested panel layouts, where one panel layout contains another panel layout in either
93+ its panel or main content area.
94+ </ p >
95+ < p >
96+ Each panel layout maintains its own resize behavior and can be configured with different panel positions and
97+ constraints.
98+ </ p >
10999
110- < SpaceBetween size = "s" direction = "horizontal" >
111- < FormField label = "Outer panel position" >
112- < SegmentedControl
113- options = { [
114- { id : 'side-start' , text : 'side-start' } ,
115- { id : 'side-end' , text : 'side-end' } ,
116- ] }
117- selectedId = { outerPanelPosition }
118- onChange = { ( { detail } ) => setUrlParams ( { outerPanelPosition : detail . selectedId as any } ) }
119- />
120- </ FormField >
100+ < SpaceBetween size = "s" direction = "horizontal" >
101+ < FormField label = "Outer panel position" >
102+ < SegmentedControl
103+ options = { [
104+ { id : 'side-start' , text : 'side-start' } ,
105+ { id : 'side-end' , text : 'side-end' } ,
106+ ] }
107+ selectedId = { outerPanelPosition }
108+ onChange = { ( { detail } ) => setUrlParams ( { outerPanelPosition : detail . selectedId as any } ) }
109+ />
110+ </ FormField >
121111
122- < FormField label = "Inner panel position" >
123- < SegmentedControl
124- options = { [
125- { id : 'side-start' , text : 'side-start' } ,
126- { id : 'side-end' , text : 'side-end' } ,
127- ] }
128- selectedId = { innerPanelPosition }
129- onChange = { ( { detail } ) => setUrlParams ( { innerPanelPosition : detail . selectedId as any } ) }
130- />
131- </ FormField >
112+ < FormField label = "Inner panel position" >
113+ < SegmentedControl
114+ options = { [
115+ { id : 'side-start' , text : 'side-start' } ,
116+ { id : 'side-end' , text : 'side-end' } ,
117+ ] }
118+ selectedId = { innerPanelPosition }
119+ onChange = { ( { detail } ) => setUrlParams ( { innerPanelPosition : detail . selectedId as any } ) }
120+ />
121+ </ FormField >
132122
133- < FormField label = "Nested location" >
134- < SegmentedControl
135- options = { [
136- { id : 'panel' , text : 'In panel' } ,
137- { id : 'main' , text : 'In main' } ,
138- ] }
139- selectedId = { nestedLocation }
140- onChange = { ( { detail } ) => setUrlParams ( { nestedLocation : detail . selectedId as any } ) }
141- />
142- </ FormField >
143- </ SpaceBetween >
144- </ SpaceBetween >
145- </ Container >
123+ < FormField label = "Nested location" >
124+ < SegmentedControl
125+ options = { [
126+ { id : 'panel' , text : 'In panel' } ,
127+ { id : 'main' , text : 'In main' } ,
128+ ] }
129+ selectedId = { nestedLocation }
130+ onChange = { ( { detail } ) => setUrlParams ( { nestedLocation : detail . selectedId as any } ) }
131+ />
132+ </ FormField >
133+ </ SpaceBetween >
134+ </ Container >
146135
147- < div style = { { maxHeight : '600px' } } >
148- < NestedPanelLayoutDemo
149- outerPanelPosition = { outerPanelPosition }
150- innerPanelPosition = { innerPanelPosition }
151- nestedLocation = { nestedLocation }
152- />
153- </ div >
154- </ SpaceBetween >
155- </ ScreenshotArea >
156- </ I18nProvider >
136+ < div style = { { maxHeight : '600px' } } >
137+ < NestedPanelLayoutDemo
138+ outerPanelPosition = { outerPanelPosition }
139+ innerPanelPosition = { innerPanelPosition }
140+ nestedLocation = { nestedLocation }
141+ />
142+ </ div >
143+ </ SpaceBetween >
144+ </ SimplePage >
157145 ) ;
158146}
0 commit comments