diff --git a/pages/app-layout/controlled-navigation.page.tsx b/pages/app-layout/controlled-navigation.page.tsx deleted file mode 100644 index 612bbd9b57..0000000000 --- a/pages/app-layout/controlled-navigation.page.tsx +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 -import React, { useContext, useEffect, useState } from 'react'; - -import AppLayout, { AppLayoutProps } from '~components/app-layout'; -import Button from '~components/button'; -import Header from '~components/header'; -import SpaceBetween from '~components/space-between'; -import Toggle from '~components/toggle'; - -import AppContext, { AppContextType } from '../app/app-context'; -import ScreenshotArea from '../utils/screenshot-area'; -import { Containers, Navigation } from './utils/content-blocks'; -import labels from './utils/labels'; - -type ControlledNavigationDemoContext = React.Context< - AppContextType<{ - navigationOpen: AppLayoutProps['navigationOpen']; - navigationHide: AppLayoutProps['navigationHide']; - }> ->; - -export default function () { - const { - urlParams: { navigationOpen = true, navigationHide = false }, - setUrlParams, - } = useContext(AppContext as ControlledNavigationDemoContext); - const [resetNeeded, setResetNeeded] = useState(false); - const [navigationEmpty, setNavigationEmpty] = useState(false); - - const Content = ( - <> -
-
- AppLayout where NavigationHide is {navigationHide.toString()} -
-
- - - - setUrlParams({ navigationOpen: e.detail.checked })} - > - Navigation Open - - setUrlParams({ navigationHide: e.detail.checked })} - > - Navigation Hide - - setNavigationEmpty(e.detail.checked)} - > - Navigation Empty - - - - - - - - ); - - useEffect(() => { - if (resetNeeded) { - setTimeout(() => { - setResetNeeded(false); - }, 200); - } - }, [resetNeeded]); - - return ( - - {resetNeeded ? ( - <> - ) : ( - : } - navigationOpen={navigationOpen} - onNavigationChange={e => setUrlParams({ navigationOpen: e.detail.open })} - content={Content} - /> - )} - - ); -}