Refactor GameDetailPage for improved state management and media handling#197
Merged
Conversation
…ia handling - Refactored state management for installingFromSource to simplify structure and improve clarity. - Introduced useMemo for installModalMediaBySteamAppId to optimize media data handling. - Cleaned up import statements and removed unused variables for better code organization. - Adjusted conditional rendering of InstallModal to ensure proper game data is passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the
GameDetailPagecomponent to improve how media assets and game data are handled during game installation. The changes simplify state management for the install modal, remove unnecessary image handling from the state, and introduce a new approach for passing media data. Additionally, there is a minor workflow adjustment in the release process.Game install modal improvements:
installingFromSourcestate inGameDetailPage.tsxis simplified to only track thesizeproperty, removing the previously includedimageproperty. [1] [2]useMemohook (installModalMediaBySteamAppId), which constructs a record of media assets keyed by Steam App ID. This is passed to theInstallModalcomponent instead of a single image. [1] [2] [3]InstallModalis now rendered only if bothinstallingFromSourceandgameare present, and it receives the newgameandmediaBySteamAppIdprops instead ofgameImage.Code cleanup:
getGameImageUrlfrom@utils/gameImageinGameDetailPage.tsx.useMemoandSteamAppdetailsMediaResultfor improved type safety and memoization. [1] [2]Workflow update:
.github/workflows/release.yml, thegenerate_release_notes: trueoption is removed from the GitHub release action, likely to prevent automatic generation of release notes.