Skip to content

Commit

Permalink
🪣 Remove dead pages
Browse files Browse the repository at this point in the history
  • Loading branch information
awtkns committed Nov 1, 2023
1 parent 474ad5a commit ee13449
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 125 deletions.
1 change: 0 additions & 1 deletion next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"@splinetool/react-spline": "^2.2.6",
"@tailwindcss/forms": "^0.5.3",
"@tanstack/react-query": "^4.29.14",
"@tanstack/react-table": "^8.9.3",
"@trpc/client": "^10.21.1",
"@trpc/next": "^10.21.1",
"@trpc/react-query": "^10.21.1",
Expand Down
7 changes: 2 additions & 5 deletions next/src/components/drawer/LeftSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,14 @@ const LeftSidebar = ({ show, setShow, onReload }: DisplayProps & { onReload?: ()
<ul role="list" className="flex flex-col">
<ul className="mb-2">
<div className="mb-2 ml-2 text-xs font-semibold text-slate-10">Pages</div>
{PAGE_LINKS.filter((link) =>
typeof link.enabled === "boolean" ? link.enabled : link.enabled(session?.user)
).map((link, i) => (
{PAGE_LINKS.map((link, i) => (
<LinkItem
key={i}
title={link.name}
href={link.href}
badge={link.badge}
onClick={() => {
console.log(router.pathname, link.href, link.forceRefresh);
if (router.pathname === link.href && link.forceRefresh) {
if (router.pathname === link.href) {
onReload?.();
return;
}
Expand Down
14 changes: 1 addition & 13 deletions next/src/components/sidebar/links.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { User } from "next-auth";
import type { IconType } from "react-icons";
import {
FaBusinessTime,
Expand All @@ -15,50 +14,43 @@ import { FaXTwitter } from "react-icons/fa6";
type LinkMetadata = {
name: string;
href: string;
forceRefresh?: boolean;
icon: IconType;
badge?: {
text: string;
className?: string;
};
className?: string;
enabled: boolean | ((user?: User) => boolean);
};

export const PAGE_LINKS: LinkMetadata[] = [
{
name: "Home",
href: "/",
icon: FaHome,
enabled: true,
forceRefresh: true,
},
{
name: "Help",
href: "https://docs.reworkd.ai/",
icon: FaQuestion,
className: "group-hover:text-red-500",
enabled: true,
},
{
name: "Templates",
href: "/templates",
icon: FaFileCode,
className: "transition-transform group-hover:scale-110",
enabled: true,
},
{
name: "Settings",
href: "/settings",
icon: FaCog,
className: "transition-transform group-hover:rotate-90",
enabled: true,
},
{
name: "Organization",
href: "/organization",
icon: FaBusinessTime,
className: "transition-transform group-hover:scale-110",
enabled: (user) => !!user && user.organizations.length > 0,
},
];

Expand All @@ -67,24 +59,20 @@ export const SOCIAL_LINKS: LinkMetadata[] = [
name: "Github",
href: "https://github.com/reworkd/AgentGPT",
icon: FaGithub,
enabled: true,
},
{
name: "Twitter",
href: "https://twitter.com/ReworkdAI",
icon: FaXTwitter,
enabled: true,
},
{
name: "Discord",
href: "https://discord.gg/gcmNyAAFfV",
icon: FaDiscord,
enabled: true,
},
{
name: "LinkedIn",
href: "https://www.linkedin.com/company/reworkd/",
icon: FaLinkedin,
enabled: true,
},
];
2 changes: 1 addition & 1 deletion next/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const Home: NextPage = () => {
<div id="content" className="flex min-h-screen w-full items-center justify-center">
<div
id="layout"
className="relative flex h-screen w-full max-w-screen-md flex-col items-center justify-center gap-5 p-2 py-10 sm:gap-3 sm:p-4"
className="relative flex h-screen w-full max-w-screen-md flex-col items-center justify-center gap-5 overflow-hidden p-2 py-10 sm:gap-3 sm:p-4"
>
{agent !== null ? (
<Chat
Expand Down
74 changes: 0 additions & 74 deletions next/src/pages/org/[org].tsx

This file was deleted.

31 changes: 0 additions & 31 deletions next/src/ui/table.tsx

This file was deleted.

0 comments on commit ee13449

Please sign in to comment.