From 7e79fe3dc31ff809614aaa2177ca194456b49aea Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Wed, 1 Aug 2018 23:37:18 +0300 Subject: [PATCH] Revert "Add Intl to off-SPA rendering" --- CHANGELOG.md | 3 --- package.json | 2 +- .../SearchMap/ReusableMapContainer.js | 20 ++----------------- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be532614..807b2191 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,6 @@ way to update this template, but currently, we follow a pattern: * Patch (v0.0.**X**): Bug fixes and small changes to components. --- -## v1.3.1 -* [fix] Add Intl to off-SPA rendering - [#879](https://github.com/sharetribe/flex-template-web/pull/879) ## v1.3.0 * [change] Reusable SearchMap. diff --git a/package.json b/package.json index d6dcbdfd..c17266df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "1.3.1", + "version": "1.3.0", "private": true, "license": "Apache-2.0", "dependencies": { diff --git a/src/components/SearchMap/ReusableMapContainer.js b/src/components/SearchMap/ReusableMapContainer.js index 9b5b6663..d9a4872c 100644 --- a/src/components/SearchMap/ReusableMapContainer.js +++ b/src/components/SearchMap/ReusableMapContainer.js @@ -1,19 +1,8 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { node, string } from 'prop-types'; -import { IntlProvider } from 'react-intl'; -import mapValues from 'lodash/mapValues'; -import config from '../../config'; -import messages from '../../translations/en.json'; - import css from './SearchMap.css'; -// Locale should not affect the tests. We ensure this by providing -// messages with the key as the value of each message. -const testMessages = mapValues(messages, (val, key) => key); -const isTestEnv = process.env.NODE_ENV === 'test'; -const localeMessages = isTestEnv ? testMessages : messages; - class ReusableMapContainer extends React.Component { constructor(props) { super(props); @@ -53,7 +42,6 @@ class ReusableMapContainer extends React.Component { renderSearchMap() { const targetDomNode = document.getElementById(this.el.id); - let renderContent = this.props.children; // Check if we have already added map somewhere on the DOM if (!targetDomNode) { @@ -63,11 +51,6 @@ class ReusableMapContainer extends React.Component { } else if (!this.mountNode) { // if no mountNode is found, append this outside SPA rendering tree (to document body) document.body.appendChild(this.el); - renderContent = ( - - {this.props.children} - - ); } } else { this.el.classList.remove(css.reusableMapHidden); @@ -79,7 +62,8 @@ class ReusableMapContainer extends React.Component { this.mountNode.appendChild(this.el); } } - ReactDOM.render(renderContent, this.el); + + ReactDOM.render(this.props.children, this.el); } render() {