forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change design of account notes in web UI (mastodon#14208)
* Change design of account notes in web UI * Fix `for` -> `htmlFor`
- Loading branch information
Showing
11 changed files
with
182 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 6 additions & 23 deletions
29
app/javascript/mastodon/features/account/containers/account_note_container.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,17 @@ | ||
import { connect } from 'react-redux'; | ||
import { changeAccountNoteComment, submitAccountNote, initEditAccountNote, cancelAccountNote } from 'mastodon/actions/account_notes'; | ||
import { submitAccountNote } from 'mastodon/actions/account_notes'; | ||
import AccountNote from '../components/account_note'; | ||
|
||
const mapStateToProps = (state, { account }) => { | ||
const isEditing = state.getIn(['account_notes', 'edit', 'account_id']) === account.get('id'); | ||
|
||
return { | ||
isSubmitting: state.getIn(['account_notes', 'edit', 'isSubmitting']), | ||
accountNote: isEditing ? state.getIn(['account_notes', 'edit', 'comment']) : account.getIn(['relationship', 'note']), | ||
isEditing, | ||
}; | ||
}; | ||
const mapStateToProps = (state, { account }) => ({ | ||
value: account.getIn(['relationship', 'note']), | ||
}); | ||
|
||
const mapDispatchToProps = (dispatch, { account }) => ({ | ||
|
||
onEditAccountNote() { | ||
dispatch(initEditAccountNote(account)); | ||
}, | ||
|
||
onSaveAccountNote() { | ||
dispatch(submitAccountNote()); | ||
onSave (value) { | ||
dispatch(submitAccountNote(account.get('id'), value)); | ||
}, | ||
|
||
onCancelAccountNote() { | ||
dispatch(cancelAccountNote()); | ||
}, | ||
|
||
onChangeAccountNote(comment) { | ||
dispatch(changeAccountNoteComment(comment)); | ||
}, | ||
}); | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(AccountNote); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.