diff --git a/packages/my-custom-package/lib/components/CustomPostsItem.jsx b/packages/my-custom-package/lib/components/CustomPostsItem.jsx index 337888b1f..8e2dece01 100644 --- a/packages/my-custom-package/lib/components/CustomPostsItem.jsx +++ b/packages/my-custom-package/lib/components/CustomPostsItem.jsx @@ -1,4 +1,5 @@ import React, { PropTypes, Component } from 'react'; +import moment from 'moment'; class CustomPostsItem extends Telescope.components.PostsItem { diff --git a/packages/my-custom-package/lib/intl.js b/packages/my-custom-package/lib/intl.js new file mode 100644 index 000000000..f85fadf50 --- /dev/null +++ b/packages/my-custom-package/lib/intl.js @@ -0,0 +1,7 @@ +/* + Let's add an international label to the field added in custom_fields.js +*/ +Telescope.strings.en = { + ...Telescope.strings.en, // get all the string translated + "posts.color": "Color" // add a new one (collection.field: "Label") +}; diff --git a/packages/my-custom-package/lib/modules.js b/packages/my-custom-package/lib/modules.js index e3cfe5279..5330f9308 100644 --- a/packages/my-custom-package/lib/modules.js +++ b/packages/my-custom-package/lib/modules.js @@ -5,4 +5,5 @@ Let's import all our files here. import "./callbacks.js" import "./components.js" import "./custom_fields.js" -import "./routes.jsx" +import "./intl.js" +import "./routes.jsx" \ No newline at end of file diff --git a/packages/my-custom-package/lib/routes.jsx b/packages/my-custom-package/lib/routes.jsx index 148a87f18..e59255f64 100644 --- a/packages/my-custom-package/lib/routes.jsx +++ b/packages/my-custom-package/lib/routes.jsx @@ -3,15 +3,6 @@ A new custom route for our custom page. Browse to http://localhost:3000/my-custom-route to see it. */ -import React from 'react'; -import {mount} from 'react-mounter'; - import MyCustomPage from './components/MyCustomPage.jsx'; -FlowRouter.route('/my-custom-route', { - name: 'myCustomRoute', - action(params, queryParams) { - - mount(Telescope.components.App, {content: }) - } -}); \ No newline at end of file +Telescope.routes.add({name:"myCustomRoute", path:"/my-custom-route", component:MyCustomPage}); diff --git a/packages/nova-base-components/lib/common/Newsletter.jsx b/packages/nova-base-components/lib/common/Newsletter.jsx index 76fe9a069..83d787310 100644 --- a/packages/nova-base-components/lib/common/Newsletter.jsx +++ b/packages/nova-base-components/lib/common/Newsletter.jsx @@ -60,6 +60,14 @@ class Newsletter extends Component { Cookie.save('showBanner', "no"); } + renderButton() { + return this.successCallbackSubscription} + subscribeText={this.context.intl.formatMessage({id: "newsletter.subscribe"})} + user={this.context.currentUser} + /> + } + renderForm() { return ( @@ -76,20 +84,12 @@ class Newsletter extends Component { } render() { - const currentUser = this.context.currentUser; return this.state.showBanner ? (

- {this.context.currentUser - ? this.successCallbackSubscription} - subscribeText={this.context.intl.formatMessage({id: "newsletter.subscribe"})} - user={currentUser} - /> - : this.renderForm() - } + {this.context.currentUser ? this.renderButton() : this.renderForm()}
) : null;