Skip to content

Commit c22379f

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch CommitModal to use useOvermind (codesandbox#2536)
1 parent acbbc0b commit c22379f

File tree

1 file changed

+18
-8
lines changed
  • packages/app/src/app/pages/common/Modals/CommitModal

1 file changed

+18
-8
lines changed

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

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
1-
import React from 'react';
2-
import { inject, observer } from 'app/componentConnectors';
1+
import React, { FunctionComponent } from 'react';
2+
33
import { GitProgress } from 'app/components/GitProgress';
4+
import { useOvermind } from 'app/overmind';
5+
6+
const CommitModal: FunctionComponent = () => {
7+
const {
8+
state: {
9+
editor: {
10+
currentSandbox: { originalGit: git },
11+
},
12+
git: { commit },
13+
user: { username },
14+
},
15+
} = useOvermind();
416

5-
function CommitModal({ store }) {
6-
const git = store.editor.currentSandbox.originalGit;
7-
const { commit } = store.git;
817
let message;
918

1019
if (commit) {
1120
if (commit.newBranch) {
1221
const newUrl = `https://github.com/${git.username}/${git.repo}/compare/${
1322
git.branch
14-
}...${store.user.username}:${commit.newBranch}?expand=1`;
23+
}...${username}:${commit.newBranch}?expand=1`;
24+
1525
message = (
1626
<div>
1727
There was a merge conflict while committing, you can open a PR
@@ -36,6 +46,6 @@ function CommitModal({ store }) {
3646
}
3747

3848
return <GitProgress result={message} message="Creating Commit..." />;
39-
}
49+
};
4050

41-
export default inject('store')(observer(CommitModal));
51+
export default CommitModal;

0 commit comments

Comments
 (0)