-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat/news-demo - Issue #7 #11
Conversation
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.
Wszystko wyglada raczej git, drobne jakies rzeczy tylko
src/lib/types.ts
Outdated
export interface NewsProps { | ||
id: number; | ||
name: string; | ||
date_created: Date; |
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.
API zwraca tu stringa, więc trzeba na to uwazac, w miare bezpiecznie moze byc jakos tak
date_created: Date; | |
date_created: Date | string; |
albo bezpieczniej
date_created: Date; | |
date_created: string; | |
dateTime_created: Date; |
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.
W przyszlosci trzeba bedzie pewnie pomyslec o jakiejs sensownej obsludze bledow i paginacji, poki co mysle ze git
src/components/NewsDemo.tsx
Outdated
const newsSortedByDate = news.sort( | ||
(a, b) => b.date_created.getTime() - a.date_created.getTime() | ||
); |
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.
Poki co wystarczy odwrocic liste, bo dane sa autonumerowanych indexach, przez zrobi sie liniowa zlozonosc
const newsSortedByDate = news.sort( | |
(a, b) => b.date_created.getTime() - a.date_created.getTime() | |
); | |
const newsSortedByDate = news.reverse(); |
@Octopus4344 poprawiłem te rzeczy i dodalem basic paginację. |
Dodałem podstronkę zaciągającą i prowizorycznie wyświetlającą newsy z bazy.
Jesli chodzi o zmiany w types.ts i Navbar.tsx to głównie Prettier.