mirror of
https://github.com/wassname/talk.git
synced 2026-08-11 05:54:07 +08:00
adding it back
This commit is contained in:
Submodule plugins/talk-plugin-auth-checkbox deleted from 73cf96e856
@@ -0,0 +1 @@
|
||||
# talk-plugin-auth-checkbox
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"mocha": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"experimentalObjectRestSpread": true,
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
"parser": "babel-eslint",
|
||||
"plugins": [
|
||||
"react"
|
||||
],
|
||||
"rules": {
|
||||
"react/jsx-uses-react": "error",
|
||||
"react/jsx-uses-vars": "error",
|
||||
"no-console": ["warn", { "allow": ["warn", "error"] }]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
.link {
|
||||
color: #2c69b6;
|
||||
cursor: pointer;
|
||||
margin: 0 3px;
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.fieldContainer {
|
||||
padding: 5px 0;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import React from 'react';
|
||||
import { Checkbox } from 'plugin-api/beta/client/components/ui';
|
||||
import { t } from 'plugin-api/beta/client/services';
|
||||
import styles from './TermsAndConditionsField.css';
|
||||
import cn from 'classnames';
|
||||
|
||||
const pluginName = 'talk-plugin-auth-checkbox';
|
||||
|
||||
const TermsLink = () => (
|
||||
<a
|
||||
className={styles.link}
|
||||
href={t('talk-plugin-health-report.terms-link')}
|
||||
target="_blank"
|
||||
>
|
||||
{t('talk-plugin-health-report.terms')}
|
||||
</a>
|
||||
);
|
||||
|
||||
const PrivacyLink = () => (
|
||||
<a
|
||||
className={styles.link}
|
||||
href={t('talk-plugin-health-report.privacy-policy-link')}
|
||||
target="_blank"
|
||||
>
|
||||
{t('talk-plugin-health-report.privacy-policy')}
|
||||
</a>
|
||||
);
|
||||
|
||||
class TermsAndConditionsField extends React.Component {
|
||||
state = { checked: false };
|
||||
id = 'terms-and-conditions';
|
||||
|
||||
componentWillMount() {
|
||||
this.props.indicateBlockerOn(pluginName);
|
||||
}
|
||||
|
||||
onChange = ({ target: { checked } }) => {
|
||||
if (checked) {
|
||||
this.setState(() => ({ checked }));
|
||||
this.props.indicateBlockerOff(pluginName);
|
||||
} else {
|
||||
this.setState(() => ({ checked }));
|
||||
this.props.indicateBlockerOn(pluginName);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
styles.fieldContainer,
|
||||
'talk-plugin-health-report-field-container'
|
||||
)}
|
||||
>
|
||||
<Checkbox
|
||||
checked={this.state.checked}
|
||||
className="talk-plugin-health-report-checkbox"
|
||||
onChange={this.onChange}
|
||||
id={this.id}
|
||||
/>
|
||||
<label id={this.id} className="talk-plugin-health-report-label">
|
||||
{t('talk-plugin-health-report.copy')}
|
||||
<TermsLink />
|
||||
{t('talk-plugin-health-report.and')}
|
||||
<PrivacyLink />
|
||||
{t('talk-plugin-health-report.from')}
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default TermsAndConditionsField;
|
||||
@@ -0,0 +1,9 @@
|
||||
import TermsAndConditionsField from './components/TermsAndConditionsField';
|
||||
import translations from './translations.yml';
|
||||
|
||||
export default {
|
||||
slots: {
|
||||
'talkPluginAuth-formField': [TermsAndConditionsField],
|
||||
},
|
||||
translations,
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
en:
|
||||
talk-plugin-health-report:
|
||||
copy: I agree to the Mozilla
|
||||
and: and
|
||||
terms: Terms of Service
|
||||
privacy-policy: Privacy Policy
|
||||
from: .
|
||||
terms-link: https://www.mozilla.org/en-US/about/legal/terms/mozilla/
|
||||
privacy-policy-link: https://www.mozilla.org/en-US/privacy/websites/
|
||||
es:
|
||||
talk-plugin-health-report:
|
||||
copy: Estoy de acuerdo con
|
||||
and: y
|
||||
terms: los Terminos y Condiciones
|
||||
privacy-policy: la Política de Privacidad
|
||||
from: de Mozilla.
|
||||
terms-link: https://www.mozilla.org/es-ES/about/legal/terms/mozilla/
|
||||
privacy-policy-link: https://www.mozilla.org/es-ES/privacy/websites/
|
||||
fr:
|
||||
talk-plugin-health-report:
|
||||
copy: J'accepte
|
||||
and: et
|
||||
terms: les conditions d'utilisation
|
||||
privacy-policy: la politique de confidentialité
|
||||
from: de Mozilla.
|
||||
terms-link: https://www.mozilla.org/fr/about/legal/terms/mozilla/
|
||||
privacy-policy-link: https://www.mozilla.org/fr/privacy/websites/
|
||||
de:
|
||||
talk-plugin-health-report:
|
||||
copy: Ich stimme
|
||||
and: und
|
||||
terms: den Allgemeinen Geschäftsbedingungen
|
||||
privacy-policy: der Datenschutzrichtlinie
|
||||
from: von Mozilla zu.
|
||||
terms-link: https://www.mozilla.org/de/about/legal/terms/mozilla/
|
||||
privacy-policy-link: https://www.mozilla.org/de/privacy/websites/
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = {};
|
||||
Reference in New Issue
Block a user