🌈 style(eslint): add eslint rules
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { View, Text } from '@tarojs/components'
|
||||
import { FC, ReactNode } from 'react'
|
||||
import { Text, View } from '@tarojs/components'
|
||||
import type { FC, ReactNode } from 'react'
|
||||
import classnames from 'classnames'
|
||||
import styles from './index.module.scss'
|
||||
|
||||
@@ -32,11 +32,11 @@ const NormalButton: FC<PropsType> = (props) => {
|
||||
circle = false,
|
||||
customStyles = {},
|
||||
customClassName = '',
|
||||
customTextClassName = ''
|
||||
customTextClassName = '',
|
||||
} = props
|
||||
const getClassName = () => {
|
||||
const classObject = {
|
||||
[styles[`button--disabled`]]: disabled,
|
||||
[styles['button--disabled']]: disabled,
|
||||
[styles[`button--${size}`]]: size,
|
||||
[styles[`button--${type}`]]: type,
|
||||
[styles['button--round']]: round,
|
||||
@@ -53,9 +53,8 @@ const NormalButton: FC<PropsType> = (props) => {
|
||||
onClick && onClick(event)
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<View className={classnames(styles['button'], getClassName(), customClassName)} style={customStyles} onClick={handleClick}>
|
||||
<View className={classnames(styles.button, getClassName(), customClassName)} style={customStyles} onClick={handleClick}>
|
||||
<View className={classnames(styles['button--text'], customTextClassName)}>{children}</View>
|
||||
</View>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user