From 6c48c3f58246e23127f14f081db728491652de96 Mon Sep 17 00:00:00 2001 From: Andrei Dekterev Date: Fri, 16 Sep 2022 15:04:03 +0400 Subject: [PATCH] fix(#2818): add sort for teams --- .../MatchPage/components/FavouriteTeam/hooks.tsx | 9 ++++++++- .../MatchPage/components/FavouriteTeam/styled.tsx | 15 ++++++++++++--- .../components/APISettings/index.tsx | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/features/MatchPage/components/FavouriteTeam/hooks.tsx b/src/features/MatchPage/components/FavouriteTeam/hooks.tsx index 8611ad4e..c46d8b2e 100644 --- a/src/features/MatchPage/components/FavouriteTeam/hooks.tsx +++ b/src/features/MatchPage/components/FavouriteTeam/hooks.tsx @@ -80,7 +80,14 @@ export const useFavouriteTeam = () => { tournament_id: 131, }).then(({ data, status }: ResponseType) => { 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) }else{ return diff --git a/src/features/MatchPage/components/FavouriteTeam/styled.tsx b/src/features/MatchPage/components/FavouriteTeam/styled.tsx index 8827b27c..4ff72be7 100644 --- a/src/features/MatchPage/components/FavouriteTeam/styled.tsx +++ b/src/features/MatchPage/components/FavouriteTeam/styled.tsx @@ -14,12 +14,17 @@ export const ScModalContainer = styled(BaseModal)` padding: 0; background: #333333; border-radius: 5px; + z-index: 100; ${customScrollbar} ${isMobileDevice ? css` 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%; ${isMobileDevice ? css` - height: 75vh; + height: 70vh; @media screen and (orientation: landscape){ - height: 60vh; + height: 30vh; } ` : ''}; @@ -110,6 +115,10 @@ export const ScTeamsList = styled.div` flex-wrap: unset; max-height: unset; + > * { + margin-bottom: 15px; + } + ` : ''}; ` diff --git a/src/features/SystemSettings/components/APISettings/index.tsx b/src/features/SystemSettings/components/APISettings/index.tsx index 8f92cc5d..76bd2659 100644 --- a/src/features/SystemSettings/components/APISettings/index.tsx +++ b/src/features/SystemSettings/components/APISettings/index.tsx @@ -28,7 +28,7 @@ const options: Array