Skip to content

Commit

Permalink
[form-builder] DateInput fix eslint warnings
Browse files Browse the repository at this point in the history
* Remove some unused function arguments
* Change `any` to `unknown`
  • Loading branch information
Benedicte Emilie Brækken authored and benedicteb committed Feb 4, 2021
1 parent 7c0f366 commit 42db1d0
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import 'react-datepicker/dist/react-datepicker-cssmodules.css'

import React from 'react'
import ReactDOM from 'react-dom'
import moment from 'moment'
import DatePicker from 'react-datepicker'
import {isValidationErrorMarker, Marker} from '@sanity/types'
Expand All @@ -11,9 +10,10 @@ import TextInput from 'part:@sanity/components/textinputs/default'
import Button from 'part:@sanity/components/buttons/default'
import CalendarIcon from 'part:@sanity/base/calendar-icon'
import {uniqueId} from 'lodash'
import styles from './styles/BaseDateTimeInput.css'
import {Layer} from '@sanity/ui'

import styles from './styles/BaseDateTimeInput.css'

type Props = {
value: moment.Moment | null
markers: Array<Marker>
Expand All @@ -26,11 +26,11 @@ type Props = {
description: string | null
placeholder: string | null
readOnly: boolean | null
onFocus?: (event: any) => void
onBlur?: (event: any) => void
onChange: (event: moment.Moment) => void
onFocus?: (event: unknown) => void
onBlur?: (event: unknown) => void
level: number
presence: any
presence: unknown
}

const getFormat = (dateFormat, timeFormat) => dateFormat + (timeFormat ? ` ${timeFormat}` : '')
Expand Down Expand Up @@ -62,7 +62,7 @@ export default class BaseDateTimeInput extends React.Component<Props, State> {
onChange(nextMoment)
this.setState({inputValue: null})
}
handleSetNow = (event) => {
handleSetNow = () => {
this.handleDialogChange(moment())
}
focus() {
Expand All @@ -79,7 +79,7 @@ export default class BaseDateTimeInput extends React.Component<Props, State> {
}
return event
}
handleButtonClick = (event) => {
handleButtonClick = () => {
this.focus()
this.handleOpen()
}
Expand Down

2 comments on commit 42db1d0

@vercel
Copy link

@vercel vercel bot commented on 42db1d0 Feb 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

test-studio – ./

test-studio.now.sh
test-studio-git-next.sanity.build
test-studio.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 42db1d0 Feb 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

perf-studio – ./

perf-studio-git-next.sanity.build
perf-studio.sanity.build

Please sign in to comment.