Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
powercasgamer committed Jul 1, 2024
1 parent 8aca708 commit 5358f63
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/config/ConfigurationStructureDiagram.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from "react";
import "@site/src/css/configuration-explorer-layout.css";
// @ts-ignore
import { Icon } from "@iconify/react";
import Link from "@docusaurus/Link";
import clsx from "clsx";
Expand All @@ -13,6 +14,7 @@ interface ExplorerNode {
children?: ExplorerNode[];
description?: string;
url?: string;
external?: boolean;
}

const folderData: ExplorerNode[] = [
Expand Down Expand Up @@ -44,6 +46,7 @@ const folderData: ExplorerNode[] = [
type: "folder",
description: "Used to store remapped plugins. (Learn more)",
url: "https://forums.papermc.io/threads/important-dev-psa-future-removal-of-cb-package-relocation.1106/",
external: true,
},
],
},
Expand Down Expand Up @@ -130,6 +133,7 @@ export default function ConfigurationStructureDiagram(): JSX.Element {
const isFolder = node.type === "folder";
const hasDescription = "description" in node;
const hasUrl = "url" in node;
const isExternal = node.external;

const handleNodeOpening = (event: React.MouseEvent) => {
event.stopPropagation();
Expand All @@ -150,7 +154,8 @@ export default function ConfigurationStructureDiagram(): JSX.Element {
className={clsx(
!isFolder && "config-explorer-file-node",
isFolder && "config-explorer-file-folder-node",
hasUrl && "config-explorer-file-node-with-link"
hasUrl && "config-explorer-file-node-with-link",
isExternal && "config-explorer-file-folder-node-with-link",
)}
to={node.url}
>
Expand Down
13 changes: 13 additions & 0 deletions src/css/configuration-explorer-layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@
color: var(--config-node-highlight-text-color);
}

/* File Folder Node with Link */
.config-explorer-file-folder-node-with-link {
font-weight: bold;
color: var(--ifm-link-color);
}

.config-explorer-file-folder-node-with-link:hover {
background-color: rgba(0, 0, 0, 0.1);
cursor: pointer;
text-decoration: none;
color: var(--ifm-link-color);
}

/* Popup Window Container */
.config-explorer-popup-window-container {
position: absolute;
Expand Down

0 comments on commit 5358f63

Please sign in to comment.