Skip to content

Commit

Permalink
Remove FunctionalComponent usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Mar 3, 2020
1 parent c536559 commit fad74dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import React, { FunctionComponent, useEffect, useState } from 'react';
import React, { useEffect, useState } from 'react';
import {
EuiButtonEmpty,
EuiOverlayMask,
Expand Down Expand Up @@ -53,14 +53,14 @@ export interface SavedQueryMeta {
shouldIncludeTimefilter: boolean;
}

export const SaveQueryForm: FunctionComponent<Props> = ({
export function SaveQueryForm({
savedQuery,
savedQueryService,
onSave,
onClose,
showFilterOption = true,
showTimeFilterOption = true,
}) => {
}: Props) {
const [title, setTitle] = useState(savedQuery ? savedQuery.title : '');
const [description, setDescription] = useState(savedQuery ? savedQuery.description : '');
const [savedQueries, setSavedQueries] = useState<SavedQuery[]>([]);
Expand Down Expand Up @@ -254,4 +254,4 @@ export const SaveQueryForm: FunctionComponent<Props> = ({
</EuiModal>
</EuiOverlayMask>
);
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
} from '@elastic/eui';

import { i18n } from '@kbn/i18n';
import React, { FunctionComponent, useEffect, useState, Fragment, useRef } from 'react';
import React, { useEffect, useState, Fragment, useRef } from 'react';
import { sortBy } from 'lodash';
import { SavedQuery, SavedQueryService } from '../..';
import { SavedQueryListItem } from './saved_query_list_item';
Expand All @@ -49,15 +49,15 @@ interface Props {
onClearSavedQuery: () => void;
}

export const SavedQueryManagementComponent: FunctionComponent<Props> = ({
export function SavedQueryManagementComponent({
showSaveQuery,
loadedSavedQuery,
onSave,
onSaveAsNew,
onLoad,
onClearSavedQuery,
savedQueryService,
}) => {
}: Props) {
const [isOpen, setIsOpen] = useState(false);
const [savedQueries, setSavedQueries] = useState([] as SavedQuery[]);
const [count, setTotalCount] = useState(0);
Expand Down Expand Up @@ -315,4 +315,4 @@ export const SavedQueryManagementComponent: FunctionComponent<Props> = ({
</EuiPopover>
</Fragment>
);
};
}

0 comments on commit fad74dc

Please sign in to comment.