From 16847f9fec7802f41ac8a19abcec8ebbf8c8fa8d Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 10 Oct 2017 02:48:12 -0300 Subject: [PATCH] Translations and PropTypes --- .../src/routes/Community/components/Table.js | 41 ++++++++++++------- locales/en.yml | 1 + locales/es.yml | 1 + 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/client/coral-admin/src/routes/Community/components/Table.js b/client/coral-admin/src/routes/Community/components/Table.js index 18f52592d..2efa5944b 100644 --- a/client/coral-admin/src/routes/Community/components/Table.js +++ b/client/coral-admin/src/routes/Community/components/Table.js @@ -1,9 +1,11 @@ import React from 'react'; -import {SelectField, Option} from 'react-mdl-selectfield'; import styles from '../components/Table.css'; import t from 'coral-framework/services/i18n'; +import PropTypes from 'prop-types'; +import {Dropdown, Option} from 'coral-ui'; +import capitalize from 'lodash/capitalize'; -export default ({headers, commenters, onHeaderClickHandler, onRoleChange, onCommenterStatusChange, viewUserDetail}) => ( +const Table = ({headers, commenters, onHeaderClickHandler, onRoleChange, onCommenterStatusChange, viewUserDetail}) => ( @@ -28,29 +30,40 @@ export default ({headers, commenters, onHeaderClickHandler, onRoleChange, onComm {row.created_at} ))}
- onCommenterStatusChange(row.id, status)}> + onCommenterStatusChange(row.id, status)}> - + - onRoleChange(row.id, role)}> - + - +
); + +Table.propTypes = { + headers: PropTypes.array, + commenters: PropTypes.array, + onHeaderClickHandler: PropTypes.func, + onRoleChange: PropTypes.func, + onCommenterStatusChange: PropTypes.func, + viewUserDetail: PropTypes.func, +}; + +export default Table; diff --git a/locales/en.yml b/locales/en.yml index 92119f125..7cea0c6da 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -75,6 +75,7 @@ en: status: Status username_and_email: "Username and Email" yes_ban_user: "Yes Ban User" + none: "None" configure: apply: Apply banned_word_text: "Comments which contain these words or phrases (not case-sensitive) will be automatically removed from the comment stream. Type a word and press Enter or Tab to add. Optionally paste a comma-separated list." diff --git a/locales/es.yml b/locales/es.yml index 62fc94256..70fce5310 100644 --- a/locales/es.yml +++ b/locales/es.yml @@ -74,6 +74,7 @@ es: status: Estado username_and_email: "Usuario y Correo" yes_ban_user: "Si, Suspendan el usuario" + none: "Ninguno" configure: apply: Aplicar banned_word_text: "Comentarios que contengan estas palabras o frases, en mayusculas o minúsculas, serán automáticamente eliminados del hilo de comentario. Escribir una palabra y apretar Enter o Tabulador para agregarla. O pueden pegar una lista de palabras separadas por coma."