Skip to content
This repository was archived by the owner on Mar 23, 2022. It is now read-only.

Commit 783521b

Browse files
committed
Added active handling for all dropdown buttons
Signed-off-by: RaenonX <[email protected]>
1 parent 99b2166 commit 783521b

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/components/elements/gameData/unit/filter/main.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ export const UnitFilter = <S extends string,
107107
<DropdownButton title={sortTitle} variant="outline-light" menuVariant="dark">
108108
{Object.entries(sortOrderNames).map(([sortBy, getNameFunc], idx) => (
109109
<Dropdown.Item
110-
key={idx} onClick={() => setInputData({...inputData, sortBy: sortBy as S})}
110+
key={idx}
111+
onClick={() => setInputData({...inputData, sortBy: sortBy as S})}
112+
active={sortBy === inputData.sortBy}
111113
>
112114
{t(getNameFunc as GetTranslationFunction)}
113115
</Dropdown.Item>

src/components/pages/gameData/skillAtk/sorter/main.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export const AttackingSkillSorter = ({inputData, onOrderPicked}: Props) => {
2828
return (
2929
<DropdownButton title={title} variant="outline-light" menuVariant="dark">
3030
{Object.entries(orderName).map(([sortBy, getNameFunc], idx) => (
31-
<Dropdown.Item key={idx} onClick={onItemPicked(sortBy as SortBy)}>
31+
<Dropdown.Item
32+
key={idx}
33+
onClick={onItemPicked(sortBy as SortBy)}
34+
active={sortBy === inputData.sortBy}
35+
>
3236
{t(getNameFunc)}
3337
</Dropdown.Item>
3438
))}

src/components/pages/tier/const.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ export const sortFunc: SortFuncLookup = {
3636
};
3737

3838
export const orderName: {[sortBy in SortOrder]: GetTranslationFunction} = {
39-
unitId: (t) => t.game.unitTier.sort.unitId,
40-
avgRanking: (t) => t.game.unitTier.sort.avgRanking,
4139
lastUpdated: (t) => t.game.unitTier.sort.lastUpdated,
40+
avgRanking: (t) => t.game.unitTier.sort.avgRanking,
4241
conSolo: (t) => t.game.unitTier.dimension.conSolo,
4342
conAi: (t) => t.game.unitTier.dimension.conAi,
4443
conCoop: (t) => t.game.unitTier.dimension.conCoop,
@@ -47,6 +46,7 @@ export const orderName: {[sortBy in SortOrder]: GetTranslationFunction} = {
4746
normalCoop: (t) => t.game.unitTier.dimension.normalCoop,
4847
sharedSkill: (t) => t.game.unitTier.dimension.sharedSkill,
4948
kaleidoscape: (t) => t.game.unitTier.dimension.kaleidoscape,
49+
unitId: (t) => t.game.unitTier.sort.unitId,
5050
};
5151

5252
export const rankingColor: {[ranking in Ranking]: Property.Color} = {

src/components/pages/tier/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {EntryPack, EntryPackOfRanking, InputData, KeyPointsOfType} from './types
1212

1313

1414
export const generateInputData = (): InputData => ({
15-
...generateFilterInput('avgRanking'),
15+
...generateFilterInput('lastUpdated'),
1616
display: 'all',
1717
});
1818

0 commit comments

Comments
 (0)