Merge branch '21128-toolbar-context-menu'
[arvados-workbench2.git] / src / store / banner / banner-action.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { Dispatch } from "redux";
6 import { RootState } from "store/store";
7 import { unionize, UnionOf } from 'common/unionize';
8
9 export const bannerReducerActions = unionize({
10     OPEN_BANNER: {},
11     CLOSE_BANNER: {},
12 });
13
14 export type BannerAction = UnionOf<typeof bannerReducerActions>;
15
16 export const openBanner = () =>
17     async (dispatch: Dispatch, getState: () => RootState) => {
18         dispatch(bannerReducerActions.OPEN_BANNER());
19     };
20
21 export const closeBanner = () =>
22     async (dispatch: Dispatch<any>, getState: () => RootState) => {
23         dispatch(bannerReducerActions.CLOSE_BANNER());
24     };
25
26 export default {
27     openBanner,
28     closeBanner
29 };