summaryrefslogtreecommitdiff
path: root/src/store/modals.ts
blob: 0b27ce9e0e058b0c30c6f181e7e4ccf1f2318eb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { DispatchFn } from './types';

export function openModal(modalName: string) {
  return (dispatch: DispatchFn) => {
    dispatch(`openModal:${modalName}`, (s) => {
      s.modals[modalName] = true;
    });
  };
}

export function closeModal(modalName: string) {
  return (dispatch: DispatchFn) => {
    dispatch(`closeModal:${modalName}`, (s) => {
      s.modals[modalName] = false;
    });
  };
}

export const initialState = { apiConfig: false };