Change navigation layout on small screens in web UI (#34910)
This commit is contained in:
parent
8cf246e4d3
commit
a13b33d851
34 changed files with 1390 additions and 682 deletions
|
@ -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(),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue