Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: default explore topic matches user interest #930

Merged
merged 5 commits into from
Mar 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion components/organisms/TopNav/top-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ import HeaderLogo from "components/molecules/HeaderLogo/header-logo";

import useSession from "lib/hooks/useSession";
import useSupabaseAuth from "lib/hooks/useSupabaseAuth";
import { useFetchUser } from "lib/hooks/useFetchUser";

const TopNav: React.FC = () => {
const { user } = useSupabaseAuth();
const { onboarded } = useSession();

const { data: gitHubUser } = useFetchUser(user?.user_metadata.user_name);
const userInterest = gitHubUser?.interests.split(",")[0] || "javascript";

return (
<header className="top-nav-container flex justify-between items-center px-2 md:px-16 py-0.5 bg-light-slate-3 border-b">
<div className="flex gap-8 items-center">
Expand All @@ -21,7 +25,7 @@ const TopNav: React.FC = () => {
<Link className="text-sm text-light-slate-10" href={"/hub/insights"}>
Insights Hub
</Link>
<Link className="text-sm text-light-slate-10" href={"/javascript/dashboard/filter/recent"}>
<Link className="text-sm text-light-slate-10" href={`/${userInterest}/dashboard/filter/recent`}>
Explore
</Link>
</>
Expand Down