-
Notifications
You must be signed in to change notification settings - Fork 35
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
Show battle info on hover #1885
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Failed to generate code suggestions for PR |
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.
The pull request successfully implements the functionality to show battle information on hover, addressing issue #1865. The changes are well-structured and consistent with the project's coding style. The refactoring of BattleProgressBar into smaller components (BattleProgress, DurationLeft, ProgressBar) improves code organization and reusability. The new BattleInfoLabel component provides a good user experience for viewing battle information. Overall, this is a solid implementation that enhances the game's UI. Consider adding some comments to explain complex logic in certain areas, and it might be beneficial to add unit tests for the new components and functionality in the future.
Thanks for using MentatBot. Give comments a 👍 or 👎 to help me improve!
const getStructure = useStructureByPosition(); | ||
const hoveredBattlePosition = useUIStore((state) => state.hoveredBattle); | ||
const currentTimestamp = useUIStore.getState().nextBlockTimestamp || 0; | ||
|
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.
Consider adding a comment to explain the purpose of filtering battles with duration_left > 0.
@@ -17,48 +17,62 @@ function formatTimeDifference(time: Date) { | |||
} | |||
} | |||
|
|||
export const BattleProgressBar = ({ | |||
export const DurationLeft = ({ |
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.
The DurationLeft component is well-implemented, but consider adding a brief comment explaining its purpose and how it handles different battle states.
This pull request adds the functionality to show battle information on hover, similar to how realm information is displayed.
Fixes #1865