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

fix: article page and profile page #35

Merged
merged 9 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
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
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions src/app/[username]/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export default async function PostPage({ params }: PostPageProps) {

<h1
itemProp="name headline"
className="mt-2 text-pretty font-serif text-5xl font-bold leading-none tracking-wider sm:text-7xl sm:leading-tight"
className="mt-2 overflow-hidden text-ellipsis text-pretty font-serif text-5xl font-bold leading-none tracking-wider sm:text-7xl sm:leading-tight"
>
{post.title}
</h1>
Expand Down Expand Up @@ -275,7 +275,7 @@ export default async function PostPage({ params }: PostPageProps) {
href="http://creativecommons.org/licenses/by-nc/4.0/"
className="hover:underline"
>
CC BY-NC 4.0 Licence
CC BY-NC 4.0 License
</Link>
</p>
</footer>
Expand Down
13 changes: 10 additions & 3 deletions src/app/[username]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { cn } from "@/lib/utils";
import { getServerAuthSession } from "@/server/auth";
import { db } from "@/server/db";
import { api } from "@/trpc/server";
import { SiGithub, SiInstagram } from "@icons-pack/react-simple-icons";

type UserPageProps = {
params: { username: string };
Expand Down Expand Up @@ -160,16 +161,22 @@ export default async function UserPage({ params }: UserPageProps) {
{user?.bio}
</p>

<h4 className="mb-2 text-lg font-semibold">Link Sosial Media</h4>
<h4 className="mb-2 text-lg font-semibold">Media Sosial</h4>
<div className="flex flex-col gap-1">
{user?.socialMedia.map((social, i) => (
<Link
itemProp="url"
key={i}
href={social.url}
className="underline-offset-4 hover:underline"
target="_blank"
className="flex w-fit items-center gap-x-2 underline-offset-4 hover:underline"
>
{social.name} - {social.username}
{social.name === "instagram" ? (
<SiInstagram className="h-4 w-4" />
) : (
<SiGithub className="h-4 w-4" />
)}
{social.username}
</Link>
))}
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/server/api/routers/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ export const userRouter = createTRPCRouter({
thisMonth.setMonth(thisMonth.getMonth() - 1);

return await ctx.db.user.findMany({
orderBy: {
posts: {
_count: "asc",
},
},
where: {
posts: {
some: {
Expand Down
6 changes: 6 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ div[data-youtube-video] {
margin: 0 16px;
}

@media screen and (max-width: 768px) {
div[data-youtube-video] {
margin: 0;
}
}

div[data-youtube-video].ProseMirror-selectednode {
background: hsl(var(--muted));
}
Expand Down
Loading