Newbie Question: Syntax for Loading Accounts-ui with Mantra?


#1

I’ve installed useraccounts:unstyled from http://useraccounts.meteor.com/, using meteor add useraccounts:unstyled.

How do I access useraccounts pages from a Mantra component?

Thanks very much in advance to all for any info.


Quick Start for Mantra Newbies
#2

Let me ask about this a bit differently. I would like to learn how to do this. I tried googling “use npm packages with meteor mantra” but there are few results. What terms do I need to google to find links that instruct me how to add a package like accounts-ui to Meteor and access it via the correct React syntax?


#3

Your last question was the right one :> Since Mantra is just an app architecture spec, you’re actually just asking how to use accounts-ui (or any Blaze template) inside of React. If you’re in Meteor 1.3 you can use my gadicc:blaze-react-component for this:

import Blaze from 'meteor/gadicc:blaze-react-component';

const App = () => (
  ...
    <Blaze template="loginButtons" align="right" />
  ...
);

#4

@gadicc, thanks for this input. This did work. Very cool! At the same time, I would like to stay in react/materials-ui only for visual consistency.

Is there a link that describes what I need to learn in order to access user accounts:unstyled from a Mantra component? If possible I will update the styling to utilize materials-ui.


#5

Hmmm… this is probably it right here.


#6

Waitaminnit— I’m beginning to get the impression that http://useraccounts.meteor.com/ may be Blaze-only.


#7

Sure :slight_smile: Yeah, it’s a Blaze package, but you can use it in React with the same transform:

import Blaze from 'meteor/gadicc:blaze-react-component';

const App = () => (
  ...
    <Blaze template="atForm" />
  ...
);

From what I understand though, material-ui uses all inline styles, so it won’t be easy to apply that to something else. I saw there is an useraccounts:materialize package too in case that’s an option for you.


#8

As a Meteor/React/Mantra newbie, I’m finding the multiple learning curves so steep that I’m seriously considering abandoning React/Mantra and going with Blaze for my first product iteration.

OTOH I already have collection access, React containers and components working in my own code in Mantra. If I can just get accounts working I may be able to proceed with React/Mantra.

Your suggestion to use useraccounts:materialize is an excellent idea. I will have to give some thought to that. I may need more fine-grained access to the registration UI. I like sites that make it easy to sign up by asking for only your email address, and then on the next screen asking for you to enter a password.

On the Mantra discussion board, @arunoda was kind enough to refer me to refer me to the Ken Rogers book. I may have a look at that.


#9

My personal opinion: the react stuff is definitely more complicated, but results in more maintainable and testable code, therefore a better choice for long-term projects. Personally, I’d still probably use Blaze for a short term project (and the community seems to be doing fun things with it). I’ll say “personally” one more time to make clear that this is just my own opinion :>


#10

@gadicc, I have noticed that I would be bonkers to try to re-create from scratch all the code that is provided by http://useraccounts.meteor.com/. :slight_smile: Therefore I am extremely fortunate to be able to use 'meteor/gadicc:blaze-react-component'!

I am proceeding via your suggestion to use user accounts:materialize.


#11

I should just note that I’ve never actually used accounts:materialize myself, but it sounded like what you were after. So let us know :>

Yeah, useraccounts does some great things. As a middle road, I’m sure they’d also be very open for a PR that uses React natively while still integrating with the rest of the package.

And thanks :slight_smile: