mattermost-mobile/app/utils/bottom_sheet/bottom_sheet.ts
Shaz Amjad 64223efafe
MM-28474: Custom Sidebar Categories (#5460)
* Further cleanup and fixes

Tests clean-up

Tests fixed?

Plays nicely with threads

Tests fixed

Fixes ESR and show experimental flags

Failing test fixed

DM Fix

WIP: Bottom bar UX

Fixes for unreads

Failing test

Always show current channel

Create a channel in a category!

* Unreads on top

* Various fixes

* Improves category collapsing

* Passes correct ID through

* Tests cleanup

* Redo unreads and unread-button

* Reverts to just using ids

* More unreads back to using ids

* Uses appropriate selectors for pref updates

* Unreads sorted by recency

* Fixes test for recency

* Fixes re-rendering bug

* Code review updates, websocket event debounced
2021-09-20 14:11:57 -04:00

22 lines
840 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
/* eslint-disable @typescript-eslint/no-explicit-any */
import {showModalOverCurrentContext} from '@actions/navigation';
export default {
showBottomSheetWithOptions: (options: any, callback: any) => {
function itemAction(index: any) {
callback(index);
}
const items = options.options.splice(0, options.cancelButtonIndex).map((o: string | {icon: string; text: string}, index: any) => ({
action: () => itemAction(index),
text: typeof o === 'string' ? o : o.text,
icon: typeof o === 'string' ? null : o.icon,
}));
showModalOverCurrentContext('OptionsModal', {title: options.title || '', items, subtitle: options.subtitle});
},
};