Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OUI] Removed figma link/icon, Codesandbox link/icon, Sketch link/icon Casc… #164

Merged
merged 3 commits into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 5 additions & 58 deletions src-docs/src/components/guide_page/guide_page_header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -49,15 +43,7 @@ declare global {
}
}

export type GuidePageHeaderProps = {
onToggleLocale: () => {};
selectedLocale: string;
};

export const GuidePageHeader: React.FunctionComponent<GuidePageHeaderProps> = ({
onToggleLocale,
selectedLocale,
}) => {
export const GuidePageHeader: React.FunctionComponent<{}> = () => {
const isMobileSize = useIsWithinBreakpoints(['xs', 's']);

function renderLogo() {
Expand Down Expand Up @@ -92,25 +78,6 @@ export const GuidePageHeader: React.FunctionComponent<GuidePageHeaderProps> = ({
);
}

function renderCodeSandbox() {
const label = 'Codesandbox';
return isMobileSize ? (
<CodeSandboxLink key="codesandbox">
<OuiButtonEmpty size="s" flush="both" iconType="logoCodesandbox">
{label}
</OuiButtonEmpty>
</CodeSandboxLink>
) : (
<OuiToolTip content="Codesandbox" key="codesandbox">
<CodeSandboxLink>
<OuiHeaderSectionItemButton aria-label="Codesandbox">
<OuiIcon type="logoCodesandbox" aria-hidden="true" />
</OuiHeaderSectionItemButton>
</CodeSandboxLink>
</OuiToolTip>
);
}

const [mobilePopoverIsOpen, setMobilePopoverIsOpen] = useState(false);

function renderMobileMenu() {
Expand All @@ -128,34 +95,14 @@ export const GuidePageHeader: React.FunctionComponent<GuidePageHeaderProps> = ({
button={button}
isOpen={mobilePopoverIsOpen}
closePopover={() => setMobilePopoverIsOpen(false)}>
<div className="guideOptionsPopover">
{renderGithub()}
<GuideSketchLink />
<GuideFigmaLink />
{renderCodeSandbox()}
Comment on lines -133 to -135
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these components used anywhere else? If not, can the components themselves be deleted?

</div>
<div className="guideOptionsPopover">{renderGithub()}</div>
</OuiPopover>
);
}

const rightSideItems = isMobileSize
? [
<GuideThemeSelector
onToggleLocale={onToggleLocale}
selectedLocale={selectedLocale}
/>,
renderMobileMenu(),
]
: [
<GuideThemeSelector
onToggleLocale={onToggleLocale}
selectedLocale={selectedLocale}
/>,
renderGithub(),
<GuideSketchLink key="sketch" />,
<GuideFigmaLink key="figma" />,
renderCodeSandbox(),
];
? [<GuideThemeSelector />, renderMobileMenu()]
: [<GuideThemeSelector />, renderGithub()];

return (
<OuiHeader
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,12 @@ 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: () => {};
selectedLocale: string;
context?: any;
};

Expand All @@ -45,8 +40,6 @@ export const GuideThemeSelector: React.FunctionComponent<GuideThemeSelectorProps
// @ts-ignore Context has no type
const GuideThemeSelectorComponent: React.FunctionComponent<GuideThemeSelectorProps> = ({
context,
onToggleLocale,
selectedLocale,
Comment on lines -48 to -49
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these props aren't being used anymore, can they be removed from the props interface?

}) => {
const isMobileSize = useIsWithinBreakpoints(['xs', 's']);
const [isPopoverOpen, setPopover] = useState(false);
Expand Down Expand Up @@ -102,17 +95,6 @@ const GuideThemeSelectorComponent: React.FunctionComponent<GuideThemeSelectorPro
panelPaddingSize="none"
anchorPosition="downRight">
<OuiContextMenuPanel size="s" items={items} />
{location.host.includes('803') && (
<>
<OuiHorizontalRule margin="none" />
<div style={{ padding: 8 }}>
<GuideLocaleSelector
onToggleLocale={onToggleLocale}
selectedLocale={selectedLocale}
/>
</div>
</>
)}
</OuiPopover>
);
};
2 changes: 0 additions & 2 deletions src-docs/src/components/guide_theme_selector/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@
*/

export { GuideThemeSelector } from './guide_theme_selector';
export { GuideFigmaLink } from './guide_figma_link';
export { GuideSketchLink } from './guide_sketch_link';
5 changes: 1 addition & 4 deletions src-docs/src/views/app_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ export class AppView extends Component {
sizes="96x96"
/>
</Helmet>
<GuidePageHeader
onToggleLocale={toggleLocale}
selectedLocale={locale}
/>
<GuidePageHeader />
<OuiPage paddingSize="none">
<OuiErrorBoundary>
<GuidePageChrome
Expand Down
8 changes: 0 additions & 8 deletions src/themes/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down