Refactor various components and configuration for mobile responsiveness. (#1679)

This commit is contained in:
Bram Suurd 2025-01-22 20:36:51 +01:00 committed by GitHub
parent 3b14ea76ad
commit 2ba35bbee5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 191 additions and 196 deletions

View file

@ -1,45 +1,51 @@
import { OperatingSystem } from "@/lib/types";
import { MessagesSquare, Scroll } from "lucide-react";
import { FaDiscord, FaGithub } from "react-icons/fa";
import React from "react";
import { FaDiscord, FaGithub } from "react-icons/fa";
export const basePath = process.env.BASE_PATH;
const isMobile = typeof window !== "undefined" && window.innerWidth < 640;
export const navbarLinks = [
{
href: `https://github.com/community-scripts/${basePath}`,
event: "Github",
icon: <FaGithub className="h-4 w-4" />,
text: "Github",
},
{
href: `https://discord.gg/2wvnMDgdnU`,
event: "Discord",
icon: <FaDiscord className="h-4 w-4" />,
text: "Discord",
},
{
href: `https://github.com/community-scripts/${basePath}/blob/main/CHANGELOG.md`,
event: "Change Log",
icon: <Scroll className="h-4 w-4" />,
text: "Change Log",
},
!isMobile
? {
href: `https://github.com/community-scripts/${basePath}/discussions`,
event: "Discussions",
icon: <MessagesSquare className="h-4 w-4" />,
text: "Discussions",
}
: null,
].filter(Boolean) as { href: string; event: string; icon: React.ReactNode; text: string }[];
{
href: `https://github.com/community-scripts/${basePath}`,
event: "Github",
icon: <FaGithub className="h-4 w-4" />,
text: "Github",
},
{
href: `https://discord.gg/2wvnMDgdnU`,
event: "Discord",
icon: <FaDiscord className="h-4 w-4" />,
text: "Discord",
},
{
href: `https://github.com/community-scripts/${basePath}/blob/main/CHANGELOG.md`,
event: "Change Log",
icon: <Scroll className="h-4 w-4" />,
text: "Change Log",
mobileHidden: true,
},
{
href: `https://github.com/community-scripts/${basePath}/discussions`,
event: "Discussions",
icon: <MessagesSquare className="h-4 w-4" />,
text: "Discussions",
mobileHidden: true,
},
].filter(Boolean) as {
href: string;
event: string;
icon: React.ReactNode;
text: string;
mobileHidden?: boolean;
}[];
export const mostPopularScripts = [
"Proxmox VE Post Install",
"Docker",
"Home Assistant OS",
"Proxmox VE Post Install",
"Docker",
"Home Assistant OS",
];
export const analytics = {