🌈 style(eslint): 修复eslint的报错❌

This commit is contained in:
xuan
2022-12-05 16:30:09 +08:00
parent d93b66e7d5
commit 639112c038
114 changed files with 2209 additions and 2161 deletions
+5 -4
View File
@@ -18,14 +18,14 @@ interface Param {
round?: boolean
name?: string
}
export default memo(({ value, onClick, showStatus = false, round = false, name = '' }: Param) => {
const LabAndImg = ({ value, onClick, showStatus = false, round = false, name = '' }: Param) => {
const [imgs, setImgs] = useState<string>('')
// lab是否都是0
const rgbStyle = useMemo(() => {
if (value?.lab && (value?.lab.l || value?.lab.a || value?.lab.b)) {
return { backgroundColor: `rgb(${value.rgb?.r} ${value.rgb?.g} ${value.rgb?.b})` }
}
}
else {
return null
}
@@ -64,7 +64,7 @@ export default memo(({ value, onClick, showStatus = false, round = false, name =
src={imgs}
onError={e => checkLoad(e)}
className={styles.labAndImg_image}
style={{ borderRadius: round ? '50%' : '' }}
style={{ borderRadius: round ? '50%' : '' }}
></Image>
)}
{!value.texture_url && rgbStyle && <View className={styles.boxColor} style={{ ...rgbStyle, borderRadius: round ? '50%' : '' }}></View>}
@@ -76,4 +76,5 @@ export default memo(({ value, onClick, showStatus = false, round = false, name =
<LabAndImgShow value={value} show={labAndImgShow} onClose={closeLabAndImgShow} />
</>
)
})
}
export default memo(LabAndImg)