Reputation: 83
I want to use accounts-ui package for manage accounts on my application, but it's currently a drop-down sign-in form. Does anyone know how to wrap it in a button so that when I click a button, the accounts log-in page will render?
Upvotes: 2
Views: 194
Reputation: 5156
As sdybskiy already pointed out in the comments, the Meteor accounts-ui
package is limited to the drop-down form. However, you could use the User Accounts suite to include UI templates for the Meteor's accounts module.
Currently, the following versions are available:
useraccounts:unstyled
– plain HTML & no CSS rulesuseraccounts:bootstrap
– Twitter Bootstrapuseraccounts:foundation
– Zurb Foundationuseraccounts:ionic
– Ionicuseraccounts:materialize
– Materializeuseraccounts:polymer
– Polymeruseraccounts:ratchet
– Ratchetuseraccounts:semantic-ui
– Semantic UIIf you want install the accounts suite, you just need to run:
meteor add useraccounts:<version>
, for example: useraccounts:bootstrap
.meteor add accounts-<loginService>
, for example: accounts-password
.Concerning routing, there are also two add ons available, useraccounts:iron-routing
and useraccounts:flow-routing
.
So, if you want to have a button which renders the login page on click, you could use the following code example as a starting point (assuming you are using Iron-Router and the useraccounts:iron-routing
package):
<template name="home">
<button id="login" type="button" class="btn btn-default">Login</button>
</template>
Template.home.events({
'click #login': function (event) {
event.preventDefault();
Router.go('/login');
});
AccountsTemplates.configureRoute('signIn', {
name: 'signin',
path: '/login',
template: 'myLogin',
layoutTemplate: 'myLayout',
redirect: '/user-profile',
});
Upvotes: 1