mirror of
https://github.com/wassname/talk.git
synced 2026-08-02 13:10:23 +08:00
now with translations and page hostname
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import React, {PropTypes} from 'react';
|
||||
import I18n from 'coral-framework/i18n/i18n';
|
||||
import translations from './translations';
|
||||
import onClickOutside from 'react-onclickoutside';
|
||||
const name = 'coral-plugin-permalinks';
|
||||
|
||||
const lang = new I18n(translations);
|
||||
|
||||
class PermalinkButton extends React.Component {
|
||||
|
||||
static propTypes = {
|
||||
@@ -39,13 +43,13 @@ class PermalinkButton extends React.Component {
|
||||
}
|
||||
|
||||
render () {
|
||||
const publisherUrl = 'http://nytimes.com/';
|
||||
const publisherUrl = `${location.protocol}//${location.host}/`;
|
||||
|
||||
return (
|
||||
<div className={`${name}-container`} style={styles}>
|
||||
<button onClick={this.toggle} className={`${name}-button`}>
|
||||
<i className={`${name}-icon material-icons`} aria-hidden={true}>link</i>
|
||||
Permalink
|
||||
{lang.t('permalink.permalink')}
|
||||
</button>
|
||||
<div
|
||||
style={styles.popover(this.state.popoverOpen)}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
en: {
|
||||
permalink: {
|
||||
permalink: 'Permalink'
|
||||
}
|
||||
},
|
||||
es: {
|
||||
permalink: {
|
||||
permalink: 'Enlace permanente'
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user