Skip to content

Commit

Permalink
Merge branch 'preview'
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelfan committed Dec 17, 2023
2 parents 5f18f1a + 3dcacb6 commit c8ba8f2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async function DashboardLayout({
{profile && <Composer author={profile} />}
<SidePanel />
<section className="w-full md:max-w-xl">
<TopBar />
{profile && <TopBar profile={profile} />}
{children}
</section>
<Aside />
Expand Down
12 changes: 7 additions & 5 deletions src/components/navigational/topBar/TopBar.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { getSessionFromServer } from "@/app/api/auth/[...nextauth]/route";
import SignOut from "@/components/actions/signOut/SignOut";
import Avatar from "@/components/dataDisplay/avatar/Avatar";
import { getProfile } from "@/lib/api/bsky/actor";
import { ProfileViewDetailed } from "@atproto/api/dist/client/types/app/bsky/actor/defs";
import Image from "next/image";
import Link from "next/link";

export default async function TopBar() {
const session = await getSessionFromServer();
const profile = await getProfile(session?.user.bskySession.handle);
interface Props {
profile: ProfileViewDetailed;
}

export default function TopBar(props: Props) {
const { profile } = props;

return (
<div className="flex justify-between bg-white border-b md:border-b-0 px-3 md:px-0 py-2.5 md:pt-0 sticky md:relative top-0 z-50 lg:hidden">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/api/bsky/actor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const getProfile = async (
if (!agent) agent = await getAgent();
const profile = await agent.getProfile({ actor: handle });

if (!profile.data) return null;
if (!profile.success) throw new Error("Could not get profile");
return profile.data;
};

Expand Down
2 changes: 0 additions & 2 deletions src/lib/hooks/bsky/actor/useProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export default function useProfile(handle: string) {
queryFn: () => getProfile(handle, agent),
});

console.log(data)

const updateFollowCount = (mode: "decrease" | "increase") => {
queryClient.setQueryData(profileKey(handle), (oldData: any) => {
return {
Expand Down

0 comments on commit c8ba8f2

Please sign in to comment.