Skip to content

Commit

Permalink
migrate to museum
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderHott committed Jan 2, 2024
1 parent 395cbaf commit c3991d9
Show file tree
Hide file tree
Showing 19 changed files with 2,015 additions and 565 deletions.
2 changes: 1 addition & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const config = {
defaultLocale: "en",
},
images: {
domains: ["images.clerk.dev"],
domains: ["images.clerk.dev", "img.clerk.com"],
},

typescript: {
Expand Down
12 changes: 6 additions & 6 deletions src/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import Link from "next/link";
import { HomeIcon, SparklesIcon, UserIcon } from "@heroicons/react/24/outline";
import { SignedIn } from "@clerk/nextjs";
import { useUser } from "@clerk/nextjs";
// import { SignedIn } from "@clerk/nextjs";
// import { useUser } from "@clerk/nextjs";

export const PageLayout: React.FC<{ children: React.ReactNode }> = ({
children,
}) => {
const { user } = useUser();
// const { user } = useUser();
return (
<main className="flex h-screen justify-center">
<aside className="flex-col hidden md:flex p-4 gap-4">
<aside className="hidden flex-col gap-4 p-4 md:flex">
<Link href="/" className="flex gap-2">
<HomeIcon height={24} width={24} />
<span className="text-xl">Home</span>
Expand All @@ -18,12 +18,12 @@ export const PageLayout: React.FC<{ children: React.ReactNode }> = ({
<SparklesIcon height={24} width={24} />
<span className="text-xl">Your Feed</span>
</Link>
<SignedIn>
{/*<SignedIn>
<Link href={`/@${user?.username || ""}`} className="flex gap-2">
<UserIcon height={24} width={24} />
<span className="text-xl">Profile</span>
</Link>
</SignedIn>
</SignedIn>*/}
</aside>
<div className="h-max w-full border-x border-slate-400 md:max-w-2xl">
{children}
Expand Down
36 changes: 22 additions & 14 deletions src/components/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import Link from "next/link";
import {
SignedIn,
SignedOut,
SignInButton,
SignOutButton,
useUser,
} from "@clerk/nextjs";
// import {
// SignedIn,
// SignedOut,
// SignInButton,
// SignOutButton,
// useUser,
// } from "@clerk/nextjs";
import {
Bars3Icon,
HomeIcon,
SparklesIcon,
UserIcon,
// UserIcon,
} from "@heroicons/react/24/outline";

export const NavBar = () => {
Expand All @@ -20,7 +20,7 @@ export const NavBar = () => {
🗿
</Link>
<div className="flex items-center gap-4">
<SignedIn>
{/*gnedIn>
<SignOutButton>
<Button variant={"outline"}>Sign Out</Button>
</SignOutButton>
Expand All @@ -29,7 +29,8 @@ export const NavBar = () => {
<SignInButton>
<Button>Sign In</Button>
</SignInButton>
</SignedOut>
</SignedOut>*/}
<Button>Sign In</Button>
<div className="md:hidden">
<MobileNav />
</div>
Expand All @@ -48,9 +49,16 @@ import {
} from "./ui/Sheet";
import { Separator } from "./ui/Separator";
import { GithubIcon } from "lucide-react";
import { USER_MAP } from "~/data/data";
import { useSearchParams } from "next/navigation";

export function MobileNav() {
const { user } = useUser();
const searchParams = useSearchParams();
const userId = searchParams.get("userId");
if (!userId) return <div>404</div>;
const user = USER_MAP.get(userId);
if (!user) return <div>404</div>;
// const { user } = useUser();
return (
<Sheet>
<SheetTrigger asChild>
Expand All @@ -72,16 +80,16 @@ export function MobileNav() {
<span className="text-xl">Your Feed</span>
</Link>
</SheetClose>
<SignedIn>
{/*<SignedIn>
<SheetClose asChild>
<Link href={`/@${user?.username || ""}`} className="flex gap-2">
<UserIcon height={24} width={24} />
<span className="text-xl">Profile</span>
</Link>
</SheetClose>
</SignedIn>
</SignedIn>*/}
</div>
<Separator className="bg-white my-4" />
<Separator className="my-4 bg-white" />
<SheetFooter>
<Link
href="https://github.com/AlexanderHOtt/emoji-twitter"
Expand Down
Loading

0 comments on commit c3991d9

Please sign in to comment.