style: fix warning from eslint

This commit is contained in:
unix
2020-03-19 02:05:17 +08:00
parent 1b2365b89f
commit 596f134c25
22 changed files with 39 additions and 32 deletions

View File

@@ -4,7 +4,7 @@ import withDefaults from '../utils/with-defaults'
interface Props {
x?: number
y?: number
color?: string,
color?: string
onCompleted?: Function
}

View File

@@ -168,8 +168,8 @@ export const getButtonHoverColors = (
}
export interface ButtonCursorGroup {
cursor: string,
events: string,
cursor: string
events: string
}
export const getButtonCursor = (disabled: boolean, loading: boolean): ButtonCursorGroup => {

View File

@@ -63,7 +63,7 @@ const Fieldset: React.FC<React.PropsWithChildren<FieldsetProps>> = React.memo(({
{!hasTitle && <FieldsetTitle>{title}</FieldsetTitle>}
{!hasSubtitle && <FieldsetSubtitle>{subtitle}</FieldsetSubtitle>}
</div>
{FooterChildren && <>{FooterChildren}</>}
{FooterChildren && {FooterChildren}}
<style jsx>{`
.fieldset {
background-color: ${theme.palette.background};

View File

@@ -3,7 +3,7 @@ import withDefaults from '../utils/with-defaults'
import useTheme from '../styles/use-theme'
interface Props {
opacity: number,
opacity: number
}
const defaultProps = {

View File

@@ -4,7 +4,7 @@ import useTheme from '../styles/use-theme'
import ImageSkeleton from './image.skeleton'
interface Props {
src: string,
src: string
animation: boolean
width?: number
height?: number

View File

@@ -68,7 +68,7 @@ const Input: React.FC<InputProps> = ({
return (
<div className={`input-container ${className}`}>
{label && <InputLabel fontSize={fontSize}>{label}</InputLabel>}
<div className={`input-wrapper ${hover ? 'hover' : ''} ${disabled ? 'disabled' : ''} ${labelClasses}`}>
<div className={`input-wrapper ${hover ? 'hover' : ''} ${disabled ? 'disabled' : ''} ${labelClasses}`}>
{icon && <InputIcon icon={icon} ratio={heightRatio} />}
<input type="text" className={`${disabled ? 'disabled' : ''} ${iconClasses}`}
value={selfValue}

View File

@@ -46,8 +46,8 @@ const Container: React.FC<React.PropsWithChildren<RowProps>> = React.memo(({
const Component = component
const theme = useTheme()
const { justifyValue, alignValue } = useMemo(
() => getFlexAlignment(justify, align),
[justify, align],
() => getFlexAlignment(justify, align),
[justify, align],
)
return (

View File

@@ -10,7 +10,7 @@ const CSSBaseline: React.FC<React.PropsWithChildren<{}>> = React.memo(({
return (
<>
<React.Fragment>{children}</React.Fragment>
{children}
<style global jsx>{`
html, body {
background-color: ${theme.palette.background};

View File

@@ -7,6 +7,7 @@ import {
} from './index'
export const palette: ZeitUIThemesPalette = {
/* eslint-disable @typescript-eslint/camelcase */
accents_1: '#111',
accents_2: '#333',
accents_3: '#444',
@@ -15,6 +16,7 @@ export const palette: ZeitUIThemesPalette = {
accents_6: '#999',
accents_7: '#eaeaea',
accents_8: '#fafafa',
/* eslint-enable camelcase */
background: '#000',
foreground: '#fff',
selection: '#f81ce5',

View File

@@ -7,6 +7,7 @@ import {
} from './index'
export const palette: ZeitUIThemesPalette = {
/* eslint-disable @typescript-eslint/camelcase */
accents_1: '#fafafa',
accents_2: '#eaeaea',
accents_3: '#999',
@@ -15,6 +16,7 @@ export const palette: ZeitUIThemesPalette = {
accents_6: '#444',
accents_7: '#333',
accents_8: '#111',
/* eslint-enable camelcase */
background: '#fff',
foreground: '#000',
selection: '#79ffe1',

View File

@@ -1,6 +1,7 @@
import { ThemeTypes } from '../../utils/prop-types'
export interface ZeitUIThemesPalette {
/* eslint-disable @typescript-eslint/camelcase */
accents_1: string
accents_2: string
accents_3: string
@@ -9,6 +10,7 @@ export interface ZeitUIThemesPalette {
accents_6: string
accents_7: string
accents_8: string
/* eslint-enable camelcase */
background: string
foreground: string
selection: string

View File

@@ -27,7 +27,7 @@ const ToastContainer: React.FC<React.PropsWithChildren<{}>> = () => {
key={`toast-${t.id}-${i}`}
/>
)),
[toasts, hover],
[toasts, hover],
)
const hoverHandler = (onHover: boolean) => {
if (onHover) {

View File

@@ -3,7 +3,7 @@ import React, { ReactNode } from 'react'
export const hasChild = (
children: ReactNode | undefined,
child: React.ElementType
): Boolean => {
): boolean => {
const types = React.Children.map(children, item => {
if (!React.isValidElement(item)) return null
return item.type