mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-23 07:20:33 +00:00
Change navigation layout on small screens in web UI (#34910)
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 'mastodon/models/list';
|
||||
import type { RootState } from 'mastodon/store';
|
||||
import { createAppSelector } from 'mastodon/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