-
Notifications
You must be signed in to change notification settings - Fork 49
Cat project assessment | Thodoris Magkavetsos #39
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
base: main
Are you sure you want to change the base?
Conversation
…- add basic routing and navbar
…ng states - create first view with basic options of load more and refresh
…r fix for vercel deployment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @magkavetsos - Thanks for your time and effort in doing this! :)
I've checked your assignment and I have some questions for you:
- How come you used tailwind? Are you familiar with alternatives?
- Can you please respond to the comments I made across the whole project?
Again thanks for your submission and looking forward to your answers!
}) => { | ||
const [showMore, setShowMore] = useState(false); | ||
const description = breed.description ?? ""; | ||
const teaser = description.slice(0, 140); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that you've decided to use string slicing for this truncation use case which can cut words and isn’t really responsive.
Can you think of any better ways to achieve a similar or even better result? If so can you mention and pros/cons?
import BreedsView from "./routes/Breeds/BreedsView"; | ||
import FavoritesView from "./routes/Favorites/FavoritesView"; | ||
|
||
const queryClient = new QueryClient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the query client is using just the default options. I'd you had to override some of these, what would these be?
"files": [], | ||
"references": [ | ||
{ "path": "./tsconfig.app.json" }, | ||
{ "path": "./tsconfig.node.json" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file needed? If so, why?
{ | ||
id: Date.now(), | ||
image_id, | ||
created_at: new Date().toISOString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you help me understand if and why created_at
attribute is needed here?
return useInfiniteQuery({ | ||
queryKey: ["images", "random", limit], | ||
initialPageParam: 0, | ||
queryFn: async ({ pageParam = 0 }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the pageParam
has always the same value in here? Do you have any way to get the page somehow from the API and the react query helpers?
Description
This PR adds a lightweight React + TypeScript app built with Vite.
The app allows users to:
🔗 Live demo (deployed on Vercel): here
📖 For setup instructions, environment variables, and more details, see the README file