Cat project assessment | Thodoris Magkavetsos#39
Conversation
…- add basic routing and navbar
…ng states - create first view with basic options of load more and refresh
…r fix for vercel deployment
gpositive
left a comment
There was a problem hiding this comment.
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.
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.
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" } |
| { | ||
| id: Date.now(), | ||
| image_id, | ||
| created_at: new Date().toISOString() |
There was a problem hiding this comment.
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.
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