-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Profile feed added, minor changes to the posts route
- Loading branch information
Showing
6 changed files
with
128 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { PropsWithChildren } from "react"; | ||
|
||
export const PageLayout = (props: PropsWithChildren) => { | ||
return ( | ||
<main className="flex h-screen justify-center"> | ||
<div className="h-full w-full overflow-y-auto border-x border-slate-400 md:max-w-2xl"> | ||
{props.children} | ||
</div> | ||
</main> | ||
); | ||
}; |
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,35 @@ | ||
import Image from "next/image"; | ||
import type { RouterOutputs } from "~/utils/api"; | ||
import Link from "next/link"; | ||
import relativeTime from "dayjs/plugin/relativeTime"; | ||
import dayjs from "dayjs"; | ||
dayjs.extend(relativeTime); | ||
|
||
type PostWithAuthor = RouterOutputs["posts"]["getAll"][number]; | ||
export function PostView(props: PostWithAuthor) { | ||
const { post, author } = props; | ||
return ( | ||
<div className="flex gap-3 border-b border-slate-400 p-4"> | ||
<Image | ||
src={author.profileImageUrl} | ||
className="rounded-full" | ||
alt={`${author.id} profile image`} | ||
width={56} | ||
height={56} | ||
/> | ||
<div className="flex flex-col"> | ||
<div className="flex gap-1 text-slate-300"> | ||
<Link href={`/@${author.username}`}> | ||
<span>{`@${author.username}`}</span> | ||
</Link> | ||
<Link href={`/post/${post.id}`}> | ||
<span className="font-thin">{`· ${dayjs( | ||
post.createdAt | ||
).fromNow()}`}</span> | ||
</Link> | ||
</div> | ||
<span>{post.content}</span> | ||
</div> | ||
</div> | ||
); | ||
} |
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
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,8 @@ | ||
import type { User } from "@clerk/nextjs/dist/api"; | ||
export function filterUserForClient(user: User) { | ||
return { | ||
id: user.id, | ||
username: user.username, | ||
profileImageUrl: user.profileImageUrl, | ||
}; | ||
} |
5652daa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
chirpt3 – ./
chirpt3-git-main-geeraya.vercel.app
chirpt3-geeraya.vercel.app
chirpt3.vercel.app