Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,25 +175,29 @@ AccountsTemplates.configureRoute = function(route, options) {
//
// For now we need to render the main template using BlazeToReact

if (Package['react-runtime']) {
if (require) {
var React = require('react');
} else if (Package['react-runtime']) {
var React = Package['react-runtime'].React;
} else {
throw new Error("layoutTemplate is a React element but React runtime package is not found");
}

if (Package['kadira:react-layout']) {
if (require) {
var ReactLayout = {render: require('react-mounter').mount};
} else if (Package['kadira:react-layout']) {
var ReactLayout = Package['kadira:react-layout'].ReactLayout;
} else {
throw new Error("useraccounts:flow-routing requires that your project includes kadira:react-layout package.");
}

if (Package['gwendall:blaze-to-react']) {
var BlazeToReact = Package['gwendall:blaze-to-react'].BlazeToReact;
if (Package['gadicc:blaze-react-component']) {
var BlazeToReact = Package['gadicc:blaze-react-component'].default;
} else {
throw new Error("useraccounts:flow-routing requires that your project includes the gwendall:blaze-to-react package.");
throw new Error("useraccounts:flow-routing requires that your project includes the gadicc:blaze-react-component package.");
}

layoutRegions[contentRegion] = React.createElement(BlazeToReact, { blazeTemplate: template });
layoutRegions[contentRegion] = React.createElement(BlazeToReact, { template: template });
}

function doLayout() {
Expand Down
6 changes: 3 additions & 3 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Package.onUse(function(api) {
'kadira:flow-router',
'underscore',
'useraccounts:core',
'ecmascript'
], ['client', 'server']);

api.imply([
Expand All @@ -29,10 +30,9 @@ Package.onUse(function(api) {
], ['client', 'server']);

api.use([
'react@0.14.1_1',
'kadira:blaze-layout@2.3.0',
'kadira:react-layout@1.5.2',
'gwendall:blaze-to-react@0.1.2'
//'gwendall:blaze-to-react'
'gadicc:blaze-react-component'
], ['client', 'server'], { weak: true });

api.addFiles([
Expand Down