mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
Add more sort options and improve styling
This commit is contained in:
@@ -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 = {
|
||||
};
|
||||
Reference in New Issue
Block a user