Skip to content

Commit bc3926e

Browse files
author
avin_kumar
committed
types safety added
1 parent bf73034 commit bc3926e

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

packages/app/src/app/overmind/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const modalOpened: Action<{ modal: ModalName; message?: string }> = (
8585
state.currentModal = modal;
8686
};
8787

88-
export const modalClosed: Action = ({ state, effects }) => {
88+
export const modalClosed: Action<any> = ({ state, effects }) => {
8989
// We just start it whenever it closes, if already started nothing happens
9090
if (state.currentModal === 'preferences') {
9191
effects.keybindingManager.start();

packages/app/src/app/pages/common/Modals/index.js renamed to packages/app/src/app/pages/common/Modals/index.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ const modals = {
140140
},
141141
};
142142

143-
const Modals = () => {
143+
const Modals: React.FC = () => {
144144
const {
145-
actions: { modalClosed },
145+
actions,
146146
state: {
147147
editor: { currentSandbox },
148148
preferences: {
@@ -195,16 +195,15 @@ const Modals = () => {
195195
<Modal
196196
isOpen={Boolean(modal)}
197197
width={modal && modal.width}
198-
onClose={isKeyDown => modalClosed({ isKeyDown })}
198+
onClose={isKeyDown => actions.modalClosed({ isKeyDown })}
199199
>
200200
{modal
201201
? React.createElement(modal.Component, {
202-
closeModal: () => modalClosed({ isKeyDown: false }),
202+
closeModal: () => actions.modalClosed({ isKeyDown: false }),
203203
})
204204
: null}
205205
</Modal>
206206
</ThemeProvider>
207207
);
208208
};
209-
export default Modals;
210-
// export default inject('store', 'signals')(observer(Modals));
209+
export { Modals };

packages/app/src/app/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Loadable from 'app/utils/Loadable';
1111
import { useOvermind } from 'app/overmind';
1212
import { ErrorBoundary } from './common/ErrorBoundary';
1313
import HTML5Backend from './common/HTML5BackendWithFolderSupport';
14-
import Modals from './common/Modals';
14+
import { Modals } from './common/Modals';
1515
import Sandbox from './Sandbox';
1616
import { NewSandbox } from './NewSandbox';
1717
import Dashboard from './Dashboard';

0 commit comments

Comments
 (0)