Skip to content
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
2 changes: 1 addition & 1 deletion app/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import { YAPP_TOKEN_AUTHORITY_ID } from '@/lib/constants'
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
import { useDashPayContactsModal } from '@/hooks/use-dashpay-contacts-modal'
import { useSettingsStore, type SensitiveContentMode } from '@/lib/store'
import { CORS_PROXY_INFO } from '@/hooks/use-link-preview'
import { CORS_PROXY_INFO } from '@/lib/link-preview/fetch'
import { UsernameModal } from '@/components/dpns/username-modal'

type SettingsSection = 'main' | 'account' | 'contacts' | 'notifications' | 'privacy' | 'privateFeed' | 'storage' | 'appearance' | 'developer' | 'about' | 'moderation'
Expand Down
2 changes: 1 addition & 1 deletion components/blog/blocknote-schema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
ViewColumnsIcon,
} from '@heroicons/react/24/outline'
import { PlayIcon } from '@heroicons/react/24/solid'
import { extractYouTubeVideoId } from '@/hooks/use-link-preview'
import { extractYouTubeVideoId } from '@/lib/link-preview/urls'
import { YouTubeIcon } from '@/components/ui/brand-icons'
import { IpfsImage } from '@/components/ui/ipfs-image'
import { isIpfsProtocol } from '@/lib/utils/ipfs-gateway'
Expand Down
19 changes: 3 additions & 16 deletions components/post/link-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import Image from 'next/image'
import Link from 'next/link'
import { LinkIcon, PlayIcon, XMarkIcon, InformationCircleIcon } from '@heroicons/react/24/solid'
import { useSettingsStore } from '@/lib/store'
import { CORS_PROXY_INFO, isDirectImageUrl, isYouTubeUrl } from '@/hooks/use-link-preview'
import { CORS_PROXY_INFO } from '@/lib/link-preview/fetch'
import { isDirectImageUrl, isYouTubeUrl } from '@/lib/link-preview/urls'
import type { LinkPreviewData } from '@/lib/link-preview/types'
import { YouTubeIcon } from '@/components/ui/brand-icons'

// Context for managing the link preview modal state
Expand Down Expand Up @@ -234,21 +236,6 @@ export function LinkPreviewInfoIcon() {
// Note: We use next/image for favicon (small, fixed size) but regular img
// for preview images so we can check naturalWidth/Height on load

export interface LinkPreviewData {
url: string
title?: string
description?: string
image?: string
imageWidth?: number
imageHeight?: number
siteName?: string
favicon?: string
/** True if URL points directly to an image (detected via Content-Type or extension) */
isDirectImage?: boolean
/** YouTube video ID for embedded player (when URL is a YouTube video) */
youtubeVideoId?: string
}

interface LinkPreviewProps {
data: LinkPreviewData
className?: string
Expand Down
3 changes: 2 additions & 1 deletion components/post/post-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import type { FieldValidationStatus } from '@/hooks/use-post-field-validation'
import { LinkPreview, LinkPreviewSkeleton, LinkPreviewInfoIcon } from './link-preview'
import { GatedMediaPlaceholder } from './gated-media'
import type { MediaGate } from '@/hooks/use-media-gate'
import { useLinkPreview, extractFirstUrl, stripTrailingPunctuation } from '@/hooks/use-link-preview'
import { useLinkPreview } from '@/hooks/use-link-preview'
import { extractFirstUrl, stripTrailingPunctuation } from '@/lib/link-preview/urls'
import { useYapprPostReference } from '@/hooks/use-yappr-post-reference'
import { useSettingsStore } from '@/lib/store'
import { cashtagDisplayToStorage, normalizeDpnsUsername } from '@/lib/post-helpers'
Expand Down
Loading
Loading