Skip to content

Commit 697bbcb

Browse files
authored
Merge pull request #128 from openeew/warning
Add warning, modify mock data
2 parents 6514710 + dc64bb9 commit 697bbcb

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

web/client/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/client/src/content/Events/index.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from 'react'
1+
import React, { useState, useEffect, useContext } from 'react'
22
import EventsMap from '../../components/EventsMap'
33
import { Dropdown } from 'carbon-components-react'
44
import EarthquakeList from '../../components/EarthquakeList'
@@ -7,6 +7,7 @@ import { CheckmarkFilled16 } from '@carbon/icons-react'
77
import Field from '../../components/Field'
88
import { earthquakes, takeEventsMapSnapshot } from '../../context/app'
99
import { formatCoordinates, formatDate, formatTime } from '../../utils'
10+
import AppContext from '../../context/app'
1011

1112
const dayInSeconds = 86400
1213

@@ -38,6 +39,16 @@ const Events = () => {
3839
const [selectedTimeFilter, setSelectedTimeFilter] = useState(
3940
items[defaultTimeFilterIndex]
4041
)
42+
const { addToast } = useContext(AppContext)
43+
44+
useEffect(() => {
45+
addToast({
46+
kind: 'warning',
47+
caption:
48+
'The dashboard is a work in progress. In the near future, this page will show events detected by OpenEEW regional networks. Currently, this page uses mock data to demonstrate its features.',
49+
title: 'Note: This data is not real, but will be soon!',
50+
})
51+
}, [])
4152

4253
return (
4354
<div className="events-page">
@@ -72,10 +83,6 @@ const Events = () => {
7283
<h4>{earthquakes.length}</h4>
7384
<span>Earthquakes detected</span>
7485
</div>
75-
<div>
76-
<h4>2,400</h4>
77-
<span>Subscribers alerted</span>
78-
</div>
7986
</div>
8087
<div className="events-page-earthquake-list__container">
8188
<EarthquakeList

web/client/src/context/app.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,39 @@ export const earthquakes = [
88
{
99
pos: [-104.3533, 20.65],
1010
magnitude: 1,
11-
locationText: '3km South of Blah Blah town',
11+
locationText: 'Sample Event Lorem ipsum',
1212
country: 'Mexico',
1313
date: new Date().getTime(),
1414
alertDelay: 1,
1515
},
1616
{
1717
pos: [-99.3533, 20.65],
1818
magnitude: 2,
19-
locationText: '15km South of Yadayada town',
19+
locationText: 'Sample Event Lorem dolor',
2020
country: 'Mexico',
2121
date: new Date().getTime() - 86400 * 7 * 1000,
2222
alertDelay: 5,
2323
},
2424
{
2525
pos: [-102.3533, 25.65],
2626
magnitude: 3,
27-
locationText: '3km South of Lorem Ipsum',
27+
locationText: 'Sample Event Lorem',
2828
country: 'Mexico',
2929
date: new Date().getTime() - 86400 * 30 * 1000,
3030
alertDelay: 3,
3131
},
3232
{
3333
pos: [-96.01, 16.01],
3434
magnitude: 4,
35-
locationText: '3km East of Mexico City',
35+
locationText: 'Sample Lorem ipsum dolor',
3636
country: 'Mexico',
3737
date: new Date().getTime() - 86400 * 90 * 1000,
3838
alertDelay: 4,
3939
},
4040
{
4141
pos: [-108.01, 28.01],
4242
magnitude: 5,
43-
locationText: '3km East of Some Random Town',
43+
locationText: 'Lorem ipsum dolor',
4444
country: 'Mexico',
4545
date: new Date().getTime() - 86400 * 365 * 1000,
4646
alertDelay: 5,

0 commit comments

Comments
 (0)