Skip to content

Commit

Permalink
Make the version number a badge, rather than an independent item in t…
Browse files Browse the repository at this point in the history
…he nav dropdown
  • Loading branch information
sabaimran committed Dec 9, 2024
1 parent eb36492 commit 4b4e0e2
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/interface/web/app/components/navMenu/navMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ function SubscriptionBadge({ is_active }: { is_active: boolean }) {
);
}

function VersionBadge({ version }: { version: string }) {
return (
<div className="flex flex-row items-center">
<div className="w-3 h-3 rounded-full bg-green-500 mr-1"></div>
<p className="text-xs">{version}</p>
</div>
);
}

export default function NavMenu() {
const userData = useAuthenticatedData();
const [darkMode, setDarkMode] = useState(false);
Expand Down Expand Up @@ -99,6 +108,9 @@ export default function NavMenu() {
<div className="flex flex-col">
<p className="font-semibold">{userData?.email}</p>
<SubscriptionBadge is_active={userData?.is_active ?? false} />
{userData?.khoj_version && (
<VersionBadge version={userData?.khoj_version} />
)}
</div>
</DropdownMenuItem>
<DropdownMenuSeparator />
Expand Down Expand Up @@ -170,9 +182,7 @@ export default function NavMenu() {
>
<div className="flex flex-rows">
<Code className="w-6 h-6" />
<p className="ml-3 font-semibold">
{userData ? userData.khoj_version : "Releases"}
</p>
<p className="ml-3 font-semibold">Releases</p>
</div>
</Link>
</DropdownMenuItem>
Expand Down Expand Up @@ -220,6 +230,9 @@ export default function NavMenu() {
<div className="flex flex-col">
<p className="font-semibold">{userData?.email}</p>
<SubscriptionBadge is_active={userData?.is_active ?? false} />
{userData?.khoj_version && (
<VersionBadge version={userData?.khoj_version} />
)}
</div>
</MenubarItem>
<MenubarSeparator className="dark:bg-white height-[2px] bg-black" />
Expand Down Expand Up @@ -295,9 +308,7 @@ export default function NavMenu() {
>
<div className="flex flex-rows">
<Code className="w-6 h-6" />
<p className="ml-3 font-semibold">
{userData ? userData.khoj_version : "Releases"}
</p>
<p className="ml-3 font-semibold">Releases</p>
</div>
</Link>
</MenubarItem>
Expand Down

0 comments on commit 4b4e0e2

Please sign in to comment.