Skip to content

Commit 1d84d33

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch LikeButton to use useOvermind (codesandbox#2538)
1 parent 2a34e1b commit 1d84d33

File tree

1 file changed

+14
-6
lines changed
  • packages/app/src/app/pages/Sandbox/Editor/Header/Buttons/LikeButton

1 file changed

+14
-6
lines changed
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
import React from 'react';
2-
import { inject, hooksObserver } from 'app/componentConnectors';
1+
import React, { FunctionComponent } from 'react';
2+
3+
import { useOvermind } from 'app/overmind';
4+
35
import { LikeHeart } from './elements';
46

5-
export const LikeButton = inject('store')(
6-
hooksObserver(({ store: { editor: { currentSandbox } } }) => (
7+
export const LikeButton: FunctionComponent = () => {
8+
const {
9+
state: {
10+
editor: { currentSandbox },
11+
},
12+
} = useOvermind();
13+
14+
return (
715
<LikeHeart
816
colorless
917
text={currentSandbox.likeCount}
1018
sandbox={currentSandbox}
1119
disableTooltip
1220
highlightHover
1321
/>
14-
))
15-
);
22+
);
23+
};

0 commit comments

Comments
 (0)