Explorar o código

got rid of t props

Mao %!s(int64=4) %!d(string=hai) anos
pai
achega
e0145c35b4

+ 2 - 1
packages/app/src/components/SearchForm.jsx

@@ -1,5 +1,6 @@
 import React from 'react';
 import PropTypes from 'prop-types';
+import { withTranslation } from 'react-i18next';
 import { withUnstatedContainers } from './UnstatedUtils';
 import AppContainer from '~/client/services/AppContainer';
 
@@ -174,4 +175,4 @@ SearchForm.defaultProps = {
   onInputChange: () => {},
 };
 
-export default SearchFormWrapper;
+export default withTranslation()(SearchFormWrapper);

+ 0 - 1
packages/app/src/components/SearchPage.jsx

@@ -153,7 +153,6 @@ class SearchPage extends React.Component {
   renderSearchControl = () => {
     return (
       <SearchControl
-        t={this.props.t}
         searchingKeyword={this.state.searchingKeyword}
         appContainer={this.props.appContainer}
         onSearchInvoked={this.onSearchInvoked}

+ 0 - 3
packages/app/src/components/SearchPage/SearchControl.tsx

@@ -7,7 +7,6 @@ import AppContainer from '../../client/services/AppContainer';
 type Props = {
   searchingKeyword: string,
   appContainer: AppContainer,
-  t: (str: string) => string,
   onSearchInvoked: (data : any[]) => boolean,
 }
 
@@ -19,7 +18,6 @@ const SearchControl: FC <Props> = (props: Props) => {
     <div className="">
       <div className="search-page-input sps sps--abv">
         <SearchPageFormTypeAny
-          t={props.t}
           keyword={props.searchingKeyword}
           appContainer={props.appContainer}
           onSearchFormChanged={props.onSearchInvoked}
@@ -31,7 +29,6 @@ const SearchControl: FC <Props> = (props: Props) => {
 };
 
 SearchControl.propTypes = {
-  t: PropTypes.func.isRequired,
   searchingKeyword:  PropTypes.string.isRequired,
   appContainer: PropTypes.instanceOf(AppContainer).isRequired,
   onSearchInvoked: PropTypes.func.isRequired,