Skip to content

Commit

Permalink
Merge branch 'preview'
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelfan committed Nov 25, 2024
2 parents 9b073d8 + 3a2874e commit e8eaac9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 26 deletions.
10 changes: 1 addition & 9 deletions src/app/dashboard/user/[handle]/(post)/post/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ interface Props {
id: string;
handle: string;
};
searchParams: {
query?: string;
};
}

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

return (
<>
Expand All @@ -29,11 +25,7 @@ export default async function Page(props: Props) {
Post
</h2>
</div>
<PostThreadContainer
id={id}
handle={handle}
repliesTextFilter={query ?? ""}
/>
<PostThreadContainer id={id} handle={handle} />
</>
);
}
8 changes: 2 additions & 6 deletions src/components/contentDisplay/feedPost/FeedPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,8 @@ export default function FeedPost(props: Props) {
/>
</div>
)}
{!hidden && (
<>
{post.post.embed && (
<PostEmbed content={post.post.embed} depth={0} />
)}
</>
{!hidden && post.post.embed && (
<PostEmbed content={post.post.embed} depth={0} />
)}
<div className="mt-2">
<PostActions post={post.post} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,16 @@ const NotificationItem = memo(function NotificationItem(props: Props) {
{author.displayName || author.handle}{" "}
</Link>
)}
<span className="text-skin-base break-words font-medium">
<span className="text-skin-tertiary break-words font-medium">
{getNotificationLabel(reason)}
</span>
<span className="text-skin-tertiary whitespace-nowrap font-medium">
&nbsp;· {getRelativeTime(indexedAt)}
</span>
{subjectUri && (
<NotificationContnet uri={subjectUri} filter={filter} />
<div className="mt-2">
<NotificationContnet uri={subjectUri} filter={filter} />
</div>
)}
</div>
</div>
Expand Down
4 changes: 1 addition & 3 deletions src/components/contentDisplay/threadPost/ThreadPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ export default function ThreadPost(props: Props) {
/>
</div>
)}
{!hidden && (
<>{post.embed && <PostEmbed content={post.embed} depth={0} />}</>
)}
{!hidden && post.embed && <PostEmbed content={post.embed} depth={0} />}
<div className="text-sm text-skin-tertiary mt-3 font-medium">
{getFormattedDate(post.indexedAt)}
</div>
Expand Down
13 changes: 7 additions & 6 deletions src/containers/thread/PostThreadContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import usePreferences from "@/lib/hooks/bsky/actor/usePreferences";
import { getPostThread } from "@/lib/api/bsky/feed";
import { sortThread } from "@/lib/utils/feed";
import { useQuery } from "@tanstack/react-query";
import { useRouter } from "next/navigation";
import { useRouter, useSearchParams } from "next/navigation";
import { MAX_REPLY_CONTAINERS } from "@/lib/consts/thread";
import ThreadActionsContainer from "./ThreadActionsContainer";
import { replyIncludes } from "@/lib/utils/text";
Expand All @@ -28,11 +28,12 @@ import { getAgentFromClient } from "@/lib/api/bsky/agent";
interface Props {
id: string;
handle: string;
repliesTextFilter: string;
}

export default function PostThreadContainer(props: Props) {
const { id, handle, repliesTextFilter } = props;
const { id, handle } = props;
const searchParams = useSearchParams();
const search = searchParams.get("query") ?? "";
const [maxReplies, setMaxReplies] = useState(MAX_REPLY_CONTAINERS);
const router = useRouter();
const { data: session } = useSession();
Expand All @@ -57,13 +58,13 @@ export default function PostThreadContainer(props: Props) {
thread: thread,
});

const [textSearch, setTextSearch] = useState(repliesTextFilter);
const [textSearch, setTextSearch] = useState(search);
const [filteredReplies, setFilteredReplies] = useState(0);

// Update textFilter and filteredReplies
useEffect(() => {
setTextSearch(repliesTextFilter);
}, [repliesTextFilter]);
setTextSearch(search);
}, [search]);

useEffect(() => {
setFilteredReplies(
Expand Down

0 comments on commit e8eaac9

Please sign in to comment.