Skip to content

Commit

Permalink
small nitpicks from personal review
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitropoulos committed Mar 10, 2020
1 parent 8588b3b commit 2e0ebed
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/components/date_picker/react-datepicker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export interface ReactDatePickerProps {
/**
* Adds additional times to the time selector other then :30 increments
*/
injectTimes?: moment.Moment[]; // added here because the type is missing in @types/[email protected]
injectTimes?: moment.Moment[];
isClearable?: boolean;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,5 @@ export const EuiDatePopoverContent: FunctionComponent<
/>
);
};

EuiDatePopoverContent.displayName = 'EuiDatePopoverContent';
45 changes: 29 additions & 16 deletions src/components/date_picker/super_date_picker/super_date_picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -464,30 +464,43 @@ export class EuiSuperDatePicker extends Component<
};

render() {
const {
commonlyUsedRanges,
customQuickSelectPanels,
dateFormat,
end,
isAutoRefreshOnly,
isDisabled,
isPaused,
onRefreshChange,
recentlyUsedRanges,
refreshInterval,
showUpdateButton,
start,
} = this.props;

const quickSelect = (
<EuiQuickSelectPopover
applyRefreshInterval={
this.props.onRefreshChange ? this.onRefreshChange : undefined
onRefreshChange ? this.onRefreshChange : undefined
}
applyTime={this.applyQuickTime}
commonlyUsedRanges={this.props.commonlyUsedRanges}
customQuickSelectPanels={this.props.customQuickSelectPanels}
dateFormat={this.props.dateFormat}
end={this.props.end}
isAutoRefreshOnly={this.props.isAutoRefreshOnly}
isDisabled={this.props.isDisabled}
isPaused={this.props.isPaused}
recentlyUsedRanges={this.props.recentlyUsedRanges}
refreshInterval={this.props.refreshInterval}
start={this.props.start}
commonlyUsedRanges={commonlyUsedRanges}
customQuickSelectPanels={customQuickSelectPanels}
dateFormat={dateFormat}
end={end}
isAutoRefreshOnly={isAutoRefreshOnly}
isDisabled={isDisabled}
isPaused={isPaused}
recentlyUsedRanges={recentlyUsedRanges}
refreshInterval={refreshInterval}
start={start}
/>
);

const flexWrapperClasses = classNames('euiSuperDatePicker__flexWrapper', {
'euiSuperDatePicker__flexWrapper--noUpdateButton': !this.props
.showUpdateButton,
'euiSuperDatePicker__flexWrapper--isAutoRefreshOnly': this.props
.isAutoRefreshOnly,
'euiSuperDatePicker__flexWrapper--noUpdateButton': !showUpdateButton,
'euiSuperDatePicker__flexWrapper--isAutoRefreshOnly': isAutoRefreshOnly,
});

return (
Expand All @@ -498,7 +511,7 @@ export class EuiSuperDatePicker extends Component<
<EuiFlexItem>
<EuiFormControlLayout
className="euiSuperDatePicker"
isDisabled={this.props.isDisabled}
isDisabled={isDisabled}
prepend={quickSelect}>
{this.renderDatePickerRange()}
</EuiFormControlLayout>
Expand Down

0 comments on commit 2e0ebed

Please sign in to comment.