Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Remove scope icons #451

Merged
merged 1 commit into from
Apr 15, 2024
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
1 change: 0 additions & 1 deletion layouts/DocsPage/DocsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ const DocsPage = ({
icon={icon}
getNewVersionPath={getPath}
latest={latest}
scopes={scopes}
isVersionAgnosticPage={isVersionAgnosticPage(route)}
/>
{videoBanner && (
Expand Down
6 changes: 1 addition & 5 deletions layouts/DocsPage/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ import { useContext } from "react";
import NextImage from "next/image";
import Button from "components/Button";
import Icon from "components/Icon";
import { Scopes } from "./Scopes";
import Versions from "./Versions";
import { DocsContext } from "./context";
import type { IconName } from "components/Icon";
import type { VersionsInfo, ScopesInMeta } from "./types";
import type { VersionsInfo } from "./types";
import styles from "./Header.module.css";
import forkmeUrl from "./assets/forkme.webp";

interface DocHeaderProps {
title: string;
icon?: IconName;
scopes: ScopesInMeta;
githubUrl?: string;
latest?: string;
versions?: VersionsInfo;
Expand All @@ -29,7 +27,6 @@ const DocHeader = ({
versions,
getNewVersionPath,
latest,
scopes,
isVersionAgnosticPage,
}: DocHeaderProps) => {
return (
Expand All @@ -56,7 +53,6 @@ const DocHeader = ({
latest={latest}
/>
)}
<Scopes className={styles.scopes} scopes={scopes} />
</div>
</div>
</section>
Expand Down
30 changes: 0 additions & 30 deletions layouts/DocsPage/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,6 @@ const SCOPE_DICTIONARY: Record<string, ScopeType> = {
cloud2: "cloud",
};

const getScopeIcons = (scopes: ScopesInMeta) => {
if (scopes[0] === "noScope" || scopes[0] === "") {
return;
}

const scopeIcons = Object.keys(SCOPE_DICTIONARY).map(
(scope: "code3" | "building2" | "cloud2") => {
const hideScope = !scopes.includes(SCOPE_DICTIONARY[scope]);
const ariaLabel = hideScope ? "" : SCOPE_DICTIONARY[scope];

return (
<li
className={cn(
styles["scope-item"],
hideScope && styles["non-visible"]
)}
key={scope}
aria-label={ariaLabel}
aria-hidden={hideScope}
>
<Icon name={scope} size="xxs" />
</li>
);
}
);

return <ul className={styles["scope-list"]}>{scopeIcons}</ul>;
};

interface DocsNavigationItemsProps {
entries: NavigationItem[];
onClick: () => void;
Expand Down Expand Up @@ -82,7 +53,6 @@ const DocsNavigationItems = ({
onClick={onClick}
>
{entry.title}
{!!entry.forScopes?.length && getScopeIcons(entry.forScopes)}
{!!entry.entries?.length && (
<Icon size="sm" name="ellipsis" className={styles.ellipsis} />
)}
Expand Down
99 changes: 0 additions & 99 deletions layouts/DocsPage/Scopes.tsx

This file was deleted.

6 changes: 1 addition & 5 deletions pages/older-versions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ const OldVersions = () => {
<SiteHeader />
<main className={styles.wrapper}>
<div className={styles.body}>
<Header
title={title}
scopes={["noScope"]}
isVersionAgnosticPage={true}
/>
<Header title={title} isVersionAgnosticPage={true} />
<div className={styles.content}>
<p>
Deprecated versions of the Teleport docs can be found at the
Expand Down
Loading