Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-web
Commits
59fc3cd6
Commit
59fc3cd6
authored
Nov 30, 2022
by
Gabriel Rochon
Browse files
Fix bug where add contact form would reload page
GitLab:
#196
Change-Id: I9629febd64317ac3fb48341ff40e285b4047d455
parent
4b90415c
Changes
3
Hide whitespace changes
Inline
Side-by-side
client/src/components/NewContactForm.tsx
View file @
59fc3cd6
...
...
@@ -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
>
);
}
client/src/locale/en/translation.json
View file @
59fc3cd6
...
...
@@ -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}}"
,
...
...
client/src/locale/fr/translation.json
View file @
59fc3cd6
...
...
@@ -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}}"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment