Improved search and fixed navigation warning on club about screen

This commit is contained in:
Arnaud Vergnet 2020-04-05 10:29:50 +02:00
parent 8723765e43
commit 106227fbbb
3 changed files with 7 additions and 5 deletions

View file

@ -29,7 +29,6 @@ class ClubListScreen extends React.Component<Props, State> {
colors: Object;
getRenderItem: Function;
categories: Array<Object>;
constructor(props) {
@ -70,7 +69,7 @@ class ClubListScreen extends React.Component<Props, State> {
* @return {*}
*/
getHeaderButtons = () => {
const onPress = this.props.navigation.navigate.bind(this, "ClubAboutScreen");
const onPress = () => this.props.navigation.navigate( "ClubAboutScreen");
return <HeaderButton icon={'information'} onPress={onPress}/>;
};

View file

@ -32,8 +32,8 @@ const emailRegex = /^.+@.+\..+$/;
class LoginScreen extends React.Component<Props, State> {
state = {
email: 'vergnet@etud.insa-toulouse.fr',
password: '3D514ùdsqg',
email: '',
password: '',
isEmailValidated: false,
isPasswordValidated: false,
loading: false,

View file

@ -8,7 +8,10 @@
* @return {string} The sanitized string
*/
export function sanitizeString(str: string): string {
return str.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "");
return str.toLowerCase()
.normalize("NFD")
.replace(/[\u0300-\u036f]/g, "")
.replace(" ", "");
}
export function stringMatchQuery(str: string, query: string) {