Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ehasa-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WIMMA Lab 2019
Overflow
ehasa-frontend
Merge requests
!41
Notifications + small updates
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Notifications + small updates
notification-view
into
development
Overview
0
Commits
17
Pipelines
0
Changes
2
Merged
H9031
requested to merge
notification-view
into
development
5 years ago
Overview
0
Commits
17
Pipelines
0
Changes
2
Expand
Notifikaatit
Socket päivitys
Kartan piirtotyökalut rooleittain
Liittyminen ja lähteminen päivittää roolinäkymän
Salasanat piilossa
0
0
Merge request reports
Viewing commit
b2dc9886
Prev
Next
Show latest version
2 files
+
89
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
b2dc9886
game info view added. game edit button now needs game state 'CREATED'
· b2dc9886
Joni Laukka
authored
5 years ago
src/components/GameInfoView.js
0 → 100644
+
70
−
0
Options
import
React
from
"
react
"
;
import
{
Map
,
TileLayer
}
from
"
react-leaflet
"
;
export
default
class
GameInfoView
extends
React
.
Component
{
componentDidMount
()
{
document
.
addEventListener
(
"
keyup
"
,
this
.
handleEsc
);
}
componentWillUnmount
()
{
document
.
removeEventListener
(
"
keyup
"
,
this
.
handleEsc
);
}
handleEsc
=
e
=>
{
if
(
e
.
keyCode
===
27
)
{
this
.
props
.
toggleView
();
}
};
render
()
{
if
(
this
.
props
.
gameInfo
===
undefined
)
{
return
false
;
}
return
(
<
div
className
=
"
fade-main
"
>
<
div
className
=
"
sticky
"
>
<
span
id
=
"
closeEditGameFormX
"
className
=
"
close
"
onClick
=
{
this
.
props
.
toggleView
}
>
×
<
/span
>
<
/div
>
<
div
className
=
""
>
<
h1
>
Game
Info
<
/h1
>
<
p
>
Game
name
:
{
this
.
props
.
gameInfo
.
name
}
<
/p
>
<
p
>
Description
:
{
this
.
props
.
gameInfo
.
desc
}
<
/p
>
<
p
>
Start
date
:
{
this
.
props
.
gameInfo
.
startdate
}
<
/p
>
<
p
>
End
date
:
{
this
.
props
.
gameInfo
.
enddate
}
<
/p
>
<
h2
>
Factions
<
/h2
>
<
div
>
{
this
.
props
.
gameInfo
.
factions
.
map
(
faction
=>
(
<
p
key
=
{
faction
.
factionId
}
style
=
{{
color
:
faction
.
colour
}}
>
{
faction
.
factionName
}
<
/p
>
))}
<
/div
>
<
div
>
<
Map
id
=
"
gameInfoCenterMap
"
className
=
""
center
=
{[
this
.
props
.
gameInfo
.
center
.
lat
,
this
.
props
.
gameInfo
.
center
.
lng
]}
zoom
=
"
13
"
maxZoom
=
"
13
"
style
=
{{
height
:
"
400px
"
,
width
:
"
400px
"
}}
>
<
TileLayer
attribution
=
"
Maanmittauslaitoksen kartta
"
url
=
"
https://tiles.kartat.kapsi.fi/taustakartta/{z}/{x}/{y}.jpg
"
/>
<
/Map
>
<
/div
>
<
/div
>
<
/div
>
);
}
}
Loading