|
1 | | -import React from 'react'; |
2 | | -import { inject, hooksObserver } from 'app/componentConnectors'; |
| 1 | +import React, { FunctionComponent } from 'react'; |
| 2 | +import { useOvermind } from 'app/overmind'; |
3 | 3 |
|
4 | 4 | import getNetlifyConfig from 'app/utils/getNetlifyConfig'; |
5 | 5 |
|
@@ -29,43 +29,43 @@ const getFunctionDir = sandbox => { |
29 | 29 | } |
30 | 30 | }; |
31 | 31 |
|
32 | | -export const SiteInfo = inject('store')( |
33 | | - hooksObserver( |
34 | | - ({ |
35 | | - store: { |
36 | | - deployment: { building, netlifyLogs, netlifySite }, |
37 | | - editor: { currentSandbox }, |
| 32 | +export const SiteInfo: FunctionComponent = () => { |
| 33 | + const { |
| 34 | + state: { |
| 35 | + deployment: { |
| 36 | + building, |
| 37 | + netlifyLogs, |
| 38 | + netlifySite: { id, name }, |
38 | 39 | }, |
39 | | - }) => { |
40 | | - const functionDirectory = getFunctionDir(currentSandbox); |
41 | | - const functions = functionDirectory |
42 | | - ? currentSandbox.modules.filter( |
43 | | - ({ directoryShortid }) => |
44 | | - directoryShortid === functionDirectory.shortid |
45 | | - ) |
46 | | - : []; |
| 40 | + editor: { currentSandbox }, |
| 41 | + }, |
| 42 | + } = useOvermind(); |
| 43 | + const functionDirectory = getFunctionDir(currentSandbox); |
| 44 | + const functions = functionDirectory |
| 45 | + ? currentSandbox.modules.filter( |
| 46 | + ({ directoryShortid }) => directoryShortid === functionDirectory.shortid |
| 47 | + ) |
| 48 | + : []; |
47 | 49 |
|
48 | | - return ( |
49 | | - <SiteInfoWrapper> |
50 | | - <WorkspaceSubtitle>Sandbox Site</WorkspaceSubtitle> |
| 50 | + return ( |
| 51 | + <SiteInfoWrapper> |
| 52 | + <WorkspaceSubtitle>Sandbox Site</WorkspaceSubtitle> |
51 | 53 |
|
52 | | - <WorkspaceInputContainer> |
53 | | - <Deploys> |
54 | | - <Deploy key={netlifySite.uid}> |
55 | | - <Name light>{netlifySite.name}</Name> |
| 54 | + <WorkspaceInputContainer> |
| 55 | + <Deploys> |
| 56 | + <Deploy key={id}> |
| 57 | + <Name light>{name}</Name> |
56 | 58 |
|
57 | | - {!building && <div>Building</div>} |
| 59 | + {!building && <div>Building</div>} |
58 | 60 |
|
59 | | - {functions.length ? <Functions functions={functions} /> : null} |
| 61 | + {functions.length ? <Functions functions={functions} /> : null} |
60 | 62 |
|
61 | | - <Actions /> |
| 63 | + <Actions /> |
62 | 64 |
|
63 | | - {netlifyLogs ? <ViewLogsButton /> : null} |
64 | | - </Deploy> |
65 | | - </Deploys> |
66 | | - </WorkspaceInputContainer> |
67 | | - </SiteInfoWrapper> |
68 | | - ); |
69 | | - } |
70 | | - ) |
71 | | -); |
| 65 | + {netlifyLogs ? <ViewLogsButton /> : null} |
| 66 | + </Deploy> |
| 67 | + </Deploys> |
| 68 | + </WorkspaceInputContainer> |
| 69 | + </SiteInfoWrapper> |
| 70 | + ); |
| 71 | +}; |
0 commit comments