Files
cinny/src/client/action/navigation.js
T

85 lines
1.6 KiB
JavaScript
Raw Normal View History

2021-07-28 18:45:52 +05:30
import appDispatcher from '../dispatcher';
import cons from '../state/cons';
2021-08-30 08:31:13 +05:30
function changeTab(tabId) {
2021-07-28 18:45:52 +05:30
appDispatcher.dispatch({
type: cons.actions.navigation.CHANGE_TAB,
tabId,
});
}
function selectRoom(roomId) {
appDispatcher.dispatch({
type: cons.actions.navigation.SELECT_ROOM,
roomId,
});
}
function togglePeopleDrawer() {
appDispatcher.dispatch({
type: cons.actions.navigation.TOGGLE_PEOPLE_DRAWER,
});
}
function openInviteList() {
appDispatcher.dispatch({
type: cons.actions.navigation.OPEN_INVITE_LIST,
});
}
function openPublicChannels(searchTerm) {
2021-07-28 18:45:52 +05:30
appDispatcher.dispatch({
type: cons.actions.navigation.OPEN_PUBLIC_CHANNELS,
searchTerm,
2021-07-28 18:45:52 +05:30
});
}
function openCreateChannel() {
appDispatcher.dispatch({
type: cons.actions.navigation.OPEN_CREATE_CHANNEL,
});
}
function openInviteUser(roomId, searchTerm) {
2021-07-28 18:45:52 +05:30
appDispatcher.dispatch({
type: cons.actions.navigation.OPEN_INVITE_USER,
roomId,
searchTerm,
2021-07-28 18:45:52 +05:30
});
}
function openSettings() {
appDispatcher.dispatch({
type: cons.actions.navigation.OPEN_SETTINGS,
});
}
2021-08-14 10:19:29 +05:30
function openEmojiBoard(cords, requestEmojiCallback) {
appDispatcher.dispatch({
type: cons.actions.navigation.OPEN_EMOJIBOARD,
cords,
requestEmojiCallback,
});
}
2021-08-16 17:37:29 +05:30
function openReadReceipts(roomId, eventId) {
appDispatcher.dispatch({
type: cons.actions.navigation.OPEN_READRECEIPTS,
roomId,
eventId,
});
}
2021-07-28 18:45:52 +05:30
export {
2021-08-30 08:31:13 +05:30
changeTab,
2021-07-28 18:45:52 +05:30
selectRoom,
togglePeopleDrawer,
openInviteList,
openPublicChannels,
openCreateChannel,
openInviteUser,
openSettings,
2021-08-14 10:19:29 +05:30
openEmojiBoard,
2021-08-16 17:37:29 +05:30
openReadReceipts,
2021-07-28 18:45:52 +05:30
};