diff --git a/app/javascript/gabsocial/actions/compose.js b/app/javascript/gabsocial/actions/compose.js index 4c390258..620ad4ed 100644 --- a/app/javascript/gabsocial/actions/compose.js +++ b/app/javascript/gabsocial/actions/compose.js @@ -22,7 +22,6 @@ export const COMPOSE_SUBMIT_FAIL = 'COMPOSE_SUBMIT_FAIL'; export const COMPOSE_REPLY = 'COMPOSE_REPLY'; export const COMPOSE_QUOTE = 'COMPOSE_QUOTE'; export const COMPOSE_REPLY_CANCEL = 'COMPOSE_REPLY_CANCEL'; -export const COMPOSE_DIRECT = 'COMPOSE_DIRECT'; export const COMPOSE_MENTION = 'COMPOSE_MENTION'; export const COMPOSE_RESET = 'COMPOSE_RESET'; export const COMPOSE_UPLOAD_REQUEST = 'COMPOSE_UPLOAD_REQUEST'; diff --git a/app/javascript/gabsocial/actions/streaming.js b/app/javascript/gabsocial/actions/streaming.js index 0baf42c9..074b2f43 100644 --- a/app/javascript/gabsocial/actions/streaming.js +++ b/app/javascript/gabsocial/actions/streaming.js @@ -57,9 +57,7 @@ const refreshHomeTimelineAndNotification = (dispatch, done) => { export const connectUserStream = () => connectTimelineStream('home', 'user', refreshHomeTimelineAndNotification); export const connectCommunityStream = ({ onlyMedia } = {}) => connectTimelineStream(`community${onlyMedia ? ':media' : ''}`, `public:local${onlyMedia ? ':media' : ''}`); -export const connectPublicStream = ({ onlyMedia } = {}) => connectTimelineStream(`public${onlyMedia ? ':media' : ''}`, `public${onlyMedia ? ':media' : ''}`); export const connectHashtagStream = (id, tag, accept) => connectTimelineStream(`hashtag:${id}`, `hashtag&tag=${tag}`, null, accept); -export const connectDirectStream = () => connectTimelineStream('direct', 'direct'); export const connectListStream = id => connectTimelineStream(`list:${id}`, `list&list=${id}`); export const connectGroupStream = id => connectTimelineStream(`group:${id}`, `group&group=${id}`); diff --git a/app/javascript/gabsocial/actions/timelines.js b/app/javascript/gabsocial/actions/timelines.js index 722a4cea..5f0a4e05 100644 --- a/app/javascript/gabsocial/actions/timelines.js +++ b/app/javascript/gabsocial/actions/timelines.js @@ -153,7 +153,6 @@ export function expandTimeline(timelineId, path, params = {}, done = noOp) { }; export const expandHomeTimeline = ({ maxId } = {}, done = noOp) => expandTimeline('home', '/api/v1/timelines/home', { max_id: maxId }, done); -export const expandPublicTimeline = ({ maxId, onlyMedia } = {}, done = noOp) => expandTimeline(`public${onlyMedia ? ':media' : ''}`, '/api/v1/timelines/public', { max_id: maxId, only_media: !!onlyMedia }, done); export const expandCommunityTimeline = ({ maxId, onlyMedia } = {}, done = noOp) => expandTimeline(`community${onlyMedia ? ':media' : ''}`, '/api/v1/timelines/public', { local: true, max_id: maxId, only_media: !!onlyMedia }, done); export const expandAccountTimeline = (accountId, { maxId, withReplies } = {}) => expandTimeline(`account:${accountId}${withReplies ? ':with_replies' : ''}`, `/api/v1/accounts/${accountId}/statuses`, { exclude_replies: !withReplies, max_id: maxId }); export const expandAccountFeaturedTimeline = accountId => expandTimeline(`account:${accountId}:pinned`, `/api/v1/accounts/${accountId}/statuses`, { pinned: true }); diff --git a/app/javascript/gabsocial/assets/group_add_icon.js b/app/javascript/gabsocial/assets/group_add_icon.js new file mode 100644 index 00000000..3614f360 --- /dev/null +++ b/app/javascript/gabsocial/assets/group_add_icon.js @@ -0,0 +1,26 @@ +const GroupAddIcon = ({ + className = '', + width = '24px', + height = '24px', + viewBox = '0 0 64 64', + title = 'Group Add', +}) => ( + + + + + +) + +export default GroupAddIcon \ No newline at end of file diff --git a/app/javascript/gabsocial/assets/index.js b/app/javascript/gabsocial/assets/index.js index 642abcef..737da93b 100644 --- a/app/javascript/gabsocial/assets/index.js +++ b/app/javascript/gabsocial/assets/index.js @@ -15,11 +15,13 @@ import ErrorIcon from './error_icon' import FullscreenIcon from './fullscreen_icon' import GlobeIcon from './globe_icon' import GroupIcon from './group_icon' +import GroupAddIcon from './group_add_icon' import HappyIcon from './happy_icon' import HomeIcon from './home_icon' import LikeIcon from './like_icon' import LinkIcon from './link_icon' import ListIcon from './list_icon' +import ListAddIcon from './list_add_icon' import LoadingIcon from './loading_icon' import MediaIcon from './media_icon' import MinimizeFullscreenIcon from './minimize_fullscreen_icon' @@ -58,11 +60,13 @@ export { FullscreenIcon, GlobeIcon, GroupIcon, + GroupAddIcon, HappyIcon, HomeIcon, LikeIcon, LinkIcon, ListIcon, + ListAddIcon, LoadingIcon, MediaIcon, MinimizeFullscreenIcon, diff --git a/app/javascript/gabsocial/assets/list_add_icon.js b/app/javascript/gabsocial/assets/list_add_icon.js new file mode 100644 index 00000000..fb46321b --- /dev/null +++ b/app/javascript/gabsocial/assets/list_add_icon.js @@ -0,0 +1,34 @@ +const ListAddIcon = ({ + className = '', + width = '24px', + height = '24px', + viewBox = '0 0 24 24', + title = 'List Add', +}) => ( + + + + + + + + + + + + + +) + +export default ListAddIcon \ No newline at end of file diff --git a/app/javascript/gabsocial/components/account.js b/app/javascript/gabsocial/components/account.js index 5bd5d026..c3ab12bc 100644 --- a/app/javascript/gabsocial/components/account.js +++ b/app/javascript/gabsocial/components/account.js @@ -109,6 +109,9 @@ class Account extends ImmutablePureComponent { const requested = account.getIn(['relationship', 'requested']) const blocking = account.getIn(['relationship', 'blocking']) + // : todo : + // unmute + if (requested || blocking) { buttonText = intl.formatMessage(requested ? messages.requested : messages.unblock) buttonOptions = { diff --git a/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js b/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js index 22bb4c51..23b940ac 100644 --- a/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js +++ b/app/javascript/gabsocial/components/autosuggest_textbox/autosuggest_textbox.js @@ -9,6 +9,7 @@ import { textAtCursorMatchesToken } from '../../utils/cursor_token_match' import AutosuggestAccount from '../autosuggest_account' import AutosuggestEmoji from '../autosuggest_emoji' import Input from '../input' +import Composer from '../composer' const cx = classNames.bind(_s) @@ -52,9 +53,9 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { } onChange = (e) => { - const [ tokenStart, token ] = textAtCursorMatchesToken(e.target.value, e.target.selectionStart, this.props.searchTokens); + const [tokenStart, token] = textAtCursorMatchesToken(e.target.value, e.target.selectionStart, this.props.searchTokens); - console.log('onChange', e.target.value, e.target, this.textbox, tokenStart, token) + // console.log('onChange', e.target.value, e.target, this.textbox, tokenStart, token) if (token !== null && this.state.lastToken !== token) { this.setState({ lastToken: token, selectedSuggestion: 0, tokenStart }); @@ -80,40 +81,40 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { // e.key may be a name of the physical key even in this case (e.x. Safari / Chrome on Mac) if (e.which === 229 || e.isComposing) return; - switch(e.key) { - case 'Escape': - if (suggestions.size === 0 || suggestionsHidden) { - document.querySelector('.ui').parentElement.focus(); - } else { - e.preventDefault(); - this.setState({ suggestionsHidden: true }); - } + switch (e.key) { + case 'Escape': + if (suggestions.size === 0 || suggestionsHidden) { + document.querySelector('.ui').parentElement.focus(); + } else { + e.preventDefault(); + this.setState({ suggestionsHidden: true }); + } - break; - case 'ArrowDown': - if (suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) }); - } + break; + case 'ArrowDown': + if (suggestions.size > 0 && !suggestionsHidden) { + e.preventDefault(); + this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) }); + } - break; - case 'ArrowUp': - if (suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) }); - } + break; + case 'ArrowUp': + if (suggestions.size > 0 && !suggestionsHidden) { + e.preventDefault(); + this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) }); + } - break; - case 'Enter': - case 'Tab': - // Select suggestion - if (this.state.lastToken !== null && suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - e.stopPropagation(); - this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestions.get(selectedSuggestion)); - } + break; + case 'Enter': + case 'Tab': + // Select suggestion + if (this.state.lastToken !== null && suggestions.size > 0 && !suggestionsHidden) { + e.preventDefault(); + e.stopPropagation(); + this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestions.get(selectedSuggestion)); + } - break; + break; } if (e.defaultPrevented || !this.props.onKeyDown) return; @@ -151,7 +152,7 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { this.textbox.focus(); } - componentWillReceiveProps (nextProps) { + componentWillReceiveProps(nextProps) { if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { this.setState({ suggestionsHidden: false }); } @@ -194,7 +195,7 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { this.textbox = c; } - render () { + render() { const { value, small, @@ -245,13 +246,18 @@ export default class AutosuggestTextbox extends ImmutablePureComponent { // tabindex="0" // no-focuscontainer-refocus="true" // style="outline: none; user-select: text; white-space: pre-wrap; overflow-wrap: break-word;"> - + if (textarea) { return ( - +
-