+ {/* hidden on smaller screens */}
+
-
- {leftMenu.map((entry) => (
-
- ))}
+ {/* hidden on smaller screens (in it's own menu below on smaller screens) */}
+
+
-
+ {/* only shown on small screens */}
+
+ {/* only shown on small screens */}
+
>
);
}
+
+type OrgPagesNavProps = {
+ className?: string;
+};
+const OrgPagesNav: FC
= ({ className }) => {
+ const location = useLocation();
+
+ const leftMenu: Entry[] = useMemo(
+ () => [
+ {
+ title: "Workspaces",
+ link: "/workspaces",
+ alternatives: ["/"],
+ },
+ {
+ title: "Projects",
+ link: `/projects`,
+ alternatives: [] as string[],
+ },
+ ],
+ [],
+ );
+
+ return (
+
+ {leftMenu.map((entry) => (
+
+ ))}
+
+ );
+};
+
+type UserMenuProps = {
+ user?: User;
+ className?: string;
+ withAdminLink?: boolean;
+ withFeedbackLink?: boolean;
+ onFeedback?: () => void;
+};
+const UserMenu: FC = ({ user, className, withAdminLink, withFeedbackLink, onFeedback }) => {
+ const extraSection = useMemo(() => {
+ const items: ContextMenuEntry[] = [];
+
+ if (withAdminLink && user?.rolesOrPermissions?.includes("admin")) {
+ items.push({
+ title: "Admin",
+ link: "/admin",
+ });
+ }
+ if (withFeedbackLink && isGitpodIo()) {
+ items.push({
+ title: "Feedback",
+ onClick: onFeedback,
+ });
+ }
+
+ // Add a separator to the last item
+ if (items.length > 0) {
+ items[items.length - 1].separator = true;
+ }
+
+ return items;
+ }, [onFeedback, user?.rolesOrPermissions, withAdminLink, withFeedbackLink]);
+
+ return (
+
+
+
+
+
+ );
+};
+
+function isSelected(entry: Entry, location: Location) {
+ const all = [entry.link, ...(entry.alternatives || [])].map((l) => l.toLowerCase());
+ const path = location.pathname.toLowerCase();
+ return all.some((n) => n === path || n + "/" === path);
+}
diff --git a/components/dashboard/src/onboarding/UserOnboarding.tsx b/components/dashboard/src/onboarding/UserOnboarding.tsx
index dcc779fcc71c1a..82582d0ac44573 100644
--- a/components/dashboard/src/onboarding/UserOnboarding.tsx
+++ b/components/dashboard/src/onboarding/UserOnboarding.tsx
@@ -7,7 +7,7 @@
import { User } from "@gitpod/gitpod-protocol";
import { FunctionComponent, useCallback, useContext, useState } from "react";
import gitpodIcon from "../icons/gitpod.svg";
-import Separator from "../components/Separator";
+import { Separator } from "../components/Separator";
import { useHistory, useLocation } from "react-router";
import { StepUserInfo } from "./StepUserInfo";
import { UserContext } from "../user-context";