import Telescope from 'meteor/nova:lib';
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'
import Users from 'meteor/nova:users';
import { Accounts } from 'meteor/std:accounts-ui';
import { withCurrentUser } from 'meteor/nova:core';
const UsersProfileCheckModal = ({show, router, currentUser}, context) => {
// return fields that are required by the schema but haven't been filled out yet
const schema = Telescope.utils.stripTelescopeNamespace(Users.simpleSchema()._schema);
const requiredFields = _.filter(_.keys(schema), (fieldName) => {
var field = schema[fieldName];
return !!field.required && !Telescope.getNestedProperty(currentUser, fieldName);
});
return (
Telescope.callbacks.runAsync("users.profileCompleted.async", user) }
fields={ requiredFields }
/>
Meteor.logout(Accounts.ui._options.onSignedOutHook()) }>
)
};
const UsersProfileCheck = ({currentUser}, context) => {
return currentUser ? : null;
};
UsersProfileCheck.propsTypes = {
currentUser: React.PropTypes.object
};
UsersProfileCheck.displayName = "UsersProfileCheck";
module.exports = withCurrentUser(withRouter(UsersProfileCheck));
export default withCurrentUser(withRouter(UsersProfileCheck));