diff --git a/client/app/(auth)/login/page.jsx b/client/app/(auth)/login/page.jsx index 7cd7056..80a31f9 100644 --- a/client/app/(auth)/login/page.jsx +++ b/client/app/(auth)/login/page.jsx @@ -4,7 +4,7 @@ import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useState } from 'react'; import { zodResolver } from '@hookform/resolvers/zod'; -import { set, useForm } from 'react-hook-form'; +import { useForm } from 'react-hook-form'; import { z } from 'zod'; import { LoaderCircle } from 'lucide-react'; import { Button } from '@/components/ui/button'; diff --git a/client/app/app/explore/layout.jsx b/client/app/app/explore/layout.jsx index 175635b..50cd923 100644 --- a/client/app/app/explore/layout.jsx +++ b/client/app/app/explore/layout.jsx @@ -1,4 +1,4 @@ -import LayoutContent from "@/app/app/explore/layout-content"; +import LayoutContent from '@/app/app/explore/layout-content'; export const metadata = { title: 'keşfet' diff --git a/client/components/app/Post/List.jsx b/client/components/app/Post/List.jsx index 353f400..39b0f15 100644 --- a/client/components/app/Post/List.jsx +++ b/client/components/app/Post/List.jsx @@ -8,6 +8,7 @@ export default function PostList({ fetchPosts }) { const [posts, setPosts] = useState([]); const [offset, setOffset] = useState(10); const [hasMorePost, setHasMorePost] = useState(true); + const [loading, setLoading] = useState(false); const { toast } = useToast(); const handleDelete = (postId) => { @@ -42,6 +43,7 @@ export default function PostList({ fetchPosts }) { useEffect(() => { const fetchInitialPosts = async () => { + setLoading(true); const response = await fetchPosts(0); if (!response) { @@ -62,6 +64,8 @@ export default function PostList({ fetchPosts }) { setPosts(initialPosts); setHasMorePost(false); } + + setLoading(false); }; fetchInitialPosts(); @@ -69,7 +73,10 @@ export default function PostList({ fetchPosts }) { return (
- {posts.length > 0 ? ( + {loading && ( + + )} + {!loading && posts.length > 0 ? ( <> {posts.map((post) => ( @@ -81,10 +88,12 @@ export default function PostList({ fetchPosts }) { )} ) : ( -
- buralar şimdilik sessiz. -
+ !loading && ( +
+ buralar şimdilik sessiz. +
+ ) )}
); -} +} \ No newline at end of file diff --git a/client/components/app/User/List.jsx b/client/components/app/User/List.jsx index 331adc5..4c44a6b 100644 --- a/client/components/app/User/List.jsx +++ b/client/components/app/User/List.jsx @@ -68,6 +68,14 @@ export default function UserList({ fetchUsers }) { return (
+ {/* {users.map((user, index) => ( + + ))} + {hasMoreUser && ( + + )} */} {users.length > 0 ? ( <> {users.map((user, index) => ( @@ -80,7 +88,7 @@ export default function UserList({ fetchUsers }) { )} ) : ( - + )}
);