Skip to content
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

create loading animation #15

Closed
github-actions bot opened this issue Jun 7, 2023 · 5 comments · Fixed by #17
Closed

create loading animation #15

github-actions bot opened this issue Jun 7, 2023 · 5 comments · Fixed by #17
Assignees
Labels
good first issue Good for newcomers todo

Comments

@github-actions
Copy link

github-actions bot commented Jun 7, 2023

https://api.github.com/ToEzBit/bonn-noi/blob/cad6d63c483bd541bff6d4dc7802e2fd5e9a2286/src/features/post/component/PostList.tsx#L11

import isEmpty from "lodash/isEmpty";
import map from "lodash/map";

import { api } from "~/utils/api";
import PostItem from "./PostItem";

function PostList() {
  const { data: posts, isLoading: postLoading } = api.post.getAll.useQuery();

  if (postLoading) {
    // TODO: create loading animation
    // labels: good first issue
    return <p>loading ...</p>;
  }

  if (isEmpty(posts)) {
    return null;
  }

  return (
    <div className=" mt-4  w-2/6 p-4">
      <ul className="flex flex-col gap-4">
        {map(posts, ({ post, author }) => (
          <PostItem post={post} author={author} key={post.id} />
        ))}
      </ul>
    </div>
  );
}

export default PostList;
@github-actions github-actions bot added good first issue Good for newcomers todo labels Jun 7, 2023
@mohibkay
Copy link
Contributor

Hi there,
Please assign this issue to me. I would like to work on this.

@ToEzBit ToEzBit assigned ToEzBit and mohibkay and unassigned ToEzBit Jun 11, 2023
@ToEzBit
Copy link
Owner

ToEzBit commented Jun 11, 2023

I appreciate your help 🥺

@mohibkay
Copy link
Contributor

mohibkay commented Jun 11, 2023

My pleasure. What kind of loader would you like me to use in the project?
Do we have a preference for the same?

@ToEzBit
Copy link
Owner

ToEzBit commented Jun 11, 2023

Design anything you like, without any worries

@mohibkay
Copy link
Contributor

Sure, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers todo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants