import React, { PropTypes, Component } from 'react';
import { FormattedMessage } from 'react-intl';
import { Modal } from 'react-bootstrap';
import NovaForm from "meteor/nova:forms";
import { withRouter } from 'react-router'
const UsersProfileCheckModal = ({currentUser, show, router}) => {
// return fields that are required by the schema but haven't been filled out yet
const schema = Users.simpleSchema()._schema;
const requiredFields = _.filter(_.keys(schema), function (fieldName) {
var field = schema[fieldName];
return !!field.required && !Telescope.getNestedProperty(Meteor.user(), fieldName);
});
return (
Telescope.callbacks.runAsync("profileCompletedAsync", user) }
fields={ requiredFields }
/>
Meteor.logout(() => router.push({pathname: '/'})) }>
)
};
class UsersProfileCheck extends Component {
render() {
const currentUser = this.context.currentUser;
return currentUser ? : null
}
}
UsersProfileCheck.contextTypes = {
currentUser: React.PropTypes.object
}
UsersProfileCheck.displayName = "UsersProfileCheck";
module.exports = withRouter(UsersProfileCheck);
export default withRouter(UsersProfileCheck);