Skip to content

Commit

Permalink
fix: flow errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alaa-yahia committed Jul 11, 2024
1 parent d0a6173 commit 6b331e2
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import * as React from 'react';
import { CalendarInput } from '@dhis2/ui';

type Props = {
label: string,
label?: string,
value: ?string,
width: number,
calendar: string,
calendar?: string,
calendarWidth?: ?number,
calendarHeight?: ?number,
inputWidth?: ?number,
onBlur: (value: string) => void,
onFocus?: ?() => void,
onDateSelectedFromCalendar?: () => void,
classes: Object,
textFieldRef?: (instance: D2TextField) => void,
classes?: Object,
disabled?: boolean,
};

export class D2Date extends React.Component<Props, State> {
export class D2Date extends React.Component<Props> {
handleDateSelected: (value: {calendarDateString: string}) => void;

constructor(props: Props) {
Expand All @@ -42,7 +42,6 @@ export class D2Date extends React.Component<Props, State> {
onBlur,
onFocus,
onDateSelectedFromCalendar,
textFieldRef,
...passOnProps
} = this.props;

Expand All @@ -52,13 +51,13 @@ export class D2Date extends React.Component<Props, State> {

return (
<div
ref={(containerInstance) => { this.containerInstance = containerInstance; }}
style={{
width,
}}
>
<CalendarInput
label=""
{...passOnProps}
onDateSelect={this.handleDateSelected}
calendar={calendarType}
date={this.props.value}
Expand All @@ -67,7 +66,6 @@ export class D2Date extends React.Component<Props, State> {
onFocus={this.props.onFocus}
editable
disabled={this.props.disabled}
{...passOnProps}
/>
</div>
);
Expand Down

0 comments on commit 6b331e2

Please sign in to comment.