diff --git a/src/client/actions/index.js b/src/client/actions/index.js index 0b2179fd28f65862d082351ef112d689719f5081..000988200893648d8e1258e161db58026da3621a 100644 --- a/src/client/actions/index.js +++ b/src/client/actions/index.js @@ -226,7 +226,3 @@ export const animateMap = value => ({ type: ANIMATE_MAP, value }) -// export const updateURL = ({ resultClass = 'manuscripts', newURL }) => ({ -// type: UPDATE_URL, -// resultClass, newURL -// }); diff --git a/src/client/components/facet_results/LeafletMap.css b/src/client/components/facet_results/LeafletMap.css new file mode 100644 index 0000000000000000000000000000000000000000..4f6c577bd3439545873f75107b9c6d8585862994 --- /dev/null +++ b/src/client/components/facet_results/LeafletMap.css @@ -0,0 +1,16 @@ +.leaflet-popup-content { + font-size: 14px; + font-family: 'Roboto', sans-serif; +} + +.marker-cluster-grey { + background-color: rgba(128, 128, 128, 0.6); +} + +.marker-cluster-small div { + background-color: rgba(211, 211, 211, 0.6); +} + +.leaflet-popup-scrolled { + border: 0px; +} \ No newline at end of file diff --git a/src/client/components/facet_results/LeafletMap.js b/src/client/components/facet_results/LeafletMap.js index bf06b1506d55bd91559e0ba290e5c18c5957be9a..be3ccac5f1d9e2e6f565fce3ee17cb32dfa3a4bc 100644 --- a/src/client/components/facet_results/LeafletMap.js +++ b/src/client/components/facet_results/LeafletMap.js @@ -5,8 +5,9 @@ import L from 'leaflet' import { has, orderBy } from 'lodash' import CircularProgress from '@material-ui/core/CircularProgress' import { purple } from '@material-ui/core/colors' -import 'leaflet/dist/leaflet.css' import { MAPBOX_ACCESS_TOKEN } from '../../configs/config' +import 'leaflet/dist/leaflet.css' +import './LeafletMap.css' // Leaflet plugins import 'leaflet-fullscreen/dist/fullscreen.png' @@ -30,11 +31,6 @@ import markerIconGreen from '../../img/markers/marker-icon-green.png' import markerIconRed from '../../img/markers/marker-icon-red.png' import markerIconOrange from '../../img/markers/marker-icon-orange.png' -const style = { - width: '100%', - height: '100%' -} - const styles = theme => ({ leafletContainerfacetResults: { height: 400, @@ -50,6 +46,10 @@ const styles = theme => ({ }, position: 'relative' }, + mapElement: { + width: '100%', + height: '100%' + }, spinnerContainer: { height: 40, width: 40, @@ -439,7 +439,7 @@ class LeafletMap extends React.Component { return ( <> <div className={this.props.classes[`leafletContainer${this.props.pageType}`]}> - <div id='map' style={style} /> + <div id='map' className={this.props.classes.mapElement} /> {this.props.fetching && <div className={this.props.classes.spinnerContainer}> <CircularProgress style={{ color: purple[500] }} thickness={5} /> diff --git a/src/client/configs/config.js b/src/client/configs/config.js index 082e2b9b93d40aa5175cb11be906c9a844f784b2..e2c45cf30011dc8fc041003bd9f55ac325ebd25f 100644 --- a/src/client/configs/config.js +++ b/src/client/configs/config.js @@ -1,5 +1,7 @@ export const rootUrl = '' +export const defaultLocale = 'en' + export const publishedPort = 3006 export const MAPBOX_ACCESS_TOKEN = 'pk.eyJ1IjoiZWtrb25lbiIsImEiOiJjam5vampzZ28xd2dyM3BzNXR0Zzg4azl4In0.eozyF-bBaZbA3ibhvJlJpQ' diff --git a/src/client/index.css b/src/client/index.css new file mode 100644 index 0000000000000000000000000000000000000000..7b5e36f3a26e2ca08f2d3df86f5e80b8b649c5b0 --- /dev/null +++ b/src/client/index.css @@ -0,0 +1,47 @@ +html { + height: 100%; +} + +body { + height: 100%; + margin: 0; + min-width: 300px; +} + +fieldset, .opacity-slider { + outline: 0 !important; +} + +#root, #app { + height: 100%; + background-color: #bdbdbd; +} + +a, a:visited, a:hover, a:active { + color: inherit; +} + +.rstcustom__rowWrapper { + display: flex; + align-items: center; +} + +.rstcustom__rowSearchMatch { + /*box-shadow: 0 2px 0 #673ab7 ;*/ + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; +} + +.ReactVirtualized__Grid { + outline: none; +} + +.apexcharts-legend { + box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12); + transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; +} + +.apexcharts-legend-marker { + top: 3px !important; +} \ No newline at end of file diff --git a/src/client/index.html b/src/client/index.html index 2c5885349e42aac72657c90ff32243d660c1fb3e..45b631b409df4c55960b6f9450482b246412109f 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -1,70 +1,17 @@ <!DOCTYPE html> <html lang="en"> - <head> - <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="description" content="The Mapping Manuscript Migrations project links datasets from Europe and U.S. to provide a global view of the history of medieval and Renaissance manuscripts." /> - <meta name="robots" content="noindex"> - <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"> - <style> - html { - height: 100%; - } - body { - height: 100%; - margin: 0; - min-width: 300px; - } - fieldset, .opacity-slider { - outline: 0 !important; - } - #root, #app { - height: 100%; - background-color: #bdbdbd; - } - a, a:visited, a:hover, a:active { - color: inherit; - } - .leaflet-popup-content { - font-size: 14px; - font-family: 'Roboto', sans-serif; - } - .marker-cluster-grey { - background-color: rgba(128,128,128, 0.6); - } - .marker-cluster-small div { - background-color: rgba(211,211,211, 0.6); - } - .rstcustom__rowWrapper { - display: flex; - align-items: center; - } - .rstcustom__rowSearchMatch { - /*box-shadow: 0 2px 0 #673ab7 ;*/ - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; - } - .leaflet-popup-scrolled { - border: 0px; - } - .ReactVirtualized__Grid { - outline: none; - } - .apexcharts-legend { - box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.2), - 0px 1px 1px 0px rgba(0,0,0,0.14), - 0px 1px 3px 0px rgba(0,0,0,0.12); - transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; - } - .apexcharts-legend-marker { - top: 3px !important; - } - </style> - <title><%= htmlWebpackPlugin.options.title %></title> - </head> - <body> - <div id="root"></div> - </body> -</html> +<head> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta name="description" content="" /> + <meta name="robots" content="noindex"> + <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"> + <title>Sampo Semantic Portal</title> +</head> + +<body> + <div id="root"></div> +</body> + +</html> \ No newline at end of file diff --git a/src/client/index.js b/src/client/index.js index d5f9cfbbae06ef2cfe6f632de6c5398dd7d9a122..4c3bc4fc676c832c64daa1edca1bb86f43da618c 100644 --- a/src/client/index.js +++ b/src/client/index.js @@ -10,8 +10,9 @@ import reducer from './reducers' import rootEpic from './epics' import App from './components/App' import { loadLocales } from './actions' -// import { updateURL } from './actions'; +import { defaultLocale } from './configs/config' +import './index.css' import 'react-sortable-tree/style.css' import 'react-redux-toastr/lib/css/react-redux-toastr.min.css' import 'mapbox-gl/dist/mapbox-gl.css' @@ -34,17 +35,7 @@ epicMiddleware.run(rootEpic) bindActionCreators(toastrActions, store.dispatch) // init locale -// const lang = localStorage.getItem('locale') || 'en'; -const lang = 'en' -store.dispatch(loadLocales(lang)) - -// // update url on app load -// store.dispatch(updateURL({ newURL: window.location.pathname + window.location.search })); -// -// // update url on back/forward -// window.onpopstate = () => { -// store.dispatch(updateURL({ newURL: window.location.pathname + window.location.search })); -// }; +store.dispatch(loadLocales(defaultLocale)) render( <Provider store={store}> diff --git a/webpack.client.common.js b/webpack.client.common.js index 1f08cf47b95d712e115506886ef855916233a3b5..4d21ac140b4570b02a83880900212d720b0c933b 100644 --- a/webpack.client.common.js +++ b/webpack.client.common.js @@ -12,7 +12,6 @@ module.exports = { plugins: [ new CleanWebpackPlugin(['dist']), new HtmlWebpackPlugin({ - title: 'Sampo Semantic Portal', // Load a custom template template: 'src/client/index.html' }), diff --git a/webpack.client.dev.js b/webpack.client.dev.js index cf6749e1ce4e2805d0c20652be5307fc98614f54..5e02e68e2e14ee51ded054c93b615a2857195f06 100644 --- a/webpack.client.dev.js +++ b/webpack.client.dev.js @@ -1,5 +1,5 @@ -const merge = require('webpack-merge'); -const common = require('./webpack.client.common.js'); +const merge = require('webpack-merge') +const common = require('./webpack.client.common.js') module.exports = merge(common, { mode: 'development', @@ -9,6 +9,6 @@ module.exports = merge(common, { port: 8080, open: true, historyApiFallback: true, - publicPath: '/', + publicPath: '/' } -}); +}) diff --git a/webpack.client.prod.js b/webpack.client.prod.js index fb120b10377c9695638650cacb462c638bbbba99..0d0bb1e845ea4aca2418036e9e26d5c69c19b6e3 100644 --- a/webpack.client.prod.js +++ b/webpack.client.prod.js @@ -1,6 +1,6 @@ -const webpack = require('webpack'); -const merge = require('webpack-merge'); -const common = require('./webpack.client.common.js'); +const webpack = require('webpack') +const merge = require('webpack-merge') +const common = require('./webpack.client.common.js') module.exports = merge(common, { mode: 'production', @@ -10,4 +10,4 @@ module.exports = merge(common, { 'process.env.NODE_ENV': JSON.stringify('production') }) ] -}); +})