-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from farcasterxyz/horsefacts/next-auth
feat: simple profile component
- Loading branch information
Showing
5 changed files
with
57 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
// import { getServerSession } from 'next-auth'; | ||
import { FeedPage } from '@components/feed/FeedPage'; | ||
import { LandingPage } from '@components/landing/LandingPage'; | ||
import { getServerSession } from 'next-auth'; | ||
|
||
import { FeedPage } from "@components/feed/FeedPage"; | ||
import { LandingPage } from "@components/landing/LandingPage"; | ||
import { authOptions } from './api/auth/[...nextauth]/route'; | ||
|
||
export default async function Home() { | ||
// const session = await getServerSession(); | ||
// if (session) { | ||
return <FeedPage fid="145" />; | ||
// } | ||
const { | ||
user: { fid }, | ||
} = await getServerSession(authOptions); | ||
|
||
if (fid) { | ||
return ( | ||
<div> | ||
<FeedPage fid={fid} /> | ||
</div> | ||
); | ||
} | ||
|
||
return <LandingPage />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { User } from '@shared/types/models'; | ||
|
||
import { Avatar } from '../avatar/Avatar'; | ||
|
||
type ProfileProps = { | ||
user: User; | ||
}; | ||
|
||
export function Profile({ user }: ProfileProps) { | ||
return ( | ||
<div className="flex flex-col p-4"> | ||
<div className="flex flex-row place-items-center"> | ||
<Avatar user={user} pfpDiameter={72} /> | ||
<div className="flex flex-col ml-4 text-l"> | ||
<span className="font-bold">{user.display_name}</span> | ||
<span className="text-gray-500">@{user.username}</span> | ||
<div className="mt-2">{user.bio}</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |