Skip to content

Commit

Permalink
Add navigation to AI Image generator page
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaapple committed Dec 31, 2024
1 parent d4c7a12 commit 6901511
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
5 changes: 4 additions & 1 deletion frontend/components/image/image-generator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ export function AIImageGenerator() {
return (
<div className="space-y-6 w-full max-w-3xl mx-auto flex-grow overflow-auto">
<div className="space-y-2">
<label className="text-sm font-medium">Image Description</label>
<label className="text-sm font-medium">
Image Description
<span className="text-red-500 ml-1">*</span>
</label>
<TextareaAutosize
value={prompt}
placeholder="Please give some description or keywords for the image"
Expand Down
8 changes: 4 additions & 4 deletions frontend/components/layout/user-account-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import Link from 'next/link';
import { Gem, LayoutDashboard, LogOut, Settings } from 'lucide-react';
import { Gem, Images, LogOut, Settings } from 'lucide-react';
import type { User } from 'next-auth';
import { signOut } from 'next-auth/react';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
Expand Down Expand Up @@ -50,9 +50,9 @@ export function UserAccountNav({ user }: UserAccountNavProps) {
</div>
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<Link prefetch={false} href="/dashboard" className="flex items-center space-x-2.5">
<LayoutDashboard className="size-4" />
<p className="text-sm">Dashboard</p>
<Link prefetch={false} href="/images" className="flex items-center space-x-2.5">
<Images className="size-4" />
<p className="text-sm">Images</p>
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
Expand Down
22 changes: 18 additions & 4 deletions frontend/components/sidebar/sidebar-open.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import * as React from 'react';
import { useSidebar } from '@/hooks/use-sidebar';
import { ArrowRightToLine, CircleHelp, Gem, Plus, Settings } from 'lucide-react';
import { ArrowRightToLine, CircleHelp, Gem, Image, Plus, Settings } from 'lucide-react';
import Link from 'next/link';
import { User } from 'next-auth';
import { UserAccountNav } from '@/components/layout/user-account-nav';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
import LocaleSelect from '@/components/locale-selection';
import { useNewGenerateUI, useNewSearch } from '@/hooks/use-new-search';
import { useNewSearch } from '@/hooks/use-new-search';
import { PageGenUrl } from '@/config';

interface NavBarProps {
Expand All @@ -18,7 +18,6 @@ interface NavBarProps {
export default function SidebarOpen({ user }: NavBarProps) {
const { toggleSidebar, isSidebarOpen } = useSidebar();
const handleNewSearch = useNewSearch();
const handleNewGenerateUI = useNewGenerateUI();

return (
<div className="hidden md:flex absolute left-4 top-1/2 -translate-y-1/2 flex-col space-y-2 rounded-lg bg-gray-50 dark:bg-gray-700 py-3">
Expand Down Expand Up @@ -54,6 +53,21 @@ export default function SidebarOpen({ user }: NavBarProps) {
</TooltipContent>
</Tooltip>

<Tooltip>
<TooltipTrigger asChild>
<Link
href="generate-image"
aria-label="AI Image Generator"
className="inline-flex items-center justify-center hover:text-primary hover:bg-gray-200 dark:hover:bg-gray-700 rounded-lg p-2 m-2"
>
<Image size={20} strokeWidth={2} className="text-gray-800 dark:text-white" />
</Link>
</TooltipTrigger>
<TooltipContent className="bg-black text-white">
<p>Generate New Image</p>
</TooltipContent>
</Tooltip>

<Tooltip>
<TooltipTrigger asChild>
<Link
Expand All @@ -66,7 +80,7 @@ export default function SidebarOpen({ user }: NavBarProps) {
</Link>
</TooltipTrigger>
<TooltipContent className="bg-black text-white">
<p>New Generate UI</p>
<p>Generate New UI</p>
</TooltipContent>
</Tooltip>

Expand Down
4 changes: 4 additions & 0 deletions frontend/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export const mainNavConfig: MarketingConfig = {
title: 'AI Search',
href: '/',
},
{
title: 'AI Image',
href: '/generate-image',
},
{
title: 'Pricing',
href: '/pricing',
Expand Down

0 comments on commit 6901511

Please sign in to comment.