Closed aymericdelab closed 4 days ago
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
eternum | โ Ready (Inspect) | Visit Preview | ๐ฌ Add feedback | Jun 29, 2024 11:06am |
โฑ๏ธ Estimated effort to review [1-5] | 4 |
๐งช Relevant tests | No |
๐ Security concerns | No |
โก Key issues to review |
Possible Bug: The getQuestResources function in useRealm.tsx uses useRealmStore inside a regular function which might lead to unexpected behaviors as hooks should only be called at the top level of React functional components or custom hooks. |
Performance Concern: The handleAllClaims function in HintBox.tsx might lead to performance issues due to multiple state updates and potentially large and nested data manipulations with flatMap and map inside a loop. | |
Code Clarity: The getQuestResources function in useRealm.tsx could be refactored for better clarity and efficiency. The current implementation with nested access and transformations is hard to read and maintain. |
Category | Suggestion | Score |
Enhancement |
Manage loading state effectively in
___
**Implement loading state management in | 9 |
Possible issue |
Add error handling to the
___
**Consider adding error handling for the | 8 |
Performance |
Use a
___
**Optimize the | 8 |
Best practice |
Refactor
___
**Refactor the | 7 |
PR Type
Enhancement, Bug fix
Description
mint_resources
function to the system calls and integrated it into theHintBox
component.getQuestResources
function inuseRealm
hook to dynamically fetch quest resources.setQuestConfig
function from the configuration.startingResourcesInputProductionFactor
.Changes walkthrough ๐
createSystemCalls.ts
Add mint_resources function to system calls
client/src/dojo/createSystemCalls.ts
mint_resources
function to mint resources.mint_resources
in the exported system calls.useRealm.tsx
Add getQuestResources function to useRealm hook
client/src/hooks/helpers/useRealm.tsx
getQuestResources
from@bibliothecadao/eternum
.getQuestResources
function to fetch quest resources.getQuestResources
in the returned object ofuseRealm
.HintBox.tsx
Integrate dynamic quest resources in HintBox component
client/src/ui/components/hints/HintBox.tsx
getQuestResources
usage inHintBox
component.handleAllClaims
to usemint_resources
.QuestRewards
to use dynamic quest resources.index.ts
Remove setQuestConfig function from configuration
sdk/packages/eternum/src/config/index.ts - Removed `setQuestConfig` function.
global.ts
Add startingResourcesInputProductionFactor to global config
sdk/packages/eternum/src/constants/global.ts
startingResourcesInputProductionFactor
to global configuration.resources.ts
Update resource amounts for quest types
sdk/packages/eternum/src/constants/resources.ts - Adjusted resource amounts for various quest types.
index.ts
Add utility functions and implement getQuestResources
sdk/packages/eternum/src/utils/index.ts
getQuestResources
function.QUEST_RESOURCES_SCALED
export.