-
Notifications
You must be signed in to change notification settings - Fork 51
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
fix small ui bugs #1142
fix small ui bugs #1142
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Overall, this pull request contains several important optimizations and bug fixes. The changes in useQuests.tsx
improve performance and readability. The fix in QuestList.tsx
ensures all unclaimed quests are included, which is crucial for the skip tutorial functionality. The update to LeftNavigationModule.tsx
ensures proper reactivity to quest status changes. These changes should improve the overall user experience and application performance.
Thanks for using MentatBot. Give comments a 👍 or 👎 to help me improve!
(questId: QuestId) => { | ||
const dependency = questDependencies[questId]; | ||
return { | ||
const createQuest = (questId: QuestId) => { |
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.
Good optimization. Using useMemo
for each quest creation will prevent unnecessary re-renders.
? QuestStatus.Claimed | ||
: QuestStatus.Completed | ||
: QuestStatus.InProgress, | ||
status: questClaimStatus[QuestId.BuildFarm] |
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.
This refactoring improves readability and reduces nesting. It's a good change.
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
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.
lgtm
PR Type
Bug fix, Enhancement
Description
createQuest
function inuseQuests.tsx
to useuseMemo
directly, simplifying the code and improving performance.useQuests.tsx
.unclaimedQuests
inQuestList.tsx
to correctly exclude claimed quests.questClaimStatus
to the dependency array ofuseMemo
inLeftNavigationModule.tsx
to ensure proper memoization.Changes walkthrough 📝
useQuests.tsx
Refactor quest creation and status logic
client/src/hooks/helpers/useQuests.tsx
createQuest
function to useuseMemo
directly.useMemo
wrapping forquests
array.QuestList.tsx
Fix unclaimed quests filter condition
client/src/ui/components/quest/QuestList.tsx
unclaimedQuests
to exclude claimed quests.LeftNavigationModule.tsx
Update dependencies for navigation memoization
client/src/ui/modules/navigation/LeftNavigationModule.tsx
questClaimStatus
to dependency array ofuseMemo
.