Skip to content

Commit

Permalink
style: prettier format
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh committed Mar 15, 2021
1 parent 86dad77 commit db00d94
Show file tree
Hide file tree
Showing 18 changed files with 342 additions and 356 deletions.
16 changes: 9 additions & 7 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
body, html, .app {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
color: #444;
body,
html,
.app {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
color: #444;
}
50 changes: 25 additions & 25 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useCallback } from 'react';
import {ErrorBoundary} from 'react-error-boundary';
import { ErrorBoundary } from 'react-error-boundary';
import { Collapse, Button, Card } from 'reactstrap';
import Graphic from '@arcgis/core/Graphic';
import QueryTask from '@arcgis/core/tasks/QueryTask';
Expand All @@ -24,7 +24,7 @@ const ErrorFallback = ({ error }) => {
return (
<div role="alert">
<p>Something went wrong:</p>
<pre style={{color: 'red'}}>{error.message}</pre>
<pre style={{ color: 'red' }}>{error.message}</pre>
</div>
);
};
Expand All @@ -33,8 +33,8 @@ export default function App() {
const [zoomToGraphic, setZoomToGraphic] = useState({
zoomToGraphic: {
graphic: {},
level: 0
}
level: 0,
},
});
const [showIdentify, setShowIdentify] = useState(false);
const [mapClick, setMapClick] = useState(null);
Expand All @@ -54,7 +54,7 @@ export default function App() {
// check for point feature
setZoomToGraphic({
graphic: graphics,
preserve: false
preserve: false,
});
};

Expand All @@ -68,30 +68,30 @@ export default function App() {
size: '18px',
outline: {
color: config.MARKER_OUTLINE_COLOR,
width: 1
}
width: 1,
},
},
events: {
success: (graphic) => {
console.log('findAddress::success');
setZoomToGraphic({
graphic: graphic,
level: 18
level: 18,
});
},
error: console.error
}
error: console.error,
},
};

const gnisSherlock = {
provider: new WebApiProvider(apiKey, 'SGID10.LOCATION.PlaceNamesGNIS2019', 'NAME', {
contextField: 'COUNTY'
contextField: 'COUNTY',
}),
label: 'Find Point of Interest',
placeHolder: 'place name ...',
maxResultsToDisplay: 10,
onSherlockMatch: onSherlockMatch,
modules: { Graphic, QueryTask }
modules: { Graphic, QueryTask },
};

const citySherlock = {
Expand All @@ -100,7 +100,7 @@ export default function App() {
placeHolder: 'city name ...',
maxResultsToDisplay: 10,
onSherlockMatch: onSherlockMatch,
modules: { Graphic, QueryTask }
modules: { Graphic, QueryTask },
};

const onClick = useCallback((event) => {
Expand All @@ -112,27 +112,29 @@ export default function App() {
const mapOptions = {
zoomToGraphic: zoomToGraphic,
onClick: onClick,
setView: setMapView
setView: setMapView,
};

const sidebarOptions = {
sideBarOpen: sideBarOpen,
toggleSidebar: () => setSideBarOpen(!sideBarOpen)
toggleSidebar: () => setSideBarOpen(!sideBarOpen),
};

return (
<div className="app">
<Header title="Atlas Utah" version={version} />
{showIdentify ?
{showIdentify ? (
<ErrorBoundary FallbackComponent={ErrorFallback}>
<IdentifyContainer show={setShowIdentify}>
<IdentifyInformation apiKey={apiKey} location={mapClick} />
</IdentifyContainer>
</ErrorBoundary>
: null}
) : null}
<ErrorBoundary FallbackComponent={ErrorFallback}>
<Sidebar>
<small>Data and services provided by <a href="https://gis.utah.gov/">Utah AGRC</a></small>
<small>
Data and services provided by <a href="https://gis.utah.gov/">Utah AGRC</a>
</small>
<p>Click a location on the map for more information</p>
<h4>Find Address</h4>
<div id="geocodeNode">
Expand All @@ -146,13 +148,11 @@ export default function App() {
<ErrorBoundary FallbackComponent={ErrorFallback}>
<Sherlock {...citySherlock}></Sherlock>
</ErrorBoundary>
<Card style={{ marginTop: "1em" }}>
<Button block onClick={() => setShowPrint(!showPrint)}>Export Map</Button>
<Collapse isOpen={showPrint}>
{showPrint ?
<Printer view={mapView}></Printer>
: null}
</Collapse>
<Card style={{ marginTop: '1em' }}>
<Button block onClick={() => setShowPrint(!showPrint)}>
Export Map
</Button>
<Collapse isOpen={showPrint}>{showPrint ? <Printer view={mapView}></Printer> : null}</Collapse>
</Card>
</Sidebar>
</ErrorBoundary>
Expand Down
4 changes: 2 additions & 2 deletions src/__mocks__/@agrc/sherlock/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export class Sherlock { }
export class WebApiProvider { }
export class Sherlock {}
export class WebApiProvider {}
2 changes: 1 addition & 1 deletion src/__mocks__/@arcgis/core/Basemap.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default class Basemap { }
export default class Basemap {}
2 changes: 1 addition & 1 deletion src/__mocks__/@arcgis/core/layers/support/LOD.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default class LOD { }
export default class LOD {}
2 changes: 1 addition & 1 deletion src/__mocks__/@arcgis/core/layers/support/TileInfo.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default class TileInfo { }
export default class TileInfo {}
2 changes: 1 addition & 1 deletion src/__mocks__/@arcgis/core/widgets/Print.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default class Print{}
export default class Print {}
4 changes: 3 additions & 1 deletion src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export default function Header({ title, version }) {
<div className="app__header">
<h1 className="header__heading">
<span>{title}</span>
<a className="heading__version" href="/changelog.html" target="_blank" rel="noopener">{version}</a>
<a className="heading__version" href="/changelog.html" target="_blank" rel="noopener">
{version}
</a>
</h1>
{window.innerWidth >= config.MIN_DESKTOP_WIDTH && <img src={logo} className="heading__img" alt="agrc logo" />}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Identify/Identify.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.identify__container {
z-index: 3;
background-color: #f9f9f9;
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3)
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.identify__close {
Expand All @@ -28,5 +28,5 @@
}

.identify--muted {
color: #666
color: #666;
}
Loading

0 comments on commit db00d94

Please sign in to comment.