diff --git a/src-docs/src/views/panel/panel_example.js b/src-docs/src/views/panel/panel_example.js index 44a0b4be20a..6b934c23706 100644 --- a/src-docs/src/views/panel/panel_example.js +++ b/src-docs/src/views/panel/panel_example.js @@ -134,8 +134,9 @@ export const PanelExample = {

EuiPanel can give depth to your container with{' '} hasShadow while hasBorder can - add containment. Just be sure not to include too many nested panels - with these settings. + add containment. Just be sure not to include too many{' '} + nested panels with these + settings.

For instance, only plain or transparent panels can have a border - and/or shadow. The Amsterdam theme doesn't allow combining - the hasBorder option with{' '} - hasShadow. The default theme only allows - removing the border if both hasShadow and{' '} - hasBorder are set to false. + and/or shadow. The default theme doesn't allow combining the{' '} + hasBorder option with{' '} + hasShadow.

diff --git a/src-docs/src/views/panel/panel_shadow.js b/src-docs/src/views/panel/panel_shadow.js index e304fb0f5c1..e416546703a 100644 --- a/src-docs/src/views/panel/panel_shadow.js +++ b/src-docs/src/views/panel/panel_shadow.js @@ -1,11 +1,15 @@ -import React, { useContext } from 'react'; - -import { EuiPanel, EuiCode, EuiSpacer } from '../../../../src/components'; -import { ThemeContext } from '../../components'; +import React from 'react'; +import { + EuiPanel, + EuiCode, + EuiSpacer, + LEGACY_NAME_KEY, + useEuiTheme, +} from '../../../../src'; export default () => { - const themeContext = useContext(ThemeContext); - const isAmsterdamTheme = !themeContext.theme.includes('legacy'); + const { euiTheme } = useEuiTheme(); + const isLegacyTheme = euiTheme.themeName.includes(LEGACY_NAME_KEY); return (
@@ -15,19 +19,19 @@ export default () => { - {/* This example only works for the Amsterdam theme. The default theme has `hasBorder={true}` by default. */} - {isAmsterdamTheme && ( - <> - - {'hasBorder={true}'} - - - + {/* This example only works for the default theme. The legacy theme has `hasBorder={true}` by default. */} + {!isLegacyTheme && ( + + {'hasBorder={true}'} + )} - - {'hasShadow={false} hasBorder={false}'} - + {/* This example only matters for the legacy theme. The default theme has `hasBorder={false}` by default. */} + {isLegacyTheme && ( + + {'hasShadow={false} hasBorder={false}'} + + )}
); };