1
0
Fork 0
forked from gitea/nas

Change navigation layout on small screens in web UI (#34910)

This commit is contained in:
Eugen Rochko 2025-06-11 13:55:43 +02:00 committed by GitHub
parent 8cf246e4d3
commit a13b33d851
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 1390 additions and 682 deletions

View file

@ -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(),
);