mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
🎨 big answering buttons for conversations in direct messages
This commit is contained in:
parent
ff53301fdb
commit
a43f67dd03
@ -1,9 +1,5 @@
|
|||||||
import api, { getLinks } from '../api';
|
import api, { getLinks } from '../api';
|
||||||
import {
|
import { importFetchedAccounts, importFetchedStatus, importFetchedStatuses } from './importer';
|
||||||
importFetchedAccounts,
|
|
||||||
importFetchedStatuses,
|
|
||||||
importFetchedStatus,
|
|
||||||
} from './importer';
|
|
||||||
|
|
||||||
export const CONVERSATIONS_MOUNT = 'CONVERSATIONS_MOUNT';
|
export const CONVERSATIONS_MOUNT = 'CONVERSATIONS_MOUNT';
|
||||||
export const CONVERSATIONS_UNMOUNT = 'CONVERSATIONS_UNMOUNT';
|
export const CONVERSATIONS_UNMOUNT = 'CONVERSATIONS_UNMOUNT';
|
||||||
@ -30,7 +26,7 @@ export const unmountConversations = () => ({
|
|||||||
export const markConversationRead = conversationId => (dispatch, getState) => {
|
export const markConversationRead = conversationId => (dispatch, getState) => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: CONVERSATIONS_READ,
|
type: CONVERSATIONS_READ,
|
||||||
id: conversationId,
|
id : conversationId,
|
||||||
});
|
});
|
||||||
|
|
||||||
api(getState).post(`/api/v1/conversations/${conversationId}/read`);
|
api(getState).post(`/api/v1/conversations/${conversationId}/read`);
|
||||||
|
@ -6,41 +6,41 @@ import Icon from 'mastodon/components/icon';
|
|||||||
export default class IconButton extends React.PureComponent {
|
export default class IconButton extends React.PureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
className: PropTypes.string,
|
className : PropTypes.string,
|
||||||
title: PropTypes.string.isRequired,
|
title : PropTypes.string.isRequired,
|
||||||
icon: PropTypes.string.isRequired,
|
icon : PropTypes.string.isRequired,
|
||||||
onClick: PropTypes.func,
|
onClick : PropTypes.func,
|
||||||
onMouseDown: PropTypes.func,
|
onMouseDown: PropTypes.func,
|
||||||
onKeyDown: PropTypes.func,
|
onKeyDown : PropTypes.func,
|
||||||
onKeyPress: PropTypes.func,
|
onKeyPress : PropTypes.func,
|
||||||
size: PropTypes.number,
|
size : PropTypes.number,
|
||||||
active: PropTypes.bool,
|
active : PropTypes.bool,
|
||||||
pressed: PropTypes.bool,
|
pressed : PropTypes.bool,
|
||||||
expanded: PropTypes.bool,
|
expanded : PropTypes.bool,
|
||||||
style: PropTypes.object,
|
style : PropTypes.object,
|
||||||
activeStyle: PropTypes.object,
|
activeStyle: PropTypes.object,
|
||||||
disabled: PropTypes.bool,
|
disabled : PropTypes.bool,
|
||||||
inverted: PropTypes.bool,
|
inverted : PropTypes.bool,
|
||||||
animate: PropTypes.bool,
|
animate : PropTypes.bool,
|
||||||
overlay: PropTypes.bool,
|
overlay : PropTypes.bool,
|
||||||
tabIndex: PropTypes.string,
|
tabIndex : PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
size: 18,
|
size : 18,
|
||||||
active: false,
|
active : false,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
animate: false,
|
animate : false,
|
||||||
overlay: false,
|
overlay : false,
|
||||||
tabIndex: '0',
|
tabIndex: '0',
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
activate: false,
|
activate : false,
|
||||||
deactivate: false,
|
deactivate: false,
|
||||||
}
|
};
|
||||||
|
|
||||||
componentWillReceiveProps (nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if (!nextProps.animate) return;
|
if (!nextProps.animate) return;
|
||||||
|
|
||||||
if (this.props.active && !nextProps.active) {
|
if (this.props.active && !nextProps.active) {
|
||||||
@ -56,32 +56,32 @@ export default class IconButton extends React.PureComponent {
|
|||||||
if (!this.props.disabled) {
|
if (!this.props.disabled) {
|
||||||
this.props.onClick(e);
|
this.props.onClick(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyPress = (e) => {
|
handleKeyPress = (e) => {
|
||||||
if (this.props.onKeyPress && !this.props.disabled) {
|
if (this.props.onKeyPress && !this.props.disabled) {
|
||||||
this.props.onKeyPress(e);
|
this.props.onKeyPress(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleMouseDown = (e) => {
|
handleMouseDown = (e) => {
|
||||||
if (!this.props.disabled && this.props.onMouseDown) {
|
if (!this.props.disabled && this.props.onMouseDown) {
|
||||||
this.props.onMouseDown(e);
|
this.props.onMouseDown(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyDown = (e) => {
|
handleKeyDown = (e) => {
|
||||||
if (!this.props.disabled && this.props.onKeyDown) {
|
if (!this.props.disabled && this.props.onKeyDown) {
|
||||||
this.props.onKeyDown(e);
|
this.props.onKeyDown(e);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render () {
|
render() {
|
||||||
const style = {
|
const style = {
|
||||||
fontSize: `${this.props.size}px`,
|
// fontSize: `${this.props.size}px`,
|
||||||
width: `${this.props.size * 1.28571429}px`,
|
// width: `${this.props.size * 1.28571429}px`,
|
||||||
height: `${this.props.size * 1.28571429}px`,
|
// height: `${this.props.size * 1.28571429}px`,
|
||||||
lineHeight: `${this.props.size}px`,
|
// lineHeight: `${this.props.size}px`,
|
||||||
...this.props.style,
|
...this.props.style,
|
||||||
...(this.props.active ? this.props.activeStyle : {}),
|
...(this.props.active ? this.props.activeStyle : {}),
|
||||||
};
|
};
|
||||||
@ -128,8 +128,12 @@ export default class IconButton extends React.PureComponent {
|
|||||||
tabIndex={tabIndex}
|
tabIndex={tabIndex}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
<Icon id={icon} fixedWidth aria-hidden='true' />
|
<Icon
|
||||||
</button>
|
id={icon}
|
||||||
|
fixedWidth
|
||||||
|
aria-hidden='true'
|
||||||
|
/>
|
||||||
|
</button >
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,6 +227,8 @@ class Conversation extends ImmutablePureComponent {
|
|||||||
items={menu}
|
items={menu}
|
||||||
icon='ellipsis-h'
|
icon='ellipsis-h'
|
||||||
direction='right'
|
direction='right'
|
||||||
|
style={{ width: '15em' }}
|
||||||
|
size={18}
|
||||||
title={intl.formatMessage(messages.more)}
|
title={intl.formatMessage(messages.more)}
|
||||||
/>
|
/>
|
||||||
</div >
|
</div >
|
||||||
|
@ -406,6 +406,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.autosuggest-textarea__textarea {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.autosuggest-textarea__textarea,
|
.autosuggest-textarea__textarea,
|
||||||
.spoiler-input__input {
|
.spoiler-input__input {
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -33,31 +33,28 @@ $messagingBoxHeight: 20em;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.conversation {
|
.conversation {
|
||||||
&.focusable {
|
|
||||||
|
|
||||||
|
.conversation__content {
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.conversation_reply,
|
||||||
|
.icon-button {
|
||||||
&:hover {
|
&:hover {
|
||||||
|
color: $ui-highlight-color;
|
||||||
background: mix($ui-base-color, $ui-secondary-color);
|
background: mix($ui-base-color, $ui-secondary-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.conversation_reply {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 1em;
|
|
||||||
width: 15em;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: $ui-highlight-color;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.conversation_reply,
|
||||||
|
.icon-button,
|
||||||
.status__action-bar-dropdown {
|
.status__action-bar-dropdown {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 1em;
|
float: right;
|
||||||
width: 10em;
|
width: 18em;
|
||||||
|
height: 3.2em;
|
||||||
&:hover {
|
text-align: center;
|
||||||
color: $ui-highlight-color;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user