-
Notifications
You must be signed in to change notification settings - Fork 1
2023-04-25: Feedback zur Abgabe #4
base: initial
Are you sure you want to change the base?
Conversation
Feature/connect backend
Feature/connect backend
feat: add jest and reducer tests
Feature/xstate
Feature/timeline bonus
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -34,3 +42,6 @@ yarn-error.log* | |||
# typescript | |||
*.tsbuildinfo | |||
next-env.d.ts | |||
|
|||
# vscode | |||
.vscode |
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.
Gehört egtl. in die Config des individuellen Entwicklers ~/.gitignore
(da ihr das wohl für jedes Projekt so wollt und nicht alle verschiedenen Umgebungen ins Projekt .gitignore
sollten.
|
||
type PageProps = {}; | ||
export default function TimelinePage() { |
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.
Komponente sollte durch Auslagerung vereinfacht werden. (Beispielsweise neue Posts im Background laden)
isDisabled: true, | ||
text: '', | ||
}); | ||
const [state, dispatch] = useReducer(mumbleDetailReducer, { |
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.
useState
und useReducer
zu mischen kann gefährlich werden. Es würde sich anbieten, eine Strategie zu verfolgen.
<Modal | ||
title="Oops." | ||
isOpen={state.hasError} | ||
LLable="Abbrechen" |
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.
typo?
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.
wo?
}; | ||
|
||
const likePost = async (isLiked: boolean, id: string) => { | ||
console.log(profileState); |
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.
Sollte entfernt werden, da debug code.
} | ||
|
||
const headers = new Headers(); | ||
headers.append('Authorization', `Bearer ${token}`); |
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.
if (token) {
headers.append('Authorization', `Bearer ${token}`);
}
Oder sogar zu Beginn handeln, da ohne Token ja nicht möglich. (Custom Error throwen)
/> | ||
<meta name="author" content="Attila Toth" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>{`${convertRouteToSiteName(router.route)} | Mumble`}</title> |
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.
Coole Idee, aber auch etwas gefährlich (bspw. Einführung neue Seiten)
} | ||
return state.matches('idle') || state.matches('mutationFailed'); | ||
}); | ||
return Promise.resolve(); |
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.
Eine Async Funktion returned immer implizit eine Promise, sollte entfernt werden können
}); | ||
}; | ||
|
||
const submitPost = async (image: File | undefined, text: string) => { |
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.
Error Handling?
isDisabled: true, | ||
text: '', | ||
}); | ||
const machineService = useInterpret(profileMachine); |
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.
Sehr schön hast du mit xState gearbeitet. 👏
useMachine
wäre für diesen Use Case geeigneter und einfacher gewesen. Und das Wrappen der send-Function in eine zusätzliche Funktion verringert die Lesbarkeit.
No description provided.