Skip to content

Commit 7838122

Browse files
author
Saagar Takhi
committed
Refactors VisitSiteButton.tsx to replace Cerebral with Overmind
1 parent 8a2bad7 commit 7838122

File tree

1 file changed

+16
-7
lines changed
  • packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Deployment/Netlify/SiteInfo/Actions/VisitSiteButton

1 file changed

+16
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
1-
import { inject, hooksObserver } from 'app/componentConnectors';
2-
import React from 'react';
1+
import { useOvermind } from 'app/overmind';
2+
import React, { FunctionComponent } from 'react';
33
import LinkIcon from 'react-icons/lib/fa/external-link';
44
import Cogs from 'react-icons/lib/fa/cogs';
55

66
import { Link } from '../../../../elements';
77

8-
export const VisitSiteButton = inject('store')(
9-
hooksObserver(({ store: { deployment: { building, netlifySite } } }) => (
10-
<Link disabled={building} href={netlifySite.url}>
8+
export const VisitSiteButton: FunctionComponent = () => {
9+
const {
10+
state: {
11+
deployment: {
12+
building,
13+
netlifySite: { url },
14+
},
15+
},
16+
} = useOvermind();
17+
18+
return (
19+
<Link disabled={building} href={url}>
1120
{building ? (
1221
<>
1322
<Cogs /> Building...
@@ -18,5 +27,5 @@ export const VisitSiteButton = inject('store')(
1827
</>
1928
)}
2029
</Link>
21-
))
22-
);
30+
);
31+
};

0 commit comments

Comments
 (0)