Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hqasmei committed Jul 17, 2024
1 parent 6790e68 commit 632dab5
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
34 changes: 32 additions & 2 deletions src/app/_components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { usePathname, useRouter } from 'next/navigation';

import DialogNavMenu from '@/components/dialog-nav-menu';
import FeedbackForm from '@/components/forms/feedback-form';
import SubmissionForm from '@/components/forms/submission-form';
import MainNav from '@/components/main-nav';
import { ResponsiveDialog } from '@/components/responsive-dialog';
import { ThemeToggle } from '@/components/theme-toggle';
Expand All @@ -18,13 +19,15 @@ import { useSession } from '@/lib/client-auth';
import { cn } from '@/lib/utils';
import { SignInButton, SignOutButton, UserButton } from '@clerk/nextjs';
import { useQuery } from 'convex/react';
import { EllipsisVertical, MessageSquareMore } from 'lucide-react';
import { EllipsisVertical, MessageSquareMore, Send } from 'lucide-react';

export function Header() {
const pathname = usePathname();
const session = useSession();
const scrolled = useScroll(70);
const router = useRouter();

const [isSubimtOpen, setIsSubimtOpen] = useState(false);
const [isFeedbackOpen, setIsFeedbackOpen] = useState(false);
const [isOpen, setIsOpen] = useState(false);

Expand Down Expand Up @@ -111,6 +114,16 @@ export function Header() {
<MessageSquareMore size={16} />
<span>Feedback</span>
</Button>
<Button
size="sm"
variant="outline"
onClick={() => setIsSubimtOpen(true)}
className="hidden md:flex gap-2"
>
<Send size={16} />
<span>Submit</span>
</Button>

{session.isLoggedIn ? (
<>
{isHome ? (
Expand Down Expand Up @@ -145,6 +158,14 @@ export function Header() {
>
<FeedbackForm setOpen={setIsFeedbackOpen} />
</ResponsiveDialog>
<ResponsiveDialog
open={isSubimtOpen}
setOpen={setIsSubimtOpen}
header="Submit a portfolio"
>
<SubmissionForm setOpen={setIsSubimtOpen} />
</ResponsiveDialog>

<DialogNavMenu isOpen={isOpen} setIsOpen={setIsOpen}>
<div className="flex flex-col gap-4 items-start">
{/* <button
Expand Down Expand Up @@ -205,7 +226,6 @@ export function Header() {
</button>
</SignInButton>
)}

<button
onClick={() => {
setIsOpen(false);
Expand All @@ -216,6 +236,16 @@ export function Header() {
<span className="text-muted-foreground">Feedback</span>
</button>

<button
onClick={() => {
setIsOpen(false);
setIsSubimtOpen(true);
}}
className="flex flex-row justify-between items-center w-full"
>
<span className="text-muted-foreground">Submit</span>
</button>

<div className="flex flex-row justify-between items-center w-full">
<span className="text-muted-foreground">Theme</span>
<ThemeToggle />
Expand Down
1 change: 1 addition & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export default function RootLayout({
{children}
<Toaster richColors position="top-center" />
</ContextProvider>

</body>
</html>
);
Expand Down
6 changes: 4 additions & 2 deletions src/components/main-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ export default function MainContent({
: portfolios
.filter(
(portfolio) =>
portfolio.tags &&
portfolio.tags.map((tag) => `${tag}s`).includes(selectedFilter),
portfolio.titles &&
portfolio.titles
.map((title) => `${title}s`)
.includes(selectedFilter),
)
.filter((portfolio) =>
portfolio.name.toLowerCase().includes(searchValue.toLowerCase()),
Expand Down

0 comments on commit 632dab5

Please sign in to comment.