diff options
| author | adamhrv <adam@ahprojects.com> | 2019-01-21 11:03:39 +0100 |
|---|---|---|
| committer | adamhrv <adam@ahprojects.com> | 2019-01-21 11:03:39 +0100 |
| commit | dc56b3326d7776e626039eb144e29562e9fdf355 (patch) | |
| tree | 2edbddd0885cfdb59e202bde43bc1b7c692ae4ed /client | |
| parent | e06af50389f849be0bfe4fa97d39f4519ef2c711 (diff) | |
| parent | 3ea3d6991f50c9cd94d8a9b4130c3194bd50e160 (diff) | |
Merge branch 'master' of github.com:adamhrv/megapixels_dev
Diffstat (limited to 'client')
| -rw-r--r-- | client/common/loader.component.js | 21 | ||||
| -rw-r--r-- | client/faceSearch/faceSearch.query.js | 17 | ||||
| -rw-r--r-- | client/faceSearch/faceSearch.result.js | 1 | ||||
| -rw-r--r-- | client/index.js | 4 | ||||
| -rw-r--r-- | client/map/index.js | 4 | ||||
| -rw-r--r-- | client/nameSearch/nameSearch.query.js | 2 |
6 files changed, 31 insertions, 18 deletions
diff --git a/client/common/loader.component.js b/client/common/loader.component.js index 5930c63e..df25dd39 100644 --- a/client/common/loader.component.js +++ b/client/common/loader.component.js @@ -1,11 +1,18 @@ import React from 'react' +import Spinner from 'react-spin' export default function Loader() { - return ( - <div className='loaderWrapper'> - <div className='loader'> - <img src="/assets/img/loader.gif" /> - </div> - </div> - ) + const spinCfg = { + width: 5, + radius: 20, + color: 'white', + } + return <Spinner config={spinCfg} /> + // return ( + // <div className='loaderWrapper'> + // <div className='loader'> + // <img src="/assets/img/loader.gif" /> + // </div> + // </div> + // ) } diff --git a/client/faceSearch/faceSearch.query.js b/client/faceSearch/faceSearch.query.js index 2d140813..8a82373e 100644 --- a/client/faceSearch/faceSearch.query.js +++ b/client/faceSearch/faceSearch.query.js @@ -19,6 +19,11 @@ class FaceSearchQuery extends Component { } upload(blob) { + if (this.state.image) { + URL.revokeObjectURL(this.state.image) + } + const url = URL.createObjectURL(blob) + this.setState({ image: url }) this.props.actions.upload(this.props.payload, blob) } @@ -37,17 +42,17 @@ class FaceSearchQuery extends Component { <div className='uploadContainer'> <div style={style}> {image ? null : <img src="/assets/img/icon_camera.svg" />} + {result.loading && ( + <div className='loading' style={style}> + <Loader /> + </div> + )} <UploadImage onUpload={this.upload.bind(this)} /> </div> - {result.loading && ( - <div className='loading' style={style}> - <Loader /> - </div> - )} </div> <div className='cta'> <h2>Search by Image</h2> - <h3>Searching {13456} images</h3> + <h3>Searching {13233} images</h3> <p> {'Use facial recognition to reverse search into the LFW dataset '} {'and see if it contains your photos.'} diff --git a/client/faceSearch/faceSearch.result.js b/client/faceSearch/faceSearch.result.js index c2509033..00dec160 100644 --- a/client/faceSearch/faceSearch.result.js +++ b/client/faceSearch/faceSearch.result.js @@ -49,7 +49,6 @@ class FaceSearchResult extends Component { return ( <div className='result'> <div> - <Loader /><br /> <h2>Searching...</h2> </div> </div> diff --git a/client/index.js b/client/index.js index 96f2c8c8..c9335f14 100644 --- a/client/index.js +++ b/client/index.js @@ -28,7 +28,7 @@ function fetchDataset(payload) { function appendApplets(applets) { applets.forEach(([el, payload]) => { - el.classList.add(payload.cmd) + el.parentNode.classList.add(payload.cmd) switch (payload.cmd) { case 'citations': case 'load_file': @@ -36,7 +36,7 @@ function appendApplets(applets) { appendTable(el, payload) break case 'map': - el.parentNode.classList.add('fullwidth') + el.parentNode.classList.add('wide') appendMap(el, payload) el.classList.add('loaded') break diff --git a/client/map/index.js b/client/map/index.js index 053cf13b..e8543c77 100644 --- a/client/map/index.js +++ b/client/map/index.js @@ -33,6 +33,7 @@ function addMarker(map, latlng, title, subtext) { "<br>", subtext, ].join('')) + return marker } function addArc(map, src, dest) { @@ -74,5 +75,6 @@ export default function append(el, payload) { addArc(map, source, latlng) }) - addMarker(map, source, paper.title, paper.address) + const rootMarker = addMarker(map, source, paper.title, paper.address) + rootMarker.openPopup() } diff --git a/client/nameSearch/nameSearch.query.js b/client/nameSearch/nameSearch.query.js index 99c1da84..c0798c58 100644 --- a/client/nameSearch/nameSearch.query.js +++ b/client/nameSearch/nameSearch.query.js @@ -20,7 +20,7 @@ class NameSearchQuery extends Component { return ( <div className='query'> <h2>Search by Name</h2> - <h3>Searching {13456} identities</h3> + <h3>Searching {13233} identities</h3> <p> {'Enter your name to see if you were included in this dataset..'} </p> |
