🌈 style(eslint): 修复eslint的报错❌
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user