Skip to content

Commit

Permalink
Merge branch 'preview'
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelfan committed Oct 29, 2024
2 parents 354df3b + 56f8b94 commit 4086933
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/actions/composeButton/ComposeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function ComposeButton(props: Props) {
return (
<button
onClick={() => openComposer({ mention: userHandle })}
className="bg-primary text-skin-inverted flex items-center gap-2 rounded-full font-semibold hover:brightness-95 p-3.5 lg:px-3 lg:py-2"
className="bg-primary text-skin-inverted flex items-center gap-2 rounded-full font-semibold hover:brightness-95 p-2 lg:px-3 lg:py-2"
>
<RiQuillPenFill className="text-skin-icon-inverted text-2xl" />
<span className="text-skin-icon-inverted hidden lg:inline">Post</span>
Expand Down
2 changes: 1 addition & 1 deletion src/components/contentDisplay/feedPost/FeedPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default function FeedPost(props: Props) {
<PostEmbed content={post.post.embed} depth={0} />
)}
</>
)}
)}
<div className="mt-2">
<PostActions post={post.post} />
</div>
Expand Down
21 changes: 21 additions & 0 deletions src/components/dataDisplay/postTag/PostTag.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Link from "next/link";

interface Props {
tag: string;
}

export default function PostTag(props: Props) {
const { tag } = props;

const encodedTag = encodeURIComponent(tag);

return (
<Link
href={`/dashboard/search?query=%23${encodedTag}`}
className="bg-skin-tertiary px-3 py-1.5 rounded-lg text-sm text-skin-secondary font-medium hover:text-skin-base break-all"
onClick={(e) => e.stopPropagation()}
>
#{tag}
</Link>
);
}
9 changes: 9 additions & 0 deletions src/components/dataDisplay/postText/postText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Link from "next/link";
import { Fragment } from "react";
import * as Tooltip from "@radix-ui/react-tooltip";
import { BiLinkExternal } from "react-icons/bi";
import PostTag from "../postTag/PostTag";

interface Props {
record: PostView["record"];
Expand All @@ -18,6 +19,7 @@ export default function PostText(props: Props) {
const { record, truncate, mode = "feed" } = props;
const text = AppBskyFeedPost.isRecord(record) && record.text;
const facet = AppBskyFeedPost.isRecord(record) && record.facets;
const tags = AppBskyFeedPost.isRecord(record) && record.tags;

const richText = new RichTextHelper({
text: text.toString(),
Expand Down Expand Up @@ -119,6 +121,13 @@ export default function PostText(props: Props) {
{content.map((segment, i) => (
<Fragment key={`${i}+${text}`}>{segment.component}</Fragment>
))}
{tags && (
<div className="flex flex-wrap gap-2 mt-3">
{tags.map((t, i) => (
<PostTag key={i} tag={t} />
))}
</div>
)}
</div>
);
}
2 changes: 1 addition & 1 deletion src/components/inputs/editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default function Editor(props: Props) {
languages: languages.map((lang) => lang.code),
images,
label,
threadGate,
threadGate,
});

if (!editor) return null;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/hooks/bsky/feed/usePublishPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export default function usePublishPost(props: Props) {
langs: lang,
labels: selfLabels,
reply: reply,
embed: embed,
embed: embed,
});

// add threadGate
Expand Down

0 comments on commit 4086933

Please sign in to comment.