From 4b585108895cbb8b43a057a6b92e46ccc4cfcdf9 Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Tue, 1 May 2018 01:39:01 +0100 Subject: [PATCH] example-forum: Use vulcan-ui-bootstrap Modal component. Moving away of direct react-bootstrap dependency (issue #50). --- .../components/users/UsersProfileCheck.jsx | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/packages/example-forum/lib/components/users/UsersProfileCheck.jsx b/packages/example-forum/lib/components/users/UsersProfileCheck.jsx index 2caa2ea0..3a0d5db6 100644 --- a/packages/example-forum/lib/components/users/UsersProfileCheck.jsx +++ b/packages/example-forum/lib/components/users/UsersProfileCheck.jsx @@ -1,6 +1,5 @@ import React from 'react'; import PropTypes from 'prop-types'; -import Modal from 'react-bootstrap/lib/Modal' import Users from 'meteor/vulcan:users'; import { withDocument, Components, registerComponent, withMessages } from 'meteor/vulcan:core'; import { FormattedMessage, intlShape } from 'meteor/vulcan:i18n'; @@ -15,41 +14,44 @@ const UsersProfileCheck = ({currentUser, document, loading, flash}, context) => if (!currentUser || loading) { return null; - + } else { - + // return fields that are required by the schema but haven't been filled out yet const fieldsToComplete = _.filter(Users.getRequiredFields(), fieldName => { return !userMustCompleteFields[fieldName]; }); if (fieldsToComplete.length > 0) { - + const footer = ( + Meteor.logout(() => window.location.reload() /* something is broken here when giving the apollo client as a prop*/) }> + + + ); return ( - - - - - - { - const newUser = {...currentUser, ...user}; - if (Users.hasCompletedProfile(newUser)) { - flash(context.intl.formatMessage({id: "users.profile_completed"}), 'success'); - } - }} - /> - - - Meteor.logout(() => window.location.reload() /* something is broken here when giving the apollo client as a prop*/) }> - - - ) + } + footerContent={ footer } + > + { + const newUser = {...currentUser, ...user}; + if (Users.hasCompletedProfile(newUser)) { + flash(context.intl.formatMessage({id: "users.profile_completed"}), 'success'); + } + }} + /> + + ); } else { - + return null; }