sunnydl / GamePerformanceTracker

Team project for CSE 115A in Fall 2021, UCSC
3 stars 0 forks source link

Add region selection to search bar #23

Closed sunnydl closed 2 years ago

sunnydl commented 2 years ago

image Something similar to the above. The options list should include most regions.

UI design is up to you

Functionality-wise: Make it similar to how summonerName works on the search bar. Basically:

  1. save the selected region name on the url, make it default as 'NA'.
  2. get the region value from the url on the component where Axios request is happening.
  3. add a param field 'region' to the Axios request with the region value.

The mapping of the region is as the following (from /backend/config/riotApis.ts)

Regions = {
    'NA': 'na1.api.riotgames.com',
    'KR': 'kr.api.riotgames.com',
    'JP': 'jp1.api.riotgames.com',
    'BR': 'br1.api.riotgames.com',
    'EUN': 'eun1.api.riotgames.com',
    'EUW': 'euw1.api.riotgames.com',
    'LA1': 'la1.api.riotgames.com',
    'LA2': 'la2.api.riotgames.com',
    'OC': 'oc1.api.riotgames.com',
    'TR': 'tr1.api.riotgames.com',
    'RU': 'ru.api.riotgames.com',
};

so the param field 'region' should have value such as 'NA', 'KR', and so on.

Since @Hao-bot-5000 made the search bar, if you come across any problem, u can ask him for advice, or u can ask me. Thanks!