mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
upgrade dep:
css-loader 0.28->3.5 del 4.1->5.1 eslint 5.18->6.8 eslint-config-airbnb 17.1->18.1 eslint-loader 2.1->4.0 file-loader 2.0->6.0 fs.extra 8.0->9.0 gulp 2.0->3.0 gulp-nunjucks 4.0->5.0 json-loader 0.5->Removed style-loader 0.23->1.1 uglifyjs-webpack-plugin 1.3->2.2 yargs 13.2->15.3 katex 0.10->0.11 react-monaco-editor 0.35->0.36 timeage-react 1.2->3.0 timeago.js 3.0->4.0 uuid 3.3->7.0
This commit is contained in:
1 parent
9cb68397b9
commit
f9468536de
55 files changed
+776
-1032
No files matched your search
@@ -9,7 +9,7 @@ import 'jquery.easing';
|
||||
import i18n from 'vj/utils/i18n';
|
||||
import Message from './MessageComponent';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
const mapStateToProps = (state) => ({
|
||||
activeId: state.activeId,
|
||||
item: state.activeId !== null
|
||||
? state.dialogues[state.activeId]
|
||||
|
||||
@@ -5,12 +5,12 @@ import 'jquery-scroll-lock';
|
||||
|
||||
import ListItem from './DialogueListItemComponent';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
const mapStateToProps = (state) => ({
|
||||
activeId: state.activeId,
|
||||
dialogues: state.dialogues,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
handleClick(id) {
|
||||
dispatch({
|
||||
type: 'DIALOGUES_SWITCH_TO',
|
||||
@@ -28,14 +28,14 @@ export default class MessagePadDialogueListContainer extends React.PureComponent
|
||||
render() {
|
||||
const orderedDialogues = _.orderBy(
|
||||
_.values(this.props.dialogues),
|
||||
dialogue => (dialogue.isPlaceholder
|
||||
(dialogue) => (dialogue.isPlaceholder
|
||||
? Number.POSITIVE_INFINITY
|
||||
: _.maxBy(dialogue.reply, 'at').at),
|
||||
'desc',
|
||||
);
|
||||
return (
|
||||
<ol className="messagepad__list" ref="list">
|
||||
{_.map(orderedDialogues, dialogue => (
|
||||
{_.map(orderedDialogues, (dialogue) => (
|
||||
<ListItem
|
||||
key={dialogue._id}
|
||||
userName={
|
||||
|
||||
@@ -6,7 +6,7 @@ import Icon from 'vj/components/react/IconComponent';
|
||||
|
||||
import request from 'vj/utils/request';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
const mapStateToProps = (state) => ({
|
||||
activeId: state.activeId,
|
||||
isPosting: state.activeId !== null
|
||||
? state.isPosting[state.activeId]
|
||||
@@ -16,7 +16,7 @@ const mapStateToProps = state => ({
|
||||
: '',
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
handleChange(id, value) {
|
||||
if (id === null) {
|
||||
return;
|
||||
@@ -119,8 +119,8 @@ export default class MessagePadInputContainer extends React.PureComponent {
|
||||
ref="input"
|
||||
disabled={this.props.isPosting}
|
||||
value={this.props.inputValue}
|
||||
onKeyDown={ev => this.handleKeyDown(ev)}
|
||||
onChange={ev => this.props.handleChange(this.props.activeId, ev.target.value)}
|
||||
onKeyDown={(ev) => this.handleKeyDown(ev)}
|
||||
onChange={(ev) => this.props.handleChange(this.props.activeId, ev.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<button
|
||||
|
||||
@@ -9,7 +9,7 @@ import MessagePadDialogueList from './MessagePadDialogueListContainer';
|
||||
import MessagePadDialogueContent from './MessagePadDialogueContentContainer';
|
||||
import MessagePadInput from './MessagePadInputContainer';
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
loadDialogues() {
|
||||
dispatch({
|
||||
type: 'DIALOGUES_LOAD_DIALOGUES',
|
||||
|
||||
@@ -6,12 +6,12 @@ export default function reducer(state = {}, action) {
|
||||
const { messages, udict } = action.payload;
|
||||
return _.keyBy(
|
||||
_.filter(
|
||||
_.map(messages, m => ({
|
||||
_.map(messages, (m) => ({
|
||||
sendee_udoc: udict[m.sendee_uid],
|
||||
sender_udoc: udict[m.sender_uid],
|
||||
...m,
|
||||
})),
|
||||
m => m.sendee_udoc && m.sender_udoc,
|
||||
(m) => m.sendee_udoc && m.sender_udoc,
|
||||
),
|
||||
'_id',
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@ export default function reducer(state = {}, action) {
|
||||
switch (action.type) {
|
||||
case 'DIALOGUES_LOAD_DIALOGUES_FULFILLED': {
|
||||
const dialogues = action.payload.messages;
|
||||
return _.fromPairs(_.map(dialogues, d => [d._id, '']));
|
||||
return _.fromPairs(_.map(dialogues, (d) => [d._id, '']));
|
||||
}
|
||||
case 'DIALOGUES_CREATE': {
|
||||
const { id } = action.payload;
|
||||
|
||||
@@ -5,7 +5,7 @@ export default function reducer(state = {}, action) {
|
||||
switch (action.type) {
|
||||
case 'DIALOGUES_LOAD_DIALOGUES_FULFILLED': {
|
||||
const dialogues = action.payload.messages;
|
||||
return _.fromPairs(_.map(dialogues, d => [d._id, false]));
|
||||
return _.fromPairs(_.map(dialogues, (d) => [d._id, false]));
|
||||
}
|
||||
case 'DIALOGUES_CREATE': {
|
||||
const { id } = action.payload;
|
||||
|
||||
Reference in new issue
Block a user