mirror of
https://github.com/mroxso/zelo-news.git
synced 2026-06-06 02:21:11 +02:00
refactor: replace useBlogPost with useLongFormContentNote across components for consistency
This commit is contained in:
@@ -3,7 +3,7 @@ import { useNavigate } from 'react-router-dom';
|
||||
import { nip19 } from 'nostr-tools';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { usePublishBlogPost } from '@/hooks/usePublishBlogPost';
|
||||
import { useBlogPost } from '@/hooks/useBlogPost';
|
||||
import { useLongFormContentNote } from '@/hooks/useLongFormContentNote';
|
||||
import { useUploadFile } from '@/hooks/useUploadFile';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
@@ -25,7 +25,7 @@ export function BlogPostForm({ editIdentifier }: BlogPostFormProps) {
|
||||
const { mutateAsync: uploadFile, isPending: isUploading } = useUploadFile();
|
||||
|
||||
// Load existing post if editing (using the current user's pubkey)
|
||||
const { data: existingPost } = useBlogPost(
|
||||
const { data: existingPost } = useLongFormContentNote(
|
||||
user?.pubkey || '',
|
||||
editIdentifier || ''
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Card, CardHeader } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { Newspaper, ChevronDown } from 'lucide-react';
|
||||
import { useBlogPosts } from '@/hooks/useBlogPosts';
|
||||
import { useLongFormContentNotes } from '@/hooks/useLongFormContentNotes';
|
||||
import { ArticlePreview } from '@/components/ArticlePreview';
|
||||
|
||||
const INITIAL_POSTS_COUNT = 3;
|
||||
@@ -11,7 +11,7 @@ const LOAD_MORE_COUNT = 6;
|
||||
|
||||
export function LatestArticles() {
|
||||
const [visibleCount, setVisibleCount] = useState(INITIAL_POSTS_COUNT);
|
||||
const { data: posts, isLoading } = useBlogPosts();
|
||||
const { data: posts, isLoading } = useLongFormContentNotes();
|
||||
|
||||
// Loading state
|
||||
if (isLoading) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { nip19 } from 'nostr-tools';
|
||||
import { SerializedEditorState } from 'lexical';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
import { usePublishBlogPost } from '@/hooks/usePublishBlogPost';
|
||||
import { useBlogPost } from '@/hooks/useBlogPost';
|
||||
import { useLongFormContentNote } from '@/hooks/useLongFormContentNote';
|
||||
import { useUploadFile } from '@/hooks/useUploadFile';
|
||||
import { useIsMobile } from '@/hooks/useIsMobile';
|
||||
import { Button } from '@/components/ui/button';
|
||||
@@ -50,7 +50,7 @@ export function ProfessionalBlogPostForm({ editIdentifier }: ProfessionalBlogPos
|
||||
const { mutateAsync: uploadFile, isPending: isUploading } = useUploadFile();
|
||||
|
||||
// Load existing post if editing (using the current user's pubkey)
|
||||
const { data: existingPost, isLoading: isLoadingPost } = useBlogPost(
|
||||
const { data: existingPost, isLoading: isLoadingPost } = useLongFormContentNote(
|
||||
user?.pubkey || '',
|
||||
editIdentifier || ''
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { TrendingUp, Hash } from 'lucide-react';
|
||||
import { useBlogPosts } from '@/hooks/useBlogPosts';
|
||||
import { useLongFormContentNotes } from '@/hooks/useLongFormContentNotes';
|
||||
|
||||
interface TagCount {
|
||||
tag: string;
|
||||
@@ -12,7 +12,7 @@ interface TagCount {
|
||||
|
||||
export function TrendingTags() {
|
||||
const navigate = useNavigate();
|
||||
const { data: posts, isLoading } = useBlogPosts();
|
||||
const { data: posts, isLoading } = useLongFormContentNotes();
|
||||
|
||||
// Loading state
|
||||
if (isLoading) {
|
||||
|
||||
Reference in New Issue
Block a user