From a51d9dc84008b71203a073ac174cbd1575e7f0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taneli=20Riihim=C3=A4ki?= <m3034@student.jamk.fi> Date: Tue, 11 Jun 2019 09:05:07 +0300 Subject: [PATCH] Refactoring a bit, remove things that arent used, add autofocus on forms, add powerpoint to the popup --- src/components/DrawTools.js | 2 +- src/components/LoginForm.js | 3 ++- src/components/RegisterForm.js | 1 + src/components/UserMap.js | 8 +++----- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/DrawTools.js b/src/components/DrawTools.js index 791233b..0cc196b 100644 --- a/src/components/DrawTools.js +++ b/src/components/DrawTools.js @@ -6,7 +6,7 @@ import { class DrawTools extends Component { _onCreated = (e) => { - let type = e.layerType; // from the example; isn't used right now, but may be relevant in the future + //let type = e.layerType; // from the example; isn't used right now, but may be relevant in the future let layer = e.layer; let geoJSON = layer.toGeoJSON(); console.log(JSON.stringify(geoJSON, null, 4)); // makes the output readable in the console diff --git a/src/components/LoginForm.js b/src/components/LoginForm.js index 7893bb8..89b15f3 100644 --- a/src/components/LoginForm.js +++ b/src/components/LoginForm.js @@ -86,13 +86,14 @@ export class LoginForm extends React.Component { </div> <div className='login'> <form onSubmit={this.handleLogin}> - <h1>demo login</h1> + <h1>login</h1> <br /> <input placeholder='Enter Username' name='username' value={this.state.username} onChange={this.handleChange} + autoFocus required /> <br /> diff --git a/src/components/RegisterForm.js b/src/components/RegisterForm.js index f0ead02..56360b6 100644 --- a/src/components/RegisterForm.js +++ b/src/components/RegisterForm.js @@ -100,6 +100,7 @@ export class RegisterForm extends React.Component { name='username' value={this.state.username} onChange={this.handleChange} + autoFocus required /> <br /> diff --git a/src/components/UserMap.js b/src/components/UserMap.js index 1ec4c48..1f0868e 100644 --- a/src/components/UserMap.js +++ b/src/components/UserMap.js @@ -2,11 +2,10 @@ import React, {Component} from 'react'; import { Map, TileLayer, - ZoomControl, Marker, Popup } from 'react-leaflet' -import DrawTools from './DrawTools.js' +import DrawTools from './DrawTools' class UserMap extends Component { constructor(props){ @@ -84,11 +83,10 @@ class UserMap extends Component { attribution='© <a href="https://www.maanmittauslaitos.fi/">Maanmittauslaitos</a>' url={this.props.mapUrl} /> - <ZoomControl position='topright' /> <DrawTools position={this.props.position} /> <Marker position={this.props.position}> - <Popup> - Se on perjantai, my dudes <br /> + <Popup maxWidth="600px"> + <iframe title="Esitys" src="https://jamkstudent-my.sharepoint.com/personal/l4074_student_jamk_fi/_layouts/15/Doc.aspx?sourcedoc={175bb4df-310a-4e1e-b805-e02e8dd4d6c5}&action=embedview&wdAr=1.7777777777777777" width="600px" height="400px" autoplay frameborder="0">Welcome to Wimma LAB<a href="https://office.com">Microsoft Office</a> presentation, powered by <a href="https://office.com/webapps">Office Online</a>.</iframe> </Popup> </Marker> {this.state.ownLat !== null && <Marker position={[this.state.ownLat, this.state.ownLng]}> -- GitLab