Skip to content

Zetoff/accounts-material-ui

Repository files navigation

React Accounts UI for using Material-UI

Demo Here

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.

Example setup (Meteor 1.3)

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

import React from 'react';
import { Accounts } from 'meteor/std:accounts-ui';

Accounts.ui.config({
  passwordSignupFields: 'NO_PASSWORD',
  loginPath: '/',
});

if (Meteor.isClient) {
  ReactDOM.render(<Accounts.ui.LoginForm />, document.body)
}

Example setup using FlowRouter (Meteor 1.3)

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

import { FlowRouter } from 'meteor/kadira:flow-router-ssr';
import { Accounts } from 'meteor/std:accounts-ui';
import React from 'react';

Accounts.ui.config({
  passwordSignupFields: 'NO_PASSWORD',
  loginPath: '/login',
  onSignedInHook: () => FlowRouter.go('/'),
  onSignedOutHook: () => FlowRouter.go('/')
});

FlowRouter.route("/login", {
  action(params) {
    mount(MainLayout, {
      content: <Accounts.ui.LoginForm />
    });
  }
});

Credits

Made by Zetoff