Skip to content
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

Issue #1000 Responsive design changes and element overhaul to Player Loadout in tarkov.dev/players/* pages #1001

Merged
merged 9 commits into from
Oct 28, 2024

Conversation

Applefrittr
Copy link

@Applefrittr Applefrittr commented Oct 27, 2024

Responsive Design and UI overhaul to Player loadouts in tarkov.dev/players/* Issue #1000

Targeted changes to provide a better user experience, especially on phone.

Description 🗒️

Refer to Issue #1000. The original loadout element caused page layout concerns, especially on smaller screens. Overflow issues fixed and overall look of the element was changed dramatically to give the look and feel of the in game character screen.

KEY CHANGES

  1. A new data field was added to fetched items from the API - 'inspectImageLink' (file: src/features/items/do-fetch-items.mjs)
  2. A new React hook was added to the hooks dir - 'useResponsiveScaling.jsx'. This hook works in conjunction with components/item-image/index.js to scale up/down images passed from pages/player/index.js based on screen size - RESPONSIVE 😃
  3. CSS media queries added to pages/player/index.css to match screen breakpoints set up in useResponsiveScaling.jsx. Grid layout overhaul.
  4. IMPORTANT!!!!!!!!!! I commented out the CloudFlare turnstile component, import statement, and the call to fetchProfile() is useEffect() in src/pages/player/index.js for ease of development. The CF turnstile prevents anything from happening on the page unless the capcha is passed. Unfortunately a request from localhost doesn't cut it 🫤 These changes NEED to be reversed before merge!!!!!! I left comments tagged with issue#1000 in the file itself to locate the changes easily.
  5. In order to get a profile loaded into my local environment for testing, I saved a few dummy profiles from the live site and used the LoadProfile feature on the tarkov.dev/players/* page. Those json files are located in src/pages/player/saved-profiles-issue#1000. Since there is no way (not that I found) to navigate to a unique tarkov.dev/players/* page, just type it in directly to the address bar, example: tarkov.dev/palyers/regular/1. This will bring up the unique player page with nothing loaded yet. Simply click the Load Profile button and pick a file from the added directory. Delete saved profiles directory before merge!
  6. My linter/Prettier kind of went crazy on the files I worked on, bloating the changes; I'm unsure if that is standard or not. Still learning 😄

Examples 📸

loadout1
responsive1
responsive2
responsive3

Related Issues 🔗

I explored the site after my changes in my local environment and did not notice any changes to other image elements across the site 🤞

First PR, be gentle 😃


Expand for Help

By submitting this pull request, you agree to our code of conduct

@Applefrittr Applefrittr requested a review from a team as a code owner October 27, 2024 03:40
@Razzmatazzz
Copy link
Member

Thanks for the PR! I'm going to edit this PR to merge it to a new branch of the repo, which will allow us to do the necessary testing and tweaks.

@Razzmatazzz Razzmatazzz changed the base branch from main to responsive-loadouts October 28, 2024 21:05
@Razzmatazzz Razzmatazzz merged commit 9e20e10 into the-hideout:responsive-loadouts Oct 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants