BibliothecaDAO / eternum

onchain eternal game
https://alpha-eternum.realms.world
MIT License
36 stars 30 forks source link

feat: Styling of hex information panel #1026

Closed edisontim closed 6 days ago

edisontim commented 6 days ago

PR Type

Enhancement


Description


Changes walkthrough πŸ“

Relevant files
Enhancement
StructureCard.tsx
Refactor and enhance StructureCard and related components.

client/src/ui/components/hyperstructures/StructureCard.tsx
  • Removed unused ArrowDown import.
  • Adjusted layout and styling of StructureCard and MergeTroopsPanel.
  • Added setShowMergeTroopsPopup prop to MergeTroopsPanel.
  • Enhanced TroopExchange component with better layout and button
    positioning.
  • +46/-38 
    Battle.tsx
    Adjust styling of EnemyArmies component.                                 

    client/src/ui/components/military/Battle.tsx - Minor styling adjustment to `EnemyArmies` component.
    +1/-1     
    HexagonInformationPanel.tsx
    Update layout and styling of HexagonInformationPanel.       

    client/src/ui/components/worldmap/hexagon/HexagonInformationPanel.tsx
  • Adjusted layout and styling of HexagonInformationPanel.
  • Commented out Coordinates component.
  • +3/-3     
    RealmListItem.tsx
    Enhance layout and styling of RealmListItem.                         

    client/src/ui/components/worldmap/realms/RealmListItem.tsx
  • Adjusted layout and styling of RealmListItem.
  • Improved resource display and inventory layout.
  • +4/-4     

    πŸ’‘ PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    vercel[bot] commented 6 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 26, 2024 8:40pm
    github-actions[bot] commented 6 days ago

    PR Reviewer Guide πŸ”

    ⏱️ Estimated effort to review [1-5] 3
    πŸ§ͺ Relevant tests No
    πŸ”’ Security concerns No
    ⚑ Key issues to review Layout Consistency:
    The changes in StructureCard.tsx and TroopExchange introduce different layout and styling adjustments. It's important to ensure that these changes maintain a consistent look and feel with the rest of the application. For instance, the MergeTroopsPanel and TroopExchange components have significant layout changes that should be visually verified against the application's design standards.
    Propagation of Props:
    The addition of setShowMergeTroopsPopup as a prop in MergeTroopsPanel is a significant change. It's crucial to ensure that this prop is appropriately used and does not introduce any side effects or unexpected behavior, especially since it affects the visibility state of UI components.
    Commented Code:
    The Coordinates component in HexagonInformationPanel.tsx is commented out. If this component is no longer needed, it should be removed instead of commented to keep the codebase clean.
    github-actions[bot] commented 6 days ago

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Move inline styles to CSS classes for better maintainability ___ **It's a good practice to avoid inline styles for better maintainability and separation of
    concerns. Consider moving the inline styles to a CSS class.** [client/src/ui/components/hyperstructures/StructureCard.tsx [114]](https://github.com/BibliothecaDAO/eternum/pull/1026/files#diff-dc87a3d6de7675f4a22a24979bc532796ebef68a9ac4cc8ed2d64217038fecddR114-R114) ```diff -
    8
    Maintainability
    Improve readability and maintainability by using descriptive class names ___ **Consider using a more descriptive class name for the div element to improve readability
    and maintainability of the CSS classes.** [client/src/ui/components/hyperstructures/StructureCard.tsx [74]](https://github.com/BibliothecaDAO/eternum/pull/1026/files#diff-dc87a3d6de7675f4a22a24979bc532796ebef68a9ac4cc8ed2d64217038fecddR74-R74) ```diff -
    +
    ```
    Suggestion importance[1-10]: 7 Why: Using more descriptive class names can improve readability and maintainability, but this is a minor improvement and not crucial for functionality.
    7
    Enhancement
    Enhance user experience by adding a confirmation step when changing transfer direction ___ **To enhance the user experience, consider adding a tooltip or a modal confirmation when
    switching the transfer direction, especially if this action has significant implications.** [client/src/ui/components/hyperstructures/StructureCard.tsx [293-303]](https://github.com/BibliothecaDAO/eternum/pull/1026/files#diff-dc87a3d6de7675f4a22a24979bc532796ebef68a9ac4cc8ed2d64217038fecddR293-R303) ```diff -
    7
    Performance
    Improve performance by debouncing the button click event ___ **To ensure that the setShowMergeTroopsPopup function is only called when necessary,
    consider debouncing the button click event. This can prevent unnecessary re-renders and
    improve performance.** [client/src/ui/components/hyperstructures/StructureCard.tsx [293-303]](https://github.com/BibliothecaDAO/eternum/pull/1026/files#diff-dc87a3d6de7675f4a22a24979bc532796ebef68a9ac4cc8ed2d64217038fecddR293-R303) ```diff -
    6