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

View file

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

View file

@ -8,7 +8,10 @@
* @return {string} The sanitized string * @return {string} The sanitized string
*/ */
export function sanitizeString(str: string): 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) { export function stringMatchQuery(str: string, query: string) {