diff --git a/.meteor/packages b/.meteor/packages index 0046334..b701cf3 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -43,3 +43,4 @@ vjrj:piwik # Stats mdg:geolocation natestrauser:publish-performant-counts maximum:server-transform +mys:fonts diff --git a/.meteor/versions b/.meteor/versions index a2fb248..597b622 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -75,6 +75,7 @@ modules-runtime@0.8.0 mongo@1.2.2 mongo-dev-server@1.0.1 mongo-id@1.0.6 +mys:fonts@0.0.2 natestrauser:publish-performant-counts@0.1.2 npm-bcrypt@0.9.3 npm-mongo@2.2.30 diff --git a/client/main.html b/client/main.html index cb98f6e..99e51f8 100644 --- a/client/main.html +++ b/client/main.html @@ -7,8 +7,8 @@ https://fezvrasta.github.io/bootstrap-material-design/docs/4.0/getting-started/introduction/ --> - - + @@ -17,7 +17,7 @@ - + diff --git a/designs/icons-tcef.svg b/designs/icons-tcef.svg index f490152..1695da9 100644 --- a/designs/icons-tcef.svg +++ b/designs/icons-tcef.svg @@ -264,6 +264,7 @@ image/svg+xml + @@ -336,7 +337,7 @@ @@ -447,5 +448,38 @@ inkscape:connector-curvature="0" /> + + + + + + + diff --git a/fonts.json b/fonts.json new file mode 100644 index 0000000..ba2e995 --- /dev/null +++ b/fonts.json @@ -0,0 +1,10 @@ +{ + "extensions": [ "ttf", "woff", "woff2" ], + "map": { + "node_modules/simple-line-icons/fonts/Simple-Line-Icons.woff": "fonts/Simple-Line-Icons.woff", + "node_modules/simple-line-icons/fonts/Simple-Line-Icons.woff": "fonts/Simple-Line-Icons.woff?v=2.4.0", + "node_modules/simple-line-icons/fonts/Simple-Line-Icons.woff2": "fonts/Simple-Line-Icons.woff2?v=2.4.0", + "node_modules/simple-line-icons/fonts/Simple-Line-Icons.ttf": "fonts/Simple-Line-Icons.ttf?v=2.4.0" + }, + "verbose": false +} diff --git a/imports/startup/client/Gkeys.js b/imports/startup/client/Gkeys.js new file mode 100644 index 0000000..12a48a5 --- /dev/null +++ b/imports/startup/client/Gkeys.js @@ -0,0 +1,47 @@ +import React from 'react'; +import { Meteor } from 'meteor/meteor'; +import i18n from 'i18next'; + +const gmapkey = new ReactiveVar(); + +Meteor.startup(function() { + Meteor.call('getMapKey', function (error, key) { + if (typeof key !== 'undefined') { + // console.log(key); + gmapkey.set(key); + } else { + callback(error, null) + } + }) +}); + +class GkeysC { + constructor() { + this.state = { init: false }; + } + + load(callback) { + if (this.state.init) { + // already loaded + callback(null, gmapkey.get()); + } else { + this.state.init = true; + Meteor.autorun(function() { + var key = gmapkey.get(); + if (typeof key !== 'undefined') { + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.onload = function () { + // console.log(key); + callback(null, key); + }.bind(this); + // https://stackoverflow.com/questions/28130114/google-maps-places-autocomplete-language-output + script.src = `https://maps.googleapis.com/maps/api/js?key=${key}&libraries=places&language=${i18n.language}` + document.body.appendChild(script); + } + }.bind(this)); + } + } +} + +export let Gkeys = new GkeysC(); diff --git a/imports/startup/client/gkeys.js b/imports/startup/client/gkeys.js deleted file mode 100644 index ca38c40..0000000 --- a/imports/startup/client/gkeys.js +++ /dev/null @@ -1,34 +0,0 @@ -import { Meteor } from 'meteor/meteor'; -import i18n from 'i18next'; - -const gmapkey = new ReactiveVar(); - -Meteor.startup(function() { - Meteor.call('getMapKey', function (error, key) { - if (typeof key !== 'undefined') { - // console.log(key); - gmapkey.set(key); - } else { - callback(error, null) - } - }) -}); - -var getGKeys = function (callback) { - Meteor.autorun(function() { - var key = gmapkey.get(); - if (typeof key !== 'undefined') { - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.onload = function () { - // console.log(key); - callback(null, key); - }; - // https://stackoverflow.com/questions/28130114/google-maps-places-autocomplete-language-output - script.src = `https://maps.googleapis.com/maps/api/js?key=${key}&libraries=places&language=${i18n.language}` - document.body.appendChild(script); - } - }); -} - -export default getGKeys; diff --git a/imports/ui/components/AuthenticatedNavigation/AuthenticatedNavigation.js b/imports/ui/components/AuthenticatedNavigation/AuthenticatedNavigation.js index 55f073d..b7a4c2e 100644 --- a/imports/ui/components/AuthenticatedNavigation/AuthenticatedNavigation.js +++ b/imports/ui/components/AuthenticatedNavigation/AuthenticatedNavigation.js @@ -16,17 +16,19 @@ import NavItem from '../NavItem/NavItem'; import { Meteor } from 'meteor/meteor'; const AuthenticatedNavigation = ({ name, history, props }) => ( - */} + ); AuthenticatedNavigation.propTypes = { diff --git a/imports/ui/components/CenterInMyPosition/CenterInMyPosition.js b/imports/ui/components/CenterInMyPosition/CenterInMyPosition.js index 6d2725b..85f94ed 100644 --- a/imports/ui/components/CenterInMyPosition/CenterInMyPosition.js +++ b/imports/ui/components/CenterInMyPosition/CenterInMyPosition.js @@ -9,7 +9,6 @@ class CenterInMyPosition extends React.Component { } onClick = (event) => { - console.log("Click?"); // this.props.onClick(event); // https://atmospherejs.com/mdg/geolocation // only with SSL: @@ -27,6 +26,7 @@ class CenterInMyPosition extends React.Component { zoom: 11 } self.props.onClick(viewport); + // console.log(viewport); // self.onViewportChanged(viewport); computation.stop(); } @@ -36,7 +36,7 @@ class CenterInMyPosition extends React.Component { render() { return ( ) } diff --git a/imports/ui/components/Navigation/Navigation.js b/imports/ui/components/Navigation/Navigation.js index 4d3451d..0c80775 100644 --- a/imports/ui/components/Navigation/Navigation.js +++ b/imports/ui/components/Navigation/Navigation.js @@ -9,23 +9,29 @@ import { translate } from 'react-i18next'; import './Navigation.scss'; const Navigation = props => ( - + ); Navigation.defaultProps = { diff --git a/imports/ui/components/Navigation/Navigation.scss b/imports/ui/components/Navigation/Navigation.scss index 7783f13..2dbdfbf 100644 --- a/imports/ui/components/Navigation/Navigation.scss +++ b/imports/ui/components/Navigation/Navigation.scss @@ -26,3 +26,15 @@ a.nav-link:hover { .navbar { padding: 0.3rem 0rem; } + + +a.navbar-brand { + font-size: 26px; +} + +@media (max-width: 480px) { + a.navbar-brand { + font-size: 16px; + padding: 15px 3px; + } +} diff --git a/imports/ui/components/PublicNavigation/PublicNavigation.js b/imports/ui/components/PublicNavigation/PublicNavigation.js index c212c04..d60bfde 100644 --- a/imports/ui/components/PublicNavigation/PublicNavigation.js +++ b/imports/ui/components/PublicNavigation/PublicNavigation.js @@ -12,7 +12,11 @@ import { translate } from 'react-i18next'; import NavItem from '../NavItem/NavItem'; const PublicNavigation = (props) => ( - */} + ); export default translate([], { wait: true })(PublicNavigation); diff --git a/imports/ui/layouts/App/App.js b/imports/ui/layouts/App/App.js index 7382994..1d45c54 100644 --- a/imports/ui/layouts/App/App.js +++ b/imports/ui/layouts/App/App.js @@ -43,6 +43,7 @@ import { check } from 'meteor/check'; import FiresMap from '../../pages/FiresMap/FiresMap'; import Sandbox from '../../pages/Sandbox/Sandbox'; +import 'simple-line-icons/css/simple-line-icons.css'; import './App.scss'; const history = createHistory() diff --git a/imports/ui/pages/FireSubscription/FireSubscription.js b/imports/ui/pages/FireSubscription/FireSubscription.js index de37730..6657f49 100644 --- a/imports/ui/pages/FireSubscription/FireSubscription.js +++ b/imports/ui/pages/FireSubscription/FireSubscription.js @@ -6,8 +6,9 @@ import DistanceSlider from '/imports/ui/components/DistanceSlider/DistanceSlider import SelectionMap from '/imports/ui/components/SelectionMap/SelectionMap'; import update from 'immutability-helper'; import { withTracker } from 'meteor/react-meteor-data'; -import getGKeys from '/imports/startup/client/gkeys'; +import { Gkeys } from '/imports/startup/client/Gkeys'; import SubsAutocomplete from './SubsAutocomplete'; +import CenterInMyPosition from '/imports/ui/components/CenterInMyPosition/CenterInMyPosition.js'; class FireSubscription extends React.Component { constructor(props) { @@ -18,11 +19,15 @@ class FireSubscription extends React.Component { } componentDidMount = () => { - getGKeys(function(err, key) { + Gkeys.load(function(err, key) { this.setState({init: true}); }.bind(this)); } + centerOnUserLocation = (value) => { + this.setState(update(this.state, {$merge: {lat: value.center[0], lng: value.center[1]}})); + } + onAutocompleteChange = (value) => { this.setState(update(this.state, {$merge: {lat: value.lat, lng: value.lng}})); } @@ -49,6 +54,9 @@ class FireSubscription extends React.Component { this.onSliderChange(value)} /> + + this.centerOnUserLocation(viewport)} /> + diff --git a/imports/ui/pages/FireSubscription/SubsAutocomplete.js b/imports/ui/pages/FireSubscription/SubsAutocomplete.js index 8548f03..9547abb 100644 --- a/imports/ui/pages/FireSubscription/SubsAutocomplete.js +++ b/imports/ui/pages/FireSubscription/SubsAutocomplete.js @@ -46,9 +46,10 @@ class SubsAutocomplete extends React.Component { }, } + // http://simplelineicons.com/ const AutocompleteItem = ({ formattedSuggestion }) => (
- {' '} + {' '} {formattedSuggestion.mainText}{' '} {formattedSuggestion.secondaryText}
) diff --git a/imports/ui/pages/FiresMap/FiresMap.js b/imports/ui/pages/FiresMap/FiresMap.js index ec4a35a..0b3b82f 100644 --- a/imports/ui/pages/FiresMap/FiresMap.js +++ b/imports/ui/pages/FiresMap/FiresMap.js @@ -140,28 +140,8 @@ class FiresMap extends React.Component { this.unionGroup = new L.LayerGroup(); } - centerOnUserLocation = () => { - // https://atmospherejs.com/mdg/geolocation - // only with SSL: - // https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition - - // https://stackoverflow.com/questions/31608579/somethings-wrong-with-my-meteor-geolocation-functions - var userGeoLocation = new ReactiveVar(null); - var state = this.state; - var self = this; - Tracker.autorun(function (computation) { - userGeoLocation.set(Geolocation.latLng()); - if (userGeoLocation.get()) { - //stop the tracker if we got something - var viewport = { - center: [userGeoLocation.get().lat, userGeoLocation.get().lng], - zoom: 11 - } - self.onViewportChanged(viewport); - // console.log(userGeoLocation.get()); - computation.stop(); - } - }); + centerOnUserLocation = (viewport) => { + this.onViewportChanged(viewport); } componentDidMount() { @@ -274,7 +254,7 @@ class FiresMap extends React.Component { this.useMarkers(e.target.checked)}> Resaltar los fuegos con un marcador - this.centerOnUserLocation(event)} /> + this.centerOnUserLocation(viewport)} />
@@ -304,7 +284,7 @@ class FiresMap extends React.Component { - (*) Para preservar la privacidad de nuestros usuarios/as, los datos reflejados están aleatoriamente alterados y son solo orientativos. +

(*)Para preservar la privacidad de nuestros usuarios/as, los datos reflejados están aleatoriamente alterados y son solo orientativos.

); diff --git a/imports/ui/pages/Sandbox/Sandbox.js b/imports/ui/pages/Sandbox/Sandbox.js index 5886061..314c869 100644 --- a/imports/ui/pages/Sandbox/Sandbox.js +++ b/imports/ui/pages/Sandbox/Sandbox.js @@ -3,7 +3,7 @@ import { Trans, translate } from 'react-i18next'; import DistanceSlider from '/imports/ui/components/DistanceSlider/DistanceSlider'; import SelectionMap from '/imports/ui/components/SelectionMap/SelectionMap'; import update from 'immutability-helper'; -import getGKeys from '/imports/startup/client/gkeys'; +import { Gkeys } from '/imports/startup/client/Gkeys'; import FireSubscription from '/imports/ui/pages/FireSubscription/FireSubscription'; class Sandbox extends React.Component { @@ -16,6 +16,9 @@ class Sandbox extends React.Component { componentDidMount = () => { this.setState({init: true}); + Gkeys.load(function(err, key) { + console.log(key); + }.bind(this)); } render() { diff --git a/package.json b/package.json index bccb967..2e0f7a5 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "react-router-dom": "^4.2.2", "reactstrap": "^5.0.0-alpha.3", "simpl-schema": "^0.3.2", + "simple-line-icons": "^2.4.1", "turf-union": "^3.0.12" }, "devDependencies": { diff --git a/public/favicon.ico b/public/favicon.ico index 77a5179..58ed60f 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 0000000..fa68806 Binary files /dev/null and b/public/favicon.png differ