Skip to content

Commit

Permalink
Update breadcrumbs per designs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dartoxian committed Dec 5, 2023
1 parent 583d2e5 commit 0c9f5d9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
14 changes: 5 additions & 9 deletions enclave-manager/web/src/components/KurtosisBreadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,11 @@ type KurtosisBreadcrumbItemProps = KurtosisBreadcrumb & {
};

const KurtosisBreadcrumbItem = ({ name, destination, alternatives, isLastItem }: KurtosisBreadcrumbItemProps) => {
if (isLastItem) {
return (
<Text fontSize={"xs"} fontWeight={"semibold"} p={"2px 8px"} borderRadius={"6px"} bg={"gray.650"}>
{name}
</Text>
);
}

const baseLink = (
const baseLink = isLastItem ? (
<Text fontSize={"xs"} fontWeight={"semibold"} p={"2px 8px"} borderRadius={"6px"} bg={"gray.650"}>
{name}
</Text>
) : (
<BreadcrumbLink as={Link} to={destination}>
<Button variant={"breadcrumb"} size={"xs"}>
{name}
Expand Down
15 changes: 10 additions & 5 deletions enclave-manager/web/src/emui/enclaves/EnclaveRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FilesArtifactNameAndUuid, ServiceInfo } from "enclave-manager-sdk/build
import { FiPlus } from "react-icons/fi";
import { Outlet, Params } from "react-router-dom";
import { GoToEnclaveOverviewButton } from "../../components/enclaves/GotToEncalaveOverviewButton";
import { isDefined } from "../../utils";
import { RemoveFunctions } from "../../utils/types";
import { KurtosisEnclavesRouteObject } from "../types";
import { Artifact } from "./enclave/artifact/Artifact";
Expand Down Expand Up @@ -96,13 +97,13 @@ export const enclaveRoutes = (): KurtosisEnclavesRouteObject[] => [
crumb: (data: RemoveFunctions<EnclavesState>, params: Params<string>) => {
const activeTab = params.activeTab;

let routeName = activeTab?.toLowerCase() === "logs" ? "Logs" : "Overview";
if (!isDefined(activeTab) || activeTab.toLowerCase() === "overview") {
return [];
}

return {
name: routeName,
destination: `/enclave/${params.enclaveUUID}/service/${params.serviceUUID}/${
params.activeTab || "overview"
}`,
name: "Logs",
destination: `/enclave/${params.enclaveUUID}/service/${params.serviceUUID}/logs`,
};
},
},
Expand Down Expand Up @@ -170,6 +171,10 @@ export const enclaveRoutes = (): KurtosisEnclavesRouteObject[] => [
crumb: (data: RemoveFunctions<EnclavesState>, params: Params<string>) => {
const activeTab = params.activeTab;

if (!isDefined(activeTab) || activeTab.toLowerCase() === "overview") {
return [];
}

let routeName =
activeTab?.toLowerCase() === "logs"
? "Logs"
Expand Down

0 comments on commit 0c9f5d9

Please sign in to comment.