Skip to content

Commit e8eaac9

Browse files
committed
Merge branch 'preview'
2 parents 9b073d8 + 3a2874e commit e8eaac9

File tree

5 files changed

+15
-26
lines changed

5 files changed

+15
-26
lines changed

src/app/dashboard/user/[handle]/(post)/post/[id]/page.tsx

+1-9
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@ interface Props {
1313
id: string;
1414
handle: string;
1515
};
16-
searchParams: {
17-
query?: string;
18-
};
1916
}
2017

2118
export default async function Page(props: Props) {
2219
const { id, handle } = props.params;
23-
const { query } = props.searchParams;
2420

2521
return (
2622
<>
@@ -29,11 +25,7 @@ export default async function Page(props: Props) {
2925
Post
3026
</h2>
3127
</div>
32-
<PostThreadContainer
33-
id={id}
34-
handle={handle}
35-
repliesTextFilter={query ?? ""}
36-
/>
28+
<PostThreadContainer id={id} handle={handle} />
3729
</>
3830
);
3931
}

src/components/contentDisplay/feedPost/FeedPost.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,8 @@ export default function FeedPost(props: Props) {
134134
/>
135135
</div>
136136
)}
137-
{!hidden && (
138-
<>
139-
{post.post.embed && (
140-
<PostEmbed content={post.post.embed} depth={0} />
141-
)}
142-
</>
137+
{!hidden && post.post.embed && (
138+
<PostEmbed content={post.post.embed} depth={0} />
143139
)}
144140
<div className="mt-2">
145141
<PostActions post={post.post} />

src/components/contentDisplay/notification/NotificationItem.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,16 @@ const NotificationItem = memo(function NotificationItem(props: Props) {
9090
{author.displayName || author.handle}{" "}
9191
</Link>
9292
)}
93-
<span className="text-skin-base break-words font-medium">
93+
<span className="text-skin-tertiary break-words font-medium">
9494
{getNotificationLabel(reason)}
9595
</span>
9696
<span className="text-skin-tertiary whitespace-nowrap font-medium">
9797
&nbsp;· {getRelativeTime(indexedAt)}
9898
</span>
9999
{subjectUri && (
100-
<NotificationContnet uri={subjectUri} filter={filter} />
100+
<div className="mt-2">
101+
<NotificationContnet uri={subjectUri} filter={filter} />
102+
</div>
101103
)}
102104
</div>
103105
</div>

src/components/contentDisplay/threadPost/ThreadPost.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ export default function ThreadPost(props: Props) {
8181
/>
8282
</div>
8383
)}
84-
{!hidden && (
85-
<>{post.embed && <PostEmbed content={post.embed} depth={0} />}</>
86-
)}
84+
{!hidden && post.embed && <PostEmbed content={post.embed} depth={0} />}
8785
<div className="text-sm text-skin-tertiary mt-3 font-medium">
8886
{getFormattedDate(post.indexedAt)}
8987
</div>

src/containers/thread/PostThreadContainer.tsx

+7-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import usePreferences from "@/lib/hooks/bsky/actor/usePreferences";
1717
import { getPostThread } from "@/lib/api/bsky/feed";
1818
import { sortThread } from "@/lib/utils/feed";
1919
import { useQuery } from "@tanstack/react-query";
20-
import { useRouter } from "next/navigation";
20+
import { useRouter, useSearchParams } from "next/navigation";
2121
import { MAX_REPLY_CONTAINERS } from "@/lib/consts/thread";
2222
import ThreadActionsContainer from "./ThreadActionsContainer";
2323
import { replyIncludes } from "@/lib/utils/text";
@@ -28,11 +28,12 @@ import { getAgentFromClient } from "@/lib/api/bsky/agent";
2828
interface Props {
2929
id: string;
3030
handle: string;
31-
repliesTextFilter: string;
3231
}
3332

3433
export default function PostThreadContainer(props: Props) {
35-
const { id, handle, repliesTextFilter } = props;
34+
const { id, handle } = props;
35+
const searchParams = useSearchParams();
36+
const search = searchParams.get("query") ?? "";
3637
const [maxReplies, setMaxReplies] = useState(MAX_REPLY_CONTAINERS);
3738
const router = useRouter();
3839
const { data: session } = useSession();
@@ -57,13 +58,13 @@ export default function PostThreadContainer(props: Props) {
5758
thread: thread,
5859
});
5960

60-
const [textSearch, setTextSearch] = useState(repliesTextFilter);
61+
const [textSearch, setTextSearch] = useState(search);
6162
const [filteredReplies, setFilteredReplies] = useState(0);
6263

6364
// Update textFilter and filteredReplies
6465
useEffect(() => {
65-
setTextSearch(repliesTextFilter);
66-
}, [repliesTextFilter]);
66+
setTextSearch(search);
67+
}, [search]);
6768

6869
useEffect(() => {
6970
setFilteredReplies(

0 commit comments

Comments
 (0)