diff --git a/imports/ui/components/Feedback/Feedback.js b/imports/ui/components/Feedback/Feedback.js
index af2f845..43277e1 100644
--- a/imports/ui/components/Feedback/Feedback.js
+++ b/imports/ui/components/Feedback/Feedback.js
@@ -8,6 +8,7 @@ import { Meteor } from 'meteor/meteor';
import { translate } from 'react-i18next';
import { FormGroup, Button, FormControl } from 'react-bootstrap';
import { Bert } from 'meteor/themeteorchef:bert';
+import { withTracker } from 'meteor/react-meteor-data';
import validate from '../../../modules/validate';
import './Feedback.scss';
@@ -78,10 +79,11 @@ class Feedback extends Component {
(this.email = email)}
placeholder={this.t('Tu correo')}
+ disabled={this.props.authenticated}
+ defaultValue={this.props.authenticated ? Meteor.user().emails[0].address : ''}
type="email"
/>
@@ -114,7 +116,10 @@ class Feedback extends Component {
}
Feedback.propTypes = {
- t: PropTypes.func.isRequired
+ t: PropTypes.func.isRequired,
+ authenticated: PropTypes.bool.isRequired
};
-export default translate([], { wait: true })(Feedback);
+export default translate([], { wait: true })(withTracker(() => ({
+ authenticated: !!Meteor.userId()
+}))(Feedback));
diff --git a/imports/ui/components/Utils/isMobile.js b/imports/ui/components/Utils/isMobile.js
index 868ba97..4328a3d 100644
--- a/imports/ui/components/Utils/isMobile.js
+++ b/imports/ui/components/Utils/isMobile.js
@@ -1,7 +1,8 @@
import isMobile from 'ismobilejs';
+import { isHome } from './location';
// https://github.com/ReactTraining/react-router/issues/184
-export const isHomeAndMobile = (window.location.pathname === '/' && isMobile.any);
+export const isHomeAndMobile = isHome() && isMobile.any;
export const isNotHomeAndMobile = !isHomeAndMobile;
export const isAnyMobile = isMobile.any;
// https://stackoverflow.com/questions/18625321/detect-webkit-browser-in-javascript
diff --git a/imports/ui/layouts/App/App.js b/imports/ui/layouts/App/App.js
index ba9d649..89d427e 100644
--- a/imports/ui/layouts/App/App.js
+++ b/imports/ui/layouts/App/App.js
@@ -19,6 +19,7 @@ import '/imports/startup/client/ravenLogger';
import '/imports/startup/client/geolocation';
import '/imports/startup/client/piwik-start.js';
import 'simple-line-icons/css/simple-line-icons.css';
+import { isHome } from '/imports/ui/components/Utils/location';
import Reconnect from '../../components/Reconnect/Reconnect';
import Navigation from '../../components/Navigation/Navigation';
import Authenticated from '../../components/Authenticated/Authenticated';
@@ -139,7 +140,7 @@ const App = props => (
- { props.authenticated && }
+ { !isHome() && }
{props.i18nReady.get() &&
diff --git a/public/locales/en/common.json b/public/locales/en/common.json
index fabdf90..e51404e 100644
--- a/public/locales/en/common.json
+++ b/public/locales/en/common.json
@@ -204,5 +204,7 @@
"Desconectado del servidor, reconectando...":
"Disconnected from server, trying to reconnect...",
"Reintentar ahora":
- "Retry now"
+ "Retry now",
+ "Feedback recibido, gracias...":
+ "Feedback received, thanks..."
}
diff --git a/public/locales/es/common.json b/public/locales/es/common.json
index c05ab2f..dafe892 100644
--- a/public/locales/es/common.json
+++ b/public/locales/es/common.json
@@ -291,5 +291,7 @@
"Desconectado del servidor, reconectando...":
"Desconectado del servidor, reconectando...",
"Reintentar ahora":
- "Reintentar ahora"
+ "Reintentar ahora",
+ "Feedback recibido, gracias...":
+ "Feedback recibido, gracias..."
}