fix(#2818): add sort for teams

keep-around/99001d5964a4727568711990575a9f282fe3f67e
Andrei Dekterev 3 years ago
parent 19317a7608
commit 6c48c3f582
  1. 9
      src/features/MatchPage/components/FavouriteTeam/hooks.tsx
  2. 15
      src/features/MatchPage/components/FavouriteTeam/styled.tsx
  3. 2
      src/features/SystemSettings/components/APISettings/index.tsx

@ -80,7 +80,14 @@ export const useFavouriteTeam = () => {
tournament_id: 131, tournament_id: 131,
}).then(({ data, status }: ResponseType) => { }).then(({ data, status }: ResponseType) => {
if(!status) { if(!status) {
setTeams(data) setTeams(data.sort((n1:FavouriteTeams , n2: FavouriteTeams) => {
if (n1.name_en > n2.name_en) {
return 1;
} else if (n1.name_en < n2.name_en) {
return -1;
}
return 0;
}))
setIsOpen(true) setIsOpen(true)
}else{ }else{
return return

@ -14,12 +14,17 @@ export const ScModalContainer = styled(BaseModal)`
padding: 0; padding: 0;
background: #333333; background: #333333;
border-radius: 5px; border-radius: 5px;
z-index: 100;
${customScrollbar} ${customScrollbar}
${isMobileDevice ${isMobileDevice
? css` ? css`
width: 95vw; width: 95vw;
height: 95vh; max-height: 90vh;
@media screen and (orientation: landscape){
max-height: 70vh;
}
` `
: ''}; : ''};
} }
@ -73,10 +78,10 @@ export const ScGroup = styled.div`
width: 100%; width: 100%;
${isMobileDevice ${isMobileDevice
? css` ? css`
height: 75vh; height: 70vh;
@media screen and (orientation: landscape){ @media screen and (orientation: landscape){
height: 60vh; height: 30vh;
} }
` `
: ''}; : ''};
@ -110,6 +115,10 @@ export const ScTeamsList = styled.div`
flex-wrap: unset; flex-wrap: unset;
max-height: unset; max-height: unset;
> * {
margin-bottom: 15px;
}
` `
: ''}; : ''};
` `

@ -28,7 +28,7 @@ const options: Array<Option> = [
{ {
details: getHost(APIS.staging.api), details: getHost(APIS.staging.api),
key: 'staging', key: 'staging',
label: 'STAGE-OLD', label: 'TEST',
}, },
// { // {
// details: getHost(APIS.preproduction.api), // details: getHost(APIS.preproduction.api),

Loading…
Cancel
Save