From d35f077f5af490a230c6b716d33abc9e078e9ba1 Mon Sep 17 00:00:00 2001 From: AbhishekReddy1127 Date: Fri, 23 Dec 2022 01:04:42 +0000 Subject: [PATCH 1/2] Removed figma link/icon, Codesandbox link/icon, Sketch link/icon Cascadia options from the theme dropdown Signed-off-by: AbhishekReddy1127 --- .../guide_page/guide_page_header.tsx | 37 +------------------ .../guide_theme_selector.tsx | 16 -------- src/themes/themes.ts | 8 ---- 3 files changed, 2 insertions(+), 59 deletions(-) diff --git a/src-docs/src/components/guide_page/guide_page_header.tsx b/src-docs/src/components/guide_page/guide_page_header.tsx index 12ea673f97..637f202063 100644 --- a/src-docs/src/components/guide_page/guide_page_header.tsx +++ b/src-docs/src/components/guide_page/guide_page_header.tsx @@ -24,14 +24,8 @@ import { OuiPopover } from '../../../../src/components/popover'; import { useIsWithinBreakpoints } from '../../../../src/services/hooks'; import { OuiButtonEmpty } from '../../../../src/components/button'; -// @ts-ignore Not TS -import { CodeSandboxLink } from '../../components/codesandbox/link'; import logoOUI from '../../images/logo-oui.svg'; -import { - GuideThemeSelector, - GuideSketchLink, - GuideFigmaLink, -} from '../guide_theme_selector'; +import { GuideThemeSelector } from '../guide_theme_selector'; const pkg = require('../../../../package.json'); @@ -92,25 +86,6 @@ export const GuidePageHeader: React.FunctionComponent = ({ ); } - function renderCodeSandbox() { - const label = 'Codesandbox'; - return isMobileSize ? ( - - - {label} - - - ) : ( - - - - - - - ); - } - const [mobilePopoverIsOpen, setMobilePopoverIsOpen] = useState(false); function renderMobileMenu() { @@ -128,12 +103,7 @@ export const GuidePageHeader: React.FunctionComponent = ({ button={button} isOpen={mobilePopoverIsOpen} closePopover={() => setMobilePopoverIsOpen(false)}> -
- {renderGithub()} - - - {renderCodeSandbox()} -
+
{renderGithub()}
); } @@ -152,9 +122,6 @@ export const GuidePageHeader: React.FunctionComponent = ({ selectedLocale={selectedLocale} />, renderGithub(), - , - , - renderCodeSandbox(), ]; return ( diff --git a/src-docs/src/components/guide_theme_selector/guide_theme_selector.tsx b/src-docs/src/components/guide_theme_selector/guide_theme_selector.tsx index 0156c19025..011dbcda90 100644 --- a/src-docs/src/components/guide_theme_selector/guide_theme_selector.tsx +++ b/src-docs/src/components/guide_theme_selector/guide_theme_selector.tsx @@ -18,13 +18,10 @@ import { OuiContextMenuItem, } from '../../../../src/components/context_menu'; import { OuiPopover } from '../../../../src/components/popover'; -import { OuiHorizontalRule } from '../../../../src/components/horizontal_rule'; import { useIsWithinBreakpoints } from '../../../../src/services/hooks/useIsWithinBreakpoints'; import { OUI_THEME, OUI_THEMES } from '../../../../src/themes'; import { ThemeContext } from '../with_theme'; -// @ts-ignore Not TS -import { GuideLocaleSelector } from '../guide_locale_selector'; type GuideThemeSelectorProps = { onToggleLocale: () => {}; @@ -45,8 +42,6 @@ export const GuideThemeSelector: React.FunctionComponent = ({ context, - onToggleLocale, - selectedLocale, }) => { const isMobileSize = useIsWithinBreakpoints(['xs', 's']); const [isPopoverOpen, setPopover] = useState(false); @@ -102,17 +97,6 @@ const GuideThemeSelectorComponent: React.FunctionComponent - {location.host.includes('803') && ( - <> - -
- -
- - )} ); }; diff --git a/src/themes/themes.ts b/src/themes/themes.ts index d467dc0b0f..94b1bd5172 100644 --- a/src/themes/themes.ts +++ b/src/themes/themes.ts @@ -42,14 +42,6 @@ export const OUI_THEMES: OUI_THEME[] = [ text: 'Dark', value: 'dark', }, - { - text: 'Cascadia: Light', - value: 'cascadia-light', - }, - { - text: 'Cascadia: Dark', - value: 'cascadia-dark', - }, ]; /* OUI -> EUI Aliases */ From 9e6bd8f40bcbbaf843a168d063036965b717b97b Mon Sep 17 00:00:00 2001 From: AbhishekReddy1127 Date: Wed, 4 Jan 2023 00:23:54 +0000 Subject: [PATCH 2/2] Deleted guidefigmalink and guidesketch link Signed-off-by: AbhishekReddy1127 --- .../guide_page/guide_page_header.tsx | 26 +------ .../guide_theme_selector/guide_figma_link.tsx | 69 ------------------- .../guide_sketch_link.tsx | 68 ------------------ .../guide_theme_selector.tsx | 2 - .../components/guide_theme_selector/index.ts | 2 - src-docs/src/views/app_view.js | 5 +- 6 files changed, 4 insertions(+), 168 deletions(-) delete mode 100644 src-docs/src/components/guide_theme_selector/guide_figma_link.tsx delete mode 100644 src-docs/src/components/guide_theme_selector/guide_sketch_link.tsx diff --git a/src-docs/src/components/guide_page/guide_page_header.tsx b/src-docs/src/components/guide_page/guide_page_header.tsx index 637f202063..3e40ae9266 100644 --- a/src-docs/src/components/guide_page/guide_page_header.tsx +++ b/src-docs/src/components/guide_page/guide_page_header.tsx @@ -43,15 +43,7 @@ declare global { } } -export type GuidePageHeaderProps = { - onToggleLocale: () => {}; - selectedLocale: string; -}; - -export const GuidePageHeader: React.FunctionComponent = ({ - onToggleLocale, - selectedLocale, -}) => { +export const GuidePageHeader: React.FunctionComponent<{}> = () => { const isMobileSize = useIsWithinBreakpoints(['xs', 's']); function renderLogo() { @@ -109,20 +101,8 @@ export const GuidePageHeader: React.FunctionComponent = ({ } const rightSideItems = isMobileSize - ? [ - , - renderMobileMenu(), - ] - : [ - , - renderGithub(), - ]; + ? [, renderMobileMenu()] + : [, renderGithub()]; return ( = () => { - return ( - - {(context) => } - - ); -}; - -// @ts-ignore Context has no type -const GuideFigmaLinkComponent: React.FunctionComponent = ({ - context, -}) => { - const isMobileSize = useIsWithinBreakpoints(['xs', 's']); - - const isCascadia = context.theme.includes('cascadia'); - - // ToDo: Fix the Figma links - let href = 'https://www.figma.com/community/file/809845546262698150'; - const label = 'OUI Figma Design Library'; - - if (isCascadia) { - href = 'https://www.figma.com/community/file/964536385682658129'; - } - - return isMobileSize ? ( - - {label} - - ) : ( - - - - - ); -}; diff --git a/src-docs/src/components/guide_theme_selector/guide_sketch_link.tsx b/src-docs/src/components/guide_theme_selector/guide_sketch_link.tsx deleted file mode 100644 index c8228eef97..0000000000 --- a/src-docs/src/components/guide_theme_selector/guide_sketch_link.tsx +++ /dev/null @@ -1,68 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* eslint-disable no-restricted-globals */ -import React from 'react'; - -import { OuiButtonEmpty } from '../../../../src/components/button'; -import { useIsWithinBreakpoints } from '../../../../src/services/hooks/useIsWithinBreakpoints'; - -import { ThemeContext } from '../with_theme'; -import { OuiHeaderSectionItemButton } from '../../../../src/components/header'; -import { OuiToolTip } from '../../../../src/components/tool_tip'; -import { OuiIcon } from '../../../../src/components/icon'; - -type GuideSketchLinkProps = { - context?: any; -}; - -export const GuideSketchLink: React.FunctionComponent = () => { - return ( - - {(context) => } - - ); -}; - -// @ts-ignore Context has no type -const GuideSketchLinkComponent: React.FunctionComponent = ({ - context, -}) => { - const isMobileSize = useIsWithinBreakpoints(['xs', 's']); - - // ToDo: Fix link or redo this interface - const href = - 'https://github.com/elastic/eui/releases/download/v8.0.0/eui_sketch_8.0.0.zip'; - const label = 'OUI Sketch Library (download)'; - - const isCascadia = context.theme.includes('cascadia'); - - if (isCascadia) return <>; - - return isMobileSize ? ( - - {label} - - ) : ( - - - - - ); -}; diff --git a/src-docs/src/components/guide_theme_selector/guide_theme_selector.tsx b/src-docs/src/components/guide_theme_selector/guide_theme_selector.tsx index 011dbcda90..07a53fcb7d 100644 --- a/src-docs/src/components/guide_theme_selector/guide_theme_selector.tsx +++ b/src-docs/src/components/guide_theme_selector/guide_theme_selector.tsx @@ -24,8 +24,6 @@ import { OUI_THEME, OUI_THEMES } from '../../../../src/themes'; import { ThemeContext } from '../with_theme'; type GuideThemeSelectorProps = { - onToggleLocale: () => {}; - selectedLocale: string; context?: any; }; diff --git a/src-docs/src/components/guide_theme_selector/index.ts b/src-docs/src/components/guide_theme_selector/index.ts index 9e20c0a7ec..59280e3ffd 100644 --- a/src-docs/src/components/guide_theme_selector/index.ts +++ b/src-docs/src/components/guide_theme_selector/index.ts @@ -10,5 +10,3 @@ */ export { GuideThemeSelector } from './guide_theme_selector'; -export { GuideFigmaLink } from './guide_figma_link'; -export { GuideSketchLink } from './guide_sketch_link'; diff --git a/src-docs/src/views/app_view.js b/src-docs/src/views/app_view.js index 6d1411cd89..023d158871 100644 --- a/src-docs/src/views/app_view.js +++ b/src-docs/src/views/app_view.js @@ -86,10 +86,7 @@ export class AppView extends Component { sizes="96x96" /> - +