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
thalia
ThaliApp
Commits
80dcd3f8
Commit
80dcd3f8
authored
May 26, 2017
by
Sébastiaan Versteeg
Browse files
Add location image and fix problem when max participants is null
parent
18d5e970
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/components/Event.js
View file @
80dcd3f8
import
React
from
'
react
'
;
import
{
ScrollView
,
Text
,
View
}
from
'
react-native
'
;
import
{
Image
,
ScrollView
,
Text
,
View
}
from
'
react-native
'
;
import
{
connect
}
from
'
react-redux
'
;
import
Moment
from
'
moment
'
;
import
'
moment/locale/nl
'
;
...
...
@@ -32,7 +32,11 @@ const Event = (props) => {
text
+=
`Aanmelddeadline:
${
registrationDeadline
}
\n`
;
text
+=
`Afmelddeadline:
${
cancelDeadline
}
\n`
;
text
+=
`Aantal aanmeldingen:
${
data
.
num_participants
}
aanmeldingen (
${
data
.
max_participants
}
max)\n`
;
text
+=
`Aantal aanmeldingen:
${
data
.
num_participants
}
aanmeldingen`
;
if
(
data
.
max_participants
)
{
text
+=
` (
${
data
.
max_participants
}
max)`
;
}
text
+=
'
\n
'
;
if
(
data
.
user_registration
)
{
let
registrationState
;
...
...
@@ -123,6 +127,7 @@ const Event = (props) => {
return
(
<
ScrollView
contentContainerStyle
=
{
styles
.
eventView
}
>
<
Image
style
=
{
styles
.
locationImage
}
source
=
{{
uri
:
`https://maps.googleapis.com/maps/api/staticmap?center=
${
props
.
data
.
map_location
}
&zoom=13&size=450x250&markers=
${
props
.
data
.
map_location
}
`
}}
/
>
<
Text
style
=
{
styles
.
titleText
}
>
{
props
.
data
.
title
}
<
/Text
>
<
Text
style
=
{
styles
.
infoText
}
>
{
eventDesc
(
props
.
data
)}
...
...
@@ -149,6 +154,7 @@ Event.propTypes = {
end
:
React
.
PropTypes
.
string
.
isRequired
,
organiser
:
React
.
PropTypes
.
number
.
isRequired
,
location
:
React
.
PropTypes
.
string
.
isRequired
,
map_location
:
React
.
PropTypes
.
string
.
isRequired
,
status
:
React
.
PropTypes
.
number
.
isRequired
,
registration_allowed
:
React
.
PropTypes
.
bool
.
isRequired
,
has_fields
:
React
.
PropTypes
.
bool
.
isRequired
,
...
...
app/components/style/event.js
View file @
80dcd3f8
...
...
@@ -4,6 +4,13 @@ const styles = create({
eventView
:
{
padding
:
16
,
},
locationImage
:
{
height
:
150
,
marginLeft
:
-
16
,
marginRight
:
-
16
,
marginTop
:
-
16
,
marginBottom
:
16
,
},
titleText
:
{
marginBottom
:
16
,
fontFamily
:
'
sans-serif-medium
'
,
...
...
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