Skip to content

Commit

Permalink
Rework Title page to have direct links
Browse files Browse the repository at this point in the history
  • Loading branch information
olijeffers0n committed May 26, 2024
1 parent 8d08c95 commit be3d6e7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 13 deletions.
42 changes: 31 additions & 11 deletions src/components/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,29 @@ const projects: Project[] = [
description:
"High performance Minecraft server that aims to fix gameplay and mechanics inconsistencies.",
repo: "PaperMC/Paper",
link: "/paper",
modules: [
{ name: "Administration", link: "/paper/admin" },
{ name: "Development", link: "/paper/dev" },
{ name: "Contributing", link: "/paper/contributing" },
],
},
{
title: "Folia",
description: "A fork of Paper which adds regionized multithreading to the dedicated server.",
repo: "PaperMC/Folia",
link: "/folia",
modules: [
{ name: "Administration", link: "/folia/admin" },
{ name: "Development", link: "/folia/dev" },
],
},
{
title: "Velocity",
description: "The modern, next-generation Minecraft server proxy.",
repo: "PaperMC/Velocity",
link: "/velocity",
modules: [
{ name: "Administration", link: "/velocity/admin" },
{ name: "Development", link: "/velocity/dev" },
],
},
{
title: "Miscellaneous",
Expand All @@ -43,7 +53,7 @@ const projects: Project[] = [
function Project(project: Project) {
return (
<div className={"project"}>
<div className={"flex"}>
<div>
<Link
className={clsx("projectGitHub", project.eol && "archivedProjectTitle")}
to={`https://github.com/${project.repo}`}
Expand All @@ -54,12 +64,16 @@ function Project(project: Project) {
<p>{project.description}</p>
</div>
<div>
<Link
className={clsx("button button--primary", project.eol && "archivedProjectButton")}
to={project.link}
>
Go
</Link>
{project.modules?.map((module, index) => (
<Link key={index} className={"button button--primary"} to={module.link}>
{module.name}
</Link>
))}
{project.link && (
<Link className={"button button--primary"} to={project.link}>
Go
</Link>
)}
</div>
</div>
);
Expand All @@ -81,6 +95,12 @@ interface Project {
title: string;
description: string;
repo: string;
link: string;
link?: string;
modules?: Module[];
eol?: boolean;
}

interface Module {
name: string;
link: string;
}
12 changes: 11 additions & 1 deletion src/css/projects.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
border: 1px solid var(--ifm-color-emphasis-300);
padding: var(--ifm-global-spacing);
margin: 24px 0;
align-items: center;
justify-content: space-between;
}

.project p {
Expand All @@ -17,6 +17,16 @@
margin: 0;
}

.project div {
display: flex;
flex-direction: column;
justify-content: space-evenly;
}

.project a + a {
margin-top: 0.5em;
}

.projectGitHub {
color: var(--ifm-link-color);
font-size: 1rem;
Expand Down
1 change: 0 additions & 1 deletion src/theme/Navbar/Content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export default function NavbarContent(): JSX.Element {
item.activeBaseRegex && item.modules &&
new RegExp(item.activeBaseRegex).test(document.location.pathname)
) {
console.log("NavbarContent: item.activeBaseRegex", item.activeBaseRegex)
leftItems = item.modules;
}
}
Expand Down

0 comments on commit be3d6e7

Please sign in to comment.