Skip to content

Commit 8f59b5a

Browse files
hetpatel33SaraVieira
authored andcommitted
🔨Refactored 🧠 Overmind Hacktober | /app/pages/common/Modals/P… (#2755)
* refactor app/pages/common/Modals/PRModal/index.tsx : use overmind and convert to tsx * removed packages/app/src/app/pages/common/Modals/PRModal/index.js
1 parent 4f2755e commit 8f59b5a

File tree

1 file changed

+14
-7
lines changed
  • packages/app/src/app/pages/common/Modals/PRModal

1 file changed

+14
-7
lines changed
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
import React from 'react';
2-
import { inject, observer } from 'app/componentConnectors';
2+
import { useOvermind } from 'app/overmind';
33
import { GitProgress } from 'app/components/GitProgress';
44

5-
function PRModal({ store }) {
5+
const PRModal: React.FC = () => {
66
let result = null;
77

8-
if (!store.git.isCreatingPr) {
9-
const newUrl = store.git.pr.prURL;
8+
const {
9+
state: {
10+
git: {
11+
isCreatingPr,
12+
pr: { prURL },
13+
},
14+
},
15+
} = useOvermind();
1016

17+
if (!isCreatingPr) {
1118
result = (
1219
<div>
1320
Done! We{"'"}ll now open the new sandbox of this PR and GitHub in 3
1421
seconds...
1522
<div style={{ fontSize: '.875rem', marginTop: '1rem' }}>
16-
<a href={newUrl} target="_blank" rel="noreferrer noopener">
23+
<a href={prURL} target="_blank" rel="noreferrer noopener">
1724
Click here if nothing happens.
1825
</a>
1926
</div>
@@ -27,6 +34,6 @@ function PRModal({ store }) {
2734
message="Forking Repository & Creating PR..."
2835
/>
2936
);
30-
}
37+
};
3138

32-
export default inject('store')(observer(PRModal));
39+
export default PRModal;

0 commit comments

Comments
 (0)