diff --git a/examples/bfetch_explorer/public/components/page/index.tsx b/examples/bfetch_explorer/public/components/page/index.tsx index b4ce0806b1356..921f4b5fa1635 100644 --- a/examples/bfetch_explorer/public/components/page/index.tsx +++ b/examples/bfetch_explorer/public/components/page/index.tsx @@ -7,34 +7,23 @@ */ import * as React from 'react'; -import { - EuiPageBody, - EuiPageContent_Deprecated as EuiPageContent, - EuiPageContentBody_Deprecated as EuiPageContentBody, - EuiPageHeader, - EuiPageHeaderSection, - EuiTitle, -} from '@elastic/eui'; +import { EuiPageTemplate, EuiPageSection, EuiPageHeader } from '@elastic/eui'; export interface PageProps { title?: React.ReactNode; + sidebar?: React.ReactNode; } -export const Page: React.FC = ({ title = 'Untitled', children }) => { +export const Page: React.FC = ({ title = 'Untitled', sidebar, children }) => { return ( - - - - -

{title}

-
-
-
- - - {children} - - -
+ + {sidebar} + + + + + {children} + + ); }; diff --git a/examples/bfetch_explorer/public/containers/app/index.tsx b/examples/bfetch_explorer/public/containers/app/index.tsx index 54395ff4eb46d..1c6c6c208f7b1 100644 --- a/examples/bfetch_explorer/public/containers/app/index.tsx +++ b/examples/bfetch_explorer/public/containers/app/index.tsx @@ -11,7 +11,6 @@ import { Redirect } from 'react-router-dom'; import { BrowserRouter as Router, Route, Routes } from '@kbn/shared-ux-router'; import { EuiPage } from '@elastic/eui'; import { useDeps } from '../../hooks/use_deps'; -import { Sidebar } from './sidebar'; import { routes } from '../../routes'; export const App: React.FC = () => { @@ -27,7 +26,6 @@ export const App: React.FC = () => { return ( - {routeElements} diff --git a/examples/bfetch_explorer/public/containers/app/pages/page_count_until/index.tsx b/examples/bfetch_explorer/public/containers/app/pages/page_count_until/index.tsx index 75a20904256b5..b0ed74a570bb4 100644 --- a/examples/bfetch_explorer/public/containers/app/pages/page_count_until/index.tsx +++ b/examples/bfetch_explorer/public/containers/app/pages/page_count_until/index.tsx @@ -11,6 +11,7 @@ import { EuiPanel, EuiText } from '@elastic/eui'; import { CountUntil } from '../../../../components/count_until'; import { Page } from '../../../../components/page'; import { useDeps } from '../../../../hooks/use_deps'; +import { Sidebar } from '../../sidebar'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Props {} @@ -19,7 +20,7 @@ export const PageCountUntil: React.FC = () => { const { plugins } = useDeps(); return ( - + }> This demo sends a single number N using fetchStreaming to the server. The server will stream back N number of messages with 1 second delay each containing a number diff --git a/examples/bfetch_explorer/public/containers/app/pages/page_double_integers/index.tsx b/examples/bfetch_explorer/public/containers/app/pages/page_double_integers/index.tsx index 126e099098cee..0af8218708cbb 100644 --- a/examples/bfetch_explorer/public/containers/app/pages/page_double_integers/index.tsx +++ b/examples/bfetch_explorer/public/containers/app/pages/page_double_integers/index.tsx @@ -11,6 +11,7 @@ import { EuiPanel, EuiText } from '@elastic/eui'; import { DoubleIntegers } from '../../../../components/double_integers'; import { Page } from '../../../../components/page'; import { useDeps } from '../../../../hooks/use_deps'; +import { Sidebar } from '../../sidebar'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Props {} @@ -19,7 +20,7 @@ export const PageDoubleIntegers: React.FC = () => { const { explorer } = useDeps(); return ( - + }> Below is a list of numbers in milliseconds. They are sent as a batch to the server. For each number server waits given number of milliseconds then doubles the number and streams it diff --git a/examples/bfetch_explorer/public/containers/app/sidebar/index.tsx b/examples/bfetch_explorer/public/containers/app/sidebar/index.tsx index fe0902f88f321..dfd17d18388ae 100644 --- a/examples/bfetch_explorer/public/containers/app/sidebar/index.tsx +++ b/examples/bfetch_explorer/public/containers/app/sidebar/index.tsx @@ -7,7 +7,7 @@ */ import React from 'react'; -import { EuiPageSideBar_Deprecated as EuiPageSideBar, EuiSideNav } from '@elastic/eui'; +import { EuiSideNav } from '@elastic/eui'; import { useHistory } from 'react-router-dom'; import { routes } from '../../../routes'; @@ -18,26 +18,24 @@ export const Sidebar: React.FC = () => { const history = useHistory(); return ( - - ({ - id, - name: title, - isSelected: true, - items: items.map((route) => ({ - id: route.id, - name: route.title, - onClick: () => history.push(`/${route.id}`), - 'data-test-subj': route.id, - })), + ({ + id, + name: title, + isSelected: true, + items: items.map((route) => ({ + id: route.id, + name: route.title, + onClick: () => history.push(`/${route.id}`), + 'data-test-subj': route.id, })), - }, - ]} - /> - + })), + }, + ]} + /> ); };