Skip to content

Commit 186e9b6

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch ConnectionNotice to use useOvermind (codesandbox#2545)
1 parent 843aff9 commit 186e9b6

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed
Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
import { inject, hooksObserver } from 'app/componentConnectors';
2-
import React from 'react';
1+
import React, { FunctionComponent } from 'react';
2+
3+
import { useOvermind } from 'app/overmind';
34

45
import { Container } from './elements';
56

6-
export const ConnectionNotice = inject('store')(
7-
hooksObserver(
8-
({ store: { connected } }) =>
9-
!connected && (
10-
<Container>
11-
You{"'"}re not connected to the internet. You can still edit, but you
12-
cannot save. We recommend using the {"'"}Download{"'"} function to
13-
keep your changes.
14-
</Container>
15-
)
16-
)
17-
);
7+
export const ConnectionNotice: FunctionComponent = () => {
8+
const {
9+
state: { connected },
10+
} = useOvermind();
11+
12+
return (
13+
!connected && (
14+
<Container>
15+
You{"'"}re not connected to the internet. You can still edit, but you
16+
cannot save. We recommend using the {"'"}Download{"'"} function to keep
17+
your changes.
18+
</Container>
19+
)
20+
);
21+
};

0 commit comments

Comments
 (0)