zetoff:accounts-material-ui

v0.0.7Published 9 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

React Accounts UI for using Material-UI

Current version 0.0.3

React Accounts UI for using Material-UI

Based on and extends std:accounts-ui

https://github.com/studiointeract/accounts-ui

Installation

meteor add zetoff:accounts-material-ui

Dependencies

In addition to React this package also depends on material-ui. So make sure it is installed:

meteor npm install -S material-ui

Configuration

We support the standard configuration in the account-ui package. But have extended with some new options.

Accounts.ui.config(options)

Example setup (Meteor 1.3)

meteor add accounts-password
meteor add zetoff:accounts-material-ui meteor npm install -S material-ui

1
2import React from 'react';
3import { Accounts } from 'meteor/std:accounts-ui';
4
5Accounts.ui.config({
6  passwordSignupFields: 'NO_PASSWORD',
7  loginPath: '/',
8});
9
10if (Meteor.isClient) {
11  ReactDOM.render(<Accounts.ui.LoginForm />, document.body)
12}
13

Example setup using FlowRouter (Meteor 1.3)

meteor add accounts-password
meteor add zetoff:accounts-material-ui meteor npm install -S material-ui

1import { FlowRouter } from 'meteor/kadira:flow-router-ssr';
2import { Accounts } from 'meteor/std:accounts-ui';
3import React from 'react';
4
5Accounts.ui.config({
6  passwordSignupFields: 'NO_PASSWORD',
7  loginPath: '/login',
8  onSignedInHook: () => FlowRouter.go('/'),
9  onSignedOutHook: () => FlowRouter.go('/')
10});
11
12FlowRouter.route("/login", {
13  action(params) {
14    mount(MainLayout, {
15      content: <Accounts.ui.LoginForm />
16    });
17  }
18});

Credits

Made by Zetoff