mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 00:38:27 +00:00
[Glitch] Change navigation layout on small screens in web UI
Port a13b33d851 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import type { Map as ImmutableMap } from 'immutable';
|
||||
import type { Map as ImmutableMap, List as ImmutableList } from 'immutable';
|
||||
|
||||
import type { List } from 'flavours/glitch/models/list';
|
||||
import type { RootState } from 'flavours/glitch/store';
|
||||
import { createAppSelector } from 'flavours/glitch/store';
|
||||
|
||||
export const getOrderedLists = createSelector(
|
||||
[(state: RootState) => state.lists],
|
||||
(lists: ImmutableMap<string, List | null>) =>
|
||||
lists
|
||||
.toList()
|
||||
.filter((item: List | null) => !!item)
|
||||
.sort((a: List, b: List) => a.title.localeCompare(b.title))
|
||||
.toArray(),
|
||||
const getLists = createAppSelector(
|
||||
[(state) => state.lists],
|
||||
(lists: ImmutableMap<string, List | null>): ImmutableList<List> =>
|
||||
lists.toList().filter((item: List | null): item is List => !!item),
|
||||
);
|
||||
|
||||
export const getOrderedLists = createAppSelector(
|
||||
[(state) => getLists(state)],
|
||||
(lists) =>
|
||||
lists.sort((a: List, b: List) => a.title.localeCompare(b.title)).toArray(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user