File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import React, {
8
8
} from 'react'
9
9
10
10
import mojs from 'mo-js'
11
- import wordConverter from 'number-to-words'
12
11
import { generateRandomNumber } from '../utils/generateRandomNumber'
13
12
import styles from './index.css'
14
13
@@ -161,15 +160,13 @@ const MediumClap = ({ children }) => {
161
160
isClicked : true
162
161
} )
163
162
}
164
-
163
+
165
164
const memoizedValue = useMemo (
166
165
( ) => ( {
167
- count,
168
- countTotal,
169
- isClicked,
166
+ ...clapState ,
170
167
setRef
171
168
} ) ,
172
- [ count , countTotal , isClicked , setRef ]
169
+ [ clapState , setRef ]
173
170
)
174
171
175
172
return (
@@ -224,19 +221,9 @@ const CountTotal = () => {
224
221
)
225
222
}
226
223
227
- const ClapInfo = ( ) => {
228
- const { countTotal } = useContext ( MediumClapContext )
229
- return (
230
- < div className = { styles . info } >
231
- { wordConverter . toWords ( countTotal ) } claps!
232
- </ div >
233
- )
234
- }
235
-
236
224
MediumClap . Icon = ClapIcon
237
225
MediumClap . Count = ClapCount
238
226
MediumClap . Total = CountTotal
239
- MediumClap . Info = ClapInfo
240
227
241
228
/** ====================================
242
229
* 🔰USAGE
@@ -250,7 +237,6 @@ const Usage = () => {
250
237
< MediumClap . Icon />
251
238
< MediumClap . Total />
252
239
< MediumClap . Count />
253
- < MediumClap . Info />
254
240
</ MediumClap >
255
241
)
256
242
}
You can’t perform that action at this time.
0 commit comments