Skip to content

fix: embedded lists #81

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
21 changes: 13 additions & 8 deletions src/components/PostEmbed/app-bsky-embed-record-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
import { cn } from '@/lib/utils';
import TimeAgo from 'react-timeago-i18n';
import { PostEmbed } from '.';
import { FacetedText } from '../FacetedText';

Check failure on line 6 in src/components/PostEmbed/app-bsky-embed-record-view.tsx

View workflow job for this annotation

GitHub Actions / lint (22.x)

'FacetedText' is defined but never used
import { Debug } from '@/components/ui/Debug';
import { Handle } from '@/components/ui/Handle';
import { NotImplementedBox } from '@/components/ui/NotImplementedBox';
import { Image } from '@/components/ui/Image';
import { Link } from '@/components/ui/Link';
import { useTranslation } from 'react-i18next';
import { HeartIcon } from 'lucide-react';
import { FormattedText } from '../ui/FormattedText';

export const AppBskyEmbedRecordView = ({ embed }: { embed: BSkyPostEmbed }) => {
const { t } = useTranslation('post');
Expand Down Expand Up @@ -59,17 +61,20 @@
</div>
</div>
)}
{embed.record.$type === 'app.bsky.graph.defs#starterPackViewBasic' ? (
{embed.record.$type === 'app.bsky.graph.defs#starterPackViewBasic' && (
<div className="text-gray-800 dark:text-gray-200">
<NotImplementedBox type={embed.$type} data={embed.record} />
</div>
) : (
<p className="text-gray-800 dark:text-gray-200">
{embed.record.facets ? (
<FacetedText text={embed.record.value.text} facets={embed.record.facets} key={embed.record.uri} />
) : (
embed.record.value.text
)}
)}
{embed.record.$type === 'app.bsky.feed.defs#generatorView' && (
<p className="text-gray-800 dark:text-gray-200 flex flex-col gap-2">
<div>
<Image type="avatar" src={embed.record.avatar} classNames={{ image: 'w-10 h-10 rounded-full' }} />
</div>
<FormattedText text={embed.record.description} />
<div className="flex flex-row gap-2">
<HeartIcon /> liked by {embed.record.likeCount} people
</div>
</p>
)}
</div>
Expand Down
14 changes: 14 additions & 0 deletions src/lib/bluesky/types/BSkyPostEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ export const BSkyPostEmbed = Type.Recursive((Self) => {
indexedAt: Type.String(),
$type: Type.Literal('app.bsky.graph.defs#starterPackViewBasic'),
}),
Type.Object({
uri: Type.String(),
cid: Type.String(),
did: Type.String(),
creator: BSkyAuthor,
displayName: Type.String(),
description: Type.String(),
avatar: Type.String(),
likeCount: Type.Number(),
labels: Type.Array(BSkyPostLabel),
viewer: Type.Object({}),
indexedAt: Type.String(),
$type: Type.Literal('app.bsky.feed.defs#generatorView'),
}),
]),
}),
Type.Object({
Expand Down
Loading