Skip to content

Commit

Permalink
Move constants outside render
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed May 4, 2022
1 parent 0a72bc1 commit e86baaf
Showing 1 changed file with 14 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ interface State {
isCustomEditorOpen: boolean;
}

const panelTitleAdd = i18n.translate('unifiedSearch.filter.filterEditor.addFilterPopupTitle', {
defaultMessage: 'Add filter',
});
const panelTitleEdit = i18n.translate('unifiedSearch.filter.filterEditor.editFilterPopupTitle', {
defaultMessage: 'Edit filter',
});

const addButtonLabel = i18n.translate('unifiedSearch.filter.filterEditor.addButtonLabel', {
defaultMessage: 'Add filter',
});
const updateButtonLabel = i18n.translate('unifiedSearch.filter.filterEditor.updateButtonLabel', {
defaultMessage: 'Update filter',
});

class FilterEditorUI extends Component<Props, State> {
constructor(props: Props) {
super(props);
Expand All @@ -86,26 +100,6 @@ class FilterEditorUI extends Component<Props, State> {
}

public render() {
const panelTitleAdd = i18n.translate('unifiedSearch.filter.filterEditor.addFilterPopupTitle', {
defaultMessage: 'Add filter',
});
const panelTitleEdit = i18n.translate(
'unifiedSearch.filter.filterEditor.editFilterPopupTitle',
{
defaultMessage: 'Edit filter',
}
);

const addButtonLabel = i18n.translate('unifiedSearch.filter.filterEditor.addButtonLabel', {
defaultMessage: 'Add filter',
});
const updateButtonLabel = i18n.translate(
'unifiedSearch.filter.filterEditor.updateButtonLabel',
{
defaultMessage: 'Update filter',
}
);

return (
<div>
<EuiPopoverTitle paddingSize="s">
Expand Down

0 comments on commit e86baaf

Please sign in to comment.