Vulcan/packages/vulcan-base-components/lib/users/UsersAccount.jsx

18 lines
651 B
React
Raw Normal View History

2017-03-23 16:27:59 +09:00
import { Components, registerComponent, withCurrentUser } from 'meteor/vulcan:core';
2016-06-11 16:36:18 +09:00
import React from 'react';
2017-05-19 14:42:43 -06:00
import PropTypes from 'prop-types';
2016-06-11 16:36:18 +09:00
2017-05-19 14:42:43 -06:00
const UsersAccount = (props, /* context*/) => {
// note: terms is as the same as a document-shape the SmartForm edit-mode expects to receive
2017-05-19 14:42:43 -06:00
const terms = props.params.slug ? { slug: props.params.slug } : props.currentUser ? { documentId: props.currentUser._id } : {};
return <Components.UsersEditForm terms={terms} />
2016-06-11 16:36:18 +09:00
};
2016-11-15 18:33:16 +01:00
UsersAccount.propTypes = {
2017-05-19 14:42:43 -06:00
currentUser: PropTypes.object
2016-11-15 18:33:16 +01:00
};
2016-06-11 16:36:18 +09:00
2017-05-19 14:42:43 -06:00
UsersAccount.displayName = 'UsersAccount';
2016-06-11 16:36:18 +09:00
registerComponent('UsersAccount', UsersAccount, withCurrentUser);