Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IT2810-H19
Teams
Team 10
Prosjekt 4
Commits
189ff1c4
Commit
189ff1c4
authored
Nov 08, 2019
by
Solveig Hergot Langås
Browse files
Merge branch 'FixSearch' into 'master'
#14
Keyboard dismissed after search pressed See merge request
!9
parents
acfee6e7
c93e64ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/components/SearchBox.js
View file @
189ff1c4
import
React
,
{
Component
}
from
'
react
'
;
import
{
StyleSheet
,
Text
,
View
,
TextInput
,
Alert
}
from
'
react-native
'
;
import
{
Text
,
View
,
TextInput
,
Keyboard
,
TouchableWithoutFeedback
}
from
'
react-native
'
;
import
{
Icon
}
from
'
react-native-elements
'
;
import
{
connect
}
from
'
react-redux
'
import
{
changeSearchword
}
from
'
../actions/SearchAction
'
...
...
@@ -14,6 +14,7 @@ class SearchBox extends Component {
}
search
=
()
=>
{
Keyboard
.
dismiss
()
if
(
this
.
state
.
searchWord
.
length
===
0
){
//search blank, show all places
word
=
"
all
"
}
else
{
...
...
@@ -48,7 +49,7 @@ class SearchBox extends Component {
return
(
<
View
style
=
{{
flexDirection
:
"
row
"
,
margin
:
20
}}
>
<
TextInput
style
=
{
inputfield
}
autoCorrect
=
{
false
}
onKeyPress
=
{(
e
)
=>
this
.
handleSearchWord
(
e
)}
onSubmitEditing
=
{()
=>
this
.
search
()}
/
>
<
Icon
name
=
"
search
"
onPress
=
{()
=>
this
.
search
()}
/
>
<
TouchableWithoutFeedback
>
<
Icon
name
=
"
search
"
onPress
=
{()
=>
this
.
search
()}
/>
</
TouchableWithoutFeedback
>
<
Text
>
{
this
.
props
.
word
}
<
/Text
>
<
/View
>
);
...
...
frontend/pages/HomePage.js
View file @
189ff1c4
...
...
@@ -25,7 +25,7 @@ class HomePage extends Component{
<
Text
style
=
{{
fontSize
:
28
,
textAlign
:
"
center
"
,
padding
:
8
}}
>
Welcome
to
Dream
Destinations
<
/Text
>
<
Text
style
=
{{
fontSize
:
20
,
textAlign
:
"
center
"
,
padding
:
8
}}
>
Click
here
to
see
a
wordcloud
showing
the
most
popular
locations
<
/Text
>
<
Text
style
=
{{
fontSize
:
16
,
textAlign
:
"
center
"
,
padding
:
8
}}
>
Below
you
see
the
five
most
popular
places
<
/Text
>
<
Card
/>
<
Card
/>
<
/View
>
/*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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