From 13eb43cc448272643dab71d072997b9a8db9c6d2 Mon Sep 17 00:00:00 2001 From: viktorstrate Date: Fri, 26 Feb 2021 19:52:35 +0100 Subject: [PATCH] Fix Places after switching to Esbuild --- ui/build.js | 4 +--- ui/src/Pages/PlacesPage/PlacesPage.js | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/build.js b/ui/build.js index 038a4404..3cbaff66 100644 --- a/ui/build.js +++ b/ui/build.js @@ -11,9 +11,7 @@ const watchMode = process.argv[2] == 'watch' const ENVIRONMENT_VARIABLES = ['NODE_ENV', 'PHOTOVIEW_API_ENDPOINT'] const defineEnv = ENVIRONMENT_VARIABLES.reduce((acc, key) => { - if (process.env[key]) { - acc[`process.env.${key}`] = `"${process.env[key]}"` - } + acc[`process.env.${key}`] = process.env[key] ? `"${process.env[key]}"` : null return acc }, {}) diff --git a/ui/src/Pages/PlacesPage/PlacesPage.js b/ui/src/Pages/PlacesPage/PlacesPage.js index 9db3ee8c..610a64ac 100644 --- a/ui/src/Pages/PlacesPage/PlacesPage.js +++ b/ui/src/Pages/PlacesPage/PlacesPage.js @@ -2,11 +2,13 @@ import React, { useEffect, useRef, useState } from 'react' import { useQuery, gql } from '@apollo/client' import styled from 'styled-components' +// Will be bundled to dist/src/Pages/PlacesPage/PlacesPage.css import 'mapbox-gl/dist/mapbox-gl.css' import Layout from '../../Layout' import { makeUpdateMarkers } from './mapboxHelperFunctions' import MapPresentMarker from './MapPresentMarker' +import { Helmet } from 'react-helmet' const MapWrapper = styled.div` width: 100%; @@ -35,7 +37,7 @@ const MapPage = () => { useEffect(() => { async function loadMapboxLibrary() { - const mapbox = await import('mapbox-gl') + const mapbox = (await import('mapbox-gl')).default setMapboxLibrary(mapbox) } loadMapboxLibrary() @@ -113,6 +115,9 @@ const MapPage = () => { return ( + + +