Commit 59fc3cd6 authored by Gabriel Rochon's avatar Gabriel Rochon
Browse files

Fix bug where add contact form would reload page

GitLab: #196

Change-Id: I9629febd64317ac3fb48341ff40e285b4047d455
parent 4b90415c
......@@ -18,12 +18,14 @@
import { SearchRounded } from '@mui/icons-material';
import { InputAdornment, InputBase } from '@mui/material';
import { ChangeEvent, useContext, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { MessengerContext } from '../contexts/MessengerProvider';
export default function NewContactForm() {
const { setSearchQuery } = useContext(MessengerContext);
const [value, setValue] = useState('');
const { t } = useTranslation();
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
setValue(event.target.value);
......@@ -31,11 +33,11 @@ export default function NewContactForm() {
};
return (
<form className="main-search" noValidate autoComplete="off">
<div className="main-search">
<InputBase
className="main-search-input"
type="search"
placeholder="Ajouter un contact"
placeholder={t('conversation_add_contact_form')}
value={value}
onChange={handleChange}
startAdornment={
......@@ -44,6 +46,6 @@ export default function NewContactForm() {
</InputAdornment>
}
/>
</form>
</div>
);
}
......@@ -66,6 +66,7 @@
"message_swarm_created": "Swarm created",
"message_user_joined": "{{user}} joined",
"messages_scroll_to_end": "Scroll to end of conversation",
"conversation_add_contact_form": "Add a contact",
"message_input_placeholder_one": "Write to {{member0}}",
"message_input_placeholder_two": "Write to {{member0}} and {{member1}}",
"message_input_placeholder_three": "Write to {{member0}}, {{member1}} and {{member2}}",
......
......@@ -66,6 +66,7 @@
"message_swarm_created": "Le Swarm a été créé",
"message_user_joined": "{{user}} s'est joint",
"messages_scroll_to_end": "Faire défiler jusqu'à la fin de la conversation",
"conversation_add_contact_form": "Ajouter un contact",
"message_input_placeholder_one": "Écrire à {{member0}}",
"message_input_placeholder_two": "Écrire à {{member0}} et {{member1}}",
"message_input_placeholder_three": "Écrire à {{member0}}, {{member1}} et {{member2}}",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment