Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

fix: added doc link, dashboard link, user signout (#96)

Aman Agarwalc62b9ee7dccc
diff --git a/src/client/public/images/doku-logo-with-name.png b/src/client/public/images/doku-logo-with-name.png
index 4de6c082..91e792ad 100644
Binary files a/src/client/public/images/doku-logo-with-name.png and b/src/client/public/images/doku-logo-with-name.png differ
diff --git a/src/client/src/components/(landing-page)/components/hero.tsx b/src/client/src/components/(landing-page)/components/hero.tsx
index bc7d14b2..f854d77d 100644
--- a/src/client/src/components/(landing-page)/components/hero.tsx
+++ b/src/client/src/components/(landing-page)/components/hero.tsx
@@ -27,6 +27,14 @@ export default function Hero() {
Github repository <span aria-hidden="true">→</span>
</a>
</div>
+ <div className="mt-6 flex items-center justify-center gap-x-6">
+ <a
+ href={"/dashboard"}
+ className={`flex items-center rounded-md px-8 py-2 text-sm font-medium bg-primary/[0.1] text-primary text-center`}
+ >
+ <span className="block">Go to dashboard</span>
+ </a>
+ </div>
</div>
</div>
<div
diff --git a/src/client/src/components/(landing-page)/components/navbar.tsx b/src/client/src/components/(landing-page)/components/navbar.tsx
index 44fca7de..8613fa65 100644
--- a/src/client/src/components/(landing-page)/components/navbar.tsx
+++ b/src/client/src/components/(landing-page)/components/navbar.tsx
@@ -12,19 +12,27 @@ export default function Navbar() {
width={836}
height={298}
/>
- <a
- href={"https://github.com/dokulabs/doku"}
- className={`flex items-center rounded-md px-3 py-2 text-sm font-medium bg-tertiary text-white`}
- >
- <Image
- alt="github"
- className="invert"
- src="/images/github-mark.svg"
- width={20}
- height={20}
- />
- <span className="hidden sm:ml-3 sm:block">Github</span>
- </a>
+ <div className="flex h-16 items-center justify-between space-x-4">
+ <a
+ href={"/dashboard"}
+ className={`flex items-center rounded-md px-3 py-2 text-sm font-medium bg-primary/[0.1] text-primary text-center`}
+ >
+ <span className="block">Go to dashboard</span>
+ </a>
+ <a
+ href={"https://github.com/dokulabs/doku"}
+ className={`flex items-center rounded-md px-3 py-2 text-sm font-medium bg-tertiary text-white`}
+ >
+ <Image
+ alt="github"
+ className="invert"
+ src="/images/github-mark.svg"
+ width={20}
+ height={20}
+ />
+ <span className="hidden sm:ml-3 sm:block">Github</span>
+ </a>
+ </div>
</div>
</div>
</div>
diff --git a/src/client/src/components/(playground)/header.tsx b/src/client/src/components/(playground)/header.tsx
index eba2f459..c7e4e9f4 100644
--- a/src/client/src/components/(playground)/header.tsx
+++ b/src/client/src/components/(playground)/header.tsx
@@ -1,13 +1,38 @@
"use client";
import { usePathname } from "next/navigation";
+import { signOut } from "next-auth/react";
+import Dropdown from "../common/drop-down";
+
+function UserDropdownTrigger() {
+ return (
+ <span className="w-6 h-6 rounded-full bg-tertiary/[0.3] shadow overflow-hidden">
+ <svg
+ className="w-full h-full text-secondary"
+ fill="currentColor"
+ viewBox="0 0 24 24"
+ >
+ <path d="M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z"></path>
+ </svg>
+ </span>
+ );
+}
export default function Header() {
const pathname = usePathname();
return (
- <div className="relative flex shrink-0 px-4 p-3 mb-3 border-b border-secondary text-tertiary">
+ <div className="relative flex shrink-0 px-4 p-3 mb-3 border-b border-secondary text-tertiary items-center">
<div className="flex flex-1 overflow-y-auto capitalize text-xl font-semibold">
{pathname.substring(1).replaceAll("-", " ")}
</div>
+ <Dropdown
+ triggerComponent={<UserDropdownTrigger />}
+ itemList={[
+ {
+ label: "Signout",
+ onClick: signOut,
+ },
+ ]}
+ />
</div>
);
}
diff --git a/src/client/src/components/(playground)/sidebar.tsx b/src/client/src/components/(playground)/sidebar.tsx
index 076ec992..477f6ffd 100644
--- a/src/client/src/components/(playground)/sidebar.tsx
+++ b/src/client/src/components/(playground)/sidebar.tsx
@@ -1,6 +1,5 @@
"use client";
-import { signOut } from "next-auth/react";
import { ReactElement } from "react";
import {
AcademicCapIcon,
@@ -18,6 +17,7 @@ type SidebarItemProps = {
text: string;
link?: string;
onClick?: any;
+ target?: string;
};
const ICON_CLASSES =
@@ -53,8 +53,10 @@ const SIDEBAR_ITEMS: SidebarItemProps[] = [
const SIDEBAR_BOTTOM_ITEMS: SidebarItemProps[] = [
{
- text: "Signout",
- onClick: signOut,
+ text: "Documentation",
+ link: "https://docs.dokulabs.com/",
+ target: "_blank",
+ className: "justify-center text-sm text-primary hover:bg-primary/[0.1]"
},
];
@@ -66,6 +68,7 @@ const SidebarItem = (props: SidebarItemProps) => {
props.className || ""
}`}
onClick={props.onClick}
+ target={props.target}
>
{props.icon}
<span className={`${props.icon && "ml-5"} text-nowrap`}>
@@ -90,7 +93,7 @@ export default function Sidebar() {
link="/"
icon={
<Image
- className="flex-shrink-0 w-6 h-6 transition duration-75"
+ className="flex-shrink-0 w-8 h-8 transition duration-75 -mr-2"
src="/images/logo.png"
alt="Doku's Logo"
priority
@@ -109,7 +112,7 @@ export default function Sidebar() {
className={
item.link === pathname
? "border-r-4 border-primary text-primary bg-primary/[.09]"
- : "text-tertiary/[0.9] hover:text-primary"
+ : "text-tertiary/[0.8] hover:text-primary"
}
{...item}
/>
@@ -123,7 +126,7 @@ export default function Sidebar() {
className={
item.link === pathname
? "border-r-4 border-primary text-primary bg-primary/[.09]"
- : "text-tertiary/[0.5] justify-center"
+ : "text-tertiary/[0.5] justify-center text-sm"
}
{...item}
/>
diff --git a/src/client/src/components/common/drop-down.tsx b/src/client/src/components/common/drop-down.tsx
new file mode 100644
index 00000000..1817ac9e
--- /dev/null
+++ b/src/client/src/components/common/drop-down.tsx
@@ -0,0 +1,48 @@
+import { Fragment, ReactNode } from "react";
+import { Menu, Transition } from "@headlessui/react";
+
+export default function Dropdown({
+ triggerComponent,
+ itemList,
+}: {
+ triggerComponent: ReactNode;
+ itemList: { label: string; onClick?: any; href?: string }[];
+}) {
+ return (
+ <Menu as="div" className="relative flex text-left">
+ <Menu.Button className="inline-flex w-full justify-center">
+ {triggerComponent}
+ </Menu.Button>
+
+ <Transition
+ as={Fragment}
+ enter="transition ease-out duration-100"
+ enterFrom="transform opacity-0 scale-95"
+ enterTo="transform opacity-100 scale-100"
+ leave="transition ease-in duration-75"
+ leaveFrom="transform opacity-100 scale-100"
+ leaveTo="transform opacity-0 scale-95"
+ >
+ <Menu.Items className="absolute right-0 top-full z-30 rounded-sm mt-3 bg-white shadow ring-1 ring-tertiary ring-opacity-5 focus:outline-none text-center cursor-pointer">
+ <div className="py-1">
+ {itemList.map(({ label, onClick, href }, index) => (
+ <Menu.Item key={`item-${index}`}>
+ {({ active }) => (
+ <a
+ className={`block px-5 py-1 text-sm text-tertiary/[0.7] hover:bg-secondary ${
+ active ? "bg-secondary/[0.6]" : ""
+ }`}
+ href={href}
+ onClick={onClick}
+ >
+ {label}
+ </a>
+ )}
+ </Menu.Item>
+ ))}
+ </div>
+ </Menu.Items>
+ </Transition>
+ </Menu>
+ );
+}