Skip to content

Commit

Permalink
feat: bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
josetano2 committed Aug 23, 2024
1 parent a4911e8 commit 8f1a7b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/ss_frontend/src/components/HomePost.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const HomePost = ({ post, choosePost, refetch }) => {
<p className='text-xl font-medium'>{name}</p>
</div>
<p className='text-base '>{post.description}</p>
{post.images.length != 0 && (
{post && post.images && post.images.length != 0 && (
<div className="items-center w-full flex justify-start gap-4 p-4 overflow-x-scroll">
{post.images.map((imageUrl) => {
return (
Expand All @@ -98,18 +98,18 @@ const HomePost = ({ post, choosePost, refetch }) => {
<div className='flex items-center gap-2 cursor-pointer' onClick={handleLike}>
{liked == true ? <>
<IoMdHeart className='size-6' />
<p className='text-lg text-gray-500'>{post.likes.length}</p>
<p className='text-lg text-gray-500'>{post && post.likes && post.likes.length}</p>
</> : <><IoIosHeartEmpty className='size-6' />
<p className='text-lg text-gray-500'>{post.likes.length}</p></>}
<p className='text-lg text-gray-500'>{post && post.likes && post.likes.length}</p></>}

</div>
<div className='flex items-center gap-2'>
<FaRegComments className='size-6' />
<p className='text-lg text-gray-500'>{post.comments.length}</p>
<p className='text-lg text-gray-500'>{post && post.comments && post.comments.length}</p>
</div>
<div className='flex items-center gap-2'>
<RiMoneyDollarCircleLine className='size-6' />
<p className='text-lg text-gray-500'>{post.investors.length}</p>
<p className='text-lg text-gray-500'>{post && post.investors && post.investors.length}</p>
</div>
</div>
{
Expand Down
9 changes: 3 additions & 6 deletions src/ss_frontend/src/pages/PeoplePage.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import React, { useState, useEffect } from "react";
import { useQuery, QueryClient, QueryClientProvider } from "react-query";
import { useQuery } from "react-query";
import MainTemplate from "../templates/MainTemplate";
import profile_1 from "../assets/about/theo.jpg";
import profile_2 from "../assets/about/ryan.jpg";
import People from "../components/People";
import { ss_backend } from "../../../declarations/ss_backend";

// Create a QueryClient instance
const queryClient = new QueryClient();

const PeoplePage = () => {
const [people, setPeople] = useState();
const { isLoading, error, isFetching } = useQuery({
Expand Down Expand Up @@ -42,10 +39,10 @@ const PeoplePage = () => {
return (
<MainTemplate>
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6 p-4 pt-24">
{isLoading || isFetching ? <></> : people}
{/* {isLoading || isFetching ? <></> : people} */}
</div>
</MainTemplate>
);
};

export default PeoplePage;
export default PeoplePage;

0 comments on commit 8f1a7b4

Please sign in to comment.