Add more sort options and improve styling

This commit is contained in:
Chi Vinh Le
2017-08-25 20:15:07 +07:00
parent 9e2f6f1f63
commit e51e8c543f
32 changed files with 314 additions and 87 deletions
@@ -0,0 +1,14 @@
{
"presets": [
"es2015"
],
"plugins": [
"add-module-exports",
"transform-class-properties",
"transform-decorators-legacy",
"transform-object-assign",
"transform-object-rest-spread",
"transform-async-to-generator",
"transform-react-jsx"
]
}
@@ -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,19 @@
import translations from './translations.yml';
import {createSortOption} from 'plugin-api/beta/client/factories';
import {t} from 'plugin-api/beta/client/services';
const SortOption = createSortOption(
() => t('talk-plugin-sort-most-replied.label'),
{sortBy: 'REPLIES', sortOrder: 'DESC'},
);
/**
* talk-plugin-sort-newest depends on talk-plugin-viewing-options.
*/
export default {
translations,
slots: {
viewingOptionsSort: [SortOption]
}
};
@@ -0,0 +1,5 @@
en:
talk-plugin-sort-most-replied:
label: Most replied first
es:
talk-plugin-sort-most-replied:
@@ -0,0 +1,2 @@
module.exports = {
};