Progress
This commit is contained in:
@@ -79,6 +79,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
isModalOpen: PropTypes.bool,
|
||||
scheduledAt: PropTypes.instanceOf(Date),
|
||||
setScheduledAt: PropTypes.func.isRequired,
|
||||
replyToId: PropTypes.string,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
@@ -231,7 +232,6 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
scheduledAt,
|
||||
spoiler
|
||||
} = this.props
|
||||
const condensed = shouldCondense && !this.props.text && !this.state.composeFocused;
|
||||
const disabled = this.props.isSubmitting;
|
||||
const text = [this.props.spoilerText, countableText(this.props.text)].join('');
|
||||
const disabledButton = disabled || this.props.isUploading || this.props.isChangingUpload || length(text) > maxPostCharacterCount || (text.length !== 0 && text.trim().length === 0 && !anyMedia);
|
||||
|
||||
@@ -7,6 +7,11 @@ import { WhoToFollowPanel } from '../../../../components/panel'
|
||||
// import TrendsPanel from '../../ui/components/trends_panel'
|
||||
import GroupListItem from '../../../../components/group_list_item'
|
||||
import Block from '../../../../components/block'
|
||||
import Heading from '../../../../components/heading'
|
||||
import Button from '../../../../components/button'
|
||||
import Text from '../../../../components/text'
|
||||
|
||||
import AccountContainer from '../../../../containers/account_container'
|
||||
|
||||
export default class SearchResults extends ImmutablePureComponent {
|
||||
|
||||
@@ -25,9 +30,7 @@ export default class SearchResults extends ImmutablePureComponent {
|
||||
|
||||
if (results.isEmpty() && isSmallScreen) {
|
||||
return (
|
||||
<div className='search-results'>
|
||||
<WhoToFollowPanel />
|
||||
</div>
|
||||
<div />
|
||||
)
|
||||
}
|
||||
|
||||
@@ -37,23 +40,39 @@ export default class SearchResults extends ImmutablePureComponent {
|
||||
const showGroups = pathname === '/search/groups'
|
||||
const isTop = !showPeople && !showHashtags && !showGroups
|
||||
|
||||
let accounts, statuses, hashtags, groups;
|
||||
let count = 0;
|
||||
let accounts, statuses, hashtags, groups
|
||||
|
||||
if (results.get('accounts') && results.get('accounts').size > 0 && (isTop || showPeople)) {
|
||||
const size = isTop ? Math.min(results.get('accounts').size, 5) : results.get('accounts').size;
|
||||
count += size;
|
||||
accounts = (
|
||||
<div className='search-results__section'>
|
||||
<h5><Icon id='user' fixedWidth /><FormattedMessage id='search_results.accounts' defaultMessage='People' /></h5>
|
||||
{results.get('accounts').slice(0, size).map(accountId => <AccountContainer key={accountId} id={accountId} />)}
|
||||
<div className={[_s.default, _s.py15, _s.px15].join(' ')}>
|
||||
<div className={[_s.default, _s.flexRow, _s.mb15].join(' ')}>
|
||||
<Heading size='h3'>
|
||||
People
|
||||
</Heading>
|
||||
<div className={[_s.default, _s.marginLeftAuto].join(' ')}>
|
||||
<Button
|
||||
text
|
||||
backgroundColor='none'
|
||||
color='brand'
|
||||
to='/search/people'
|
||||
>
|
||||
<Text size='small' color='inherit' weight='bold'>
|
||||
See All
|
||||
</Text>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{
|
||||
results.get('accounts').slice(0, size).map(accountId => <AccountContainer expanded key={accountId} id={accountId} />)
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (results.get('groups') && results.get('groups').size > 0 && (isTop || showGroups)) {
|
||||
const size = isTop ? Math.min(results.get('groups').size, 5) : results.get('groups').size;
|
||||
count += size;
|
||||
groups = (
|
||||
<div className='search-results__section'>
|
||||
<h5><Icon id='users' fixedWidth /><FormattedMessage id='search_results.groups' defaultMessage='Groups' /></h5>
|
||||
@@ -64,7 +83,6 @@ export default class SearchResults extends ImmutablePureComponent {
|
||||
|
||||
if (results.get('hashtags') && results.get('hashtags').size > 0 && (isTop || showHashtags)) {
|
||||
const size = isTop ? Math.min(results.get('hashtags').size, 5) : results.get('hashtags').size;
|
||||
count += size;
|
||||
hashtags = (
|
||||
<div className='search-results__section'>
|
||||
<h5><Icon id='hashtag' fixedWidth /><FormattedMessage id='search_results.hashtags' defaultMessage='Hashtags' /></h5>
|
||||
@@ -75,17 +93,6 @@ export default class SearchResults extends ImmutablePureComponent {
|
||||
|
||||
return (
|
||||
<Block>
|
||||
<div className='search-results__header'>
|
||||
<Icon id='search' fixedWidth />
|
||||
<FormattedMessage
|
||||
id='search_results.total'
|
||||
defaultMessage='{count, number} {count, plural, one {result} other {results}}'
|
||||
values={{
|
||||
count
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{accounts}
|
||||
{groups}
|
||||
{statuses}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { List as ImmutableList } from 'immutable'
|
||||
import ComposeForm from '../components/compose_form'
|
||||
import {
|
||||
changeCompose,
|
||||
@@ -12,29 +13,31 @@ import {
|
||||
} from '../../../actions/compose'
|
||||
import { me } from '../../../initial_state'
|
||||
|
||||
const mapStateToProps = (state, { status }) => {
|
||||
const mapStateToProps = (state, { replyToId }) => {
|
||||
|
||||
// : todo :
|
||||
//everything needs to be in relation to if there's a status or not
|
||||
const reduxReplyToId = state.getIn(['compose', 'in_reply_to'])
|
||||
const isMatch = reduxReplyToId || replyToId ? reduxReplyToId === replyToId : true
|
||||
|
||||
// console.log("isMatch:", isMatch, reduxReplyToId, replyToId)
|
||||
|
||||
return {
|
||||
edit: state.getIn(['compose', 'id']) !== null,
|
||||
text: state.getIn(['compose', 'text']),
|
||||
suggestions: state.getIn(['compose', 'suggestions']),
|
||||
spoiler: state.getIn(['compose', 'spoiler']),
|
||||
spoilerText: state.getIn(['compose', 'spoiler_text']),
|
||||
privacy: state.getIn(['compose', 'privacy']),
|
||||
focusDate: state.getIn(['compose', 'focusDate']),
|
||||
caretPosition: state.getIn(['compose', 'caretPosition']),
|
||||
preselectDate: state.getIn(['compose', 'preselectDate']),
|
||||
isSubmitting: state.getIn(['compose', 'is_submitting']),
|
||||
isChangingUpload: state.getIn(['compose', 'is_changing_upload']),
|
||||
isUploading: state.getIn(['compose', 'is_uploading']),
|
||||
showSearch: state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),
|
||||
anyMedia: state.getIn(['compose', 'media_attachments']).size > 0,
|
||||
isModalOpen: state.get('modal').modalType === 'COMPOSE',
|
||||
quoteOfId: state.getIn(['compose', 'quote_of_id']),
|
||||
scheduledAt: state.getIn(['compose', 'scheduled_at']),
|
||||
edit: !isMatch ? null : state.getIn(['compose', 'id']) !== null,
|
||||
text: !isMatch ? '' : state.getIn(['compose', 'text']),
|
||||
suggestions: !isMatch ? ImmutableList() : state.getIn(['compose', 'suggestions']),
|
||||
spoiler: !isMatch ? false : state.getIn(['compose', 'spoiler']),
|
||||
spoilerText: !isMatch ? '' : state.getIn(['compose', 'spoiler_text']),
|
||||
privacy: !isMatch ? null : state.getIn(['compose', 'privacy']),
|
||||
focusDate: !isMatch ? null : state.getIn(['compose', 'focusDate']),
|
||||
caretPosition: !isMatch ? null : state.getIn(['compose', 'caretPosition']),
|
||||
preselectDate: !isMatch ? null : state.getIn(['compose', 'preselectDate']),
|
||||
isSubmitting: !isMatch ? false : state.getIn(['compose', 'is_submitting']),
|
||||
isChangingUpload: !isMatch ? false : state.getIn(['compose', 'is_changing_upload']),
|
||||
isUploading: !isMatch ? false : state.getIn(['compose', 'is_uploading']),
|
||||
showSearch: !isMatch ? false : state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),
|
||||
anyMedia: !isMatch ? false : state.getIn(['compose', 'media_attachments']).size > 0,
|
||||
isModalOpen: !isMatch ? false : state.get('modal').modalType === 'COMPOSE',
|
||||
quoteOfId: !isMatch ? null : state.getIn(['compose', 'quote_of_id']),
|
||||
scheduledAt: !isMatch ? null : state.getIn(['compose', 'scheduled_at']),
|
||||
account: state.getIn(['accounts', me]),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
import { initMuteModal } from '../../../actions/mutes';
|
||||
import { initReport } from '../../../actions/reports';
|
||||
import { openModal } from '../../../actions/modal';
|
||||
import { showAlertForError } from '../../../actions/alerts';
|
||||
// import { showAlertForError } from '../../../actions/alerts';
|
||||
import { boostModal, deleteModal } from '../../../initial_state';
|
||||
import { makeGetStatus } from '../../../selectors';
|
||||
import DetailedStatus from '../components/detailed_status';
|
||||
@@ -97,10 +97,10 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
|
||||
},
|
||||
|
||||
onEmbed (status) {
|
||||
dispatch(openModal('EMBED', {
|
||||
url: status.get('url'),
|
||||
onError: error => dispatch(showAlertForError(error)),
|
||||
}));
|
||||
// dispatch(openModal('EMBED', {
|
||||
// url: status.get('url'),
|
||||
// onError: error => dispatch(showAlertForError(error)),
|
||||
// }));
|
||||
},
|
||||
|
||||
onDelete (status, history) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import Immutable from 'immutable';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import { HotKeys } from 'react-hotkeys';
|
||||
import { fetchStatus } from '../../actions/statuses';
|
||||
import Immutable from 'immutable'
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component'
|
||||
import { HotKeys } from 'react-hotkeys'
|
||||
import { fetchStatus } from '../../actions/statuses'
|
||||
import {
|
||||
favorite,
|
||||
unfavorite,
|
||||
@@ -11,27 +11,27 @@ import {
|
||||
unrepost,
|
||||
pin,
|
||||
unpin,
|
||||
} from '../../actions/interactions';
|
||||
} from '../../actions/interactions'
|
||||
import {
|
||||
replyCompose,
|
||||
mentionCompose,
|
||||
} from '../../actions/compose';
|
||||
import { blockAccount } from '../../actions/accounts';
|
||||
} from '../../actions/compose'
|
||||
import { blockAccount } from '../../actions/accounts'
|
||||
import {
|
||||
muteStatus,
|
||||
unmuteStatus,
|
||||
deleteStatus,
|
||||
hideStatus,
|
||||
revealStatus,
|
||||
} from '../../actions/statuses';
|
||||
import { initMuteModal } from '../../actions/mutes';
|
||||
import { initReport } from '../../actions/reports';
|
||||
import { openModal } from '../../actions/modal';
|
||||
import { boostModal, deleteModal, me } from '../../initial_state';
|
||||
import { makeGetStatus } from '../../selectors';
|
||||
import StatusContainer from '../../containers/status_container';
|
||||
import { textForScreenReader, defaultMediaVisibility } from '../../components/status/status';
|
||||
import ColumnIndicator from '../../components/column_indicator';
|
||||
} from '../../actions/statuses'
|
||||
import { initMuteModal } from '../../actions/mutes'
|
||||
import { initReport } from '../../actions/reports'
|
||||
import { openModal } from '../../actions/modal'
|
||||
import { boostModal, deleteModal, me } from '../../initial_state'
|
||||
import { makeGetStatus } from '../../selectors'
|
||||
import StatusContainer from '../../containers/status_container'
|
||||
import { textForScreenReader, defaultMediaVisibility } from '../../components/status/status'
|
||||
import ColumnIndicator from '../../components/column_indicator'
|
||||
import Block from '../../components/block'
|
||||
import Comment from '../../components/comment'
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ import { fetchFilters } from '../../actions/filters'
|
||||
import { clearHeight } from '../../actions/height_cache'
|
||||
import { openModal } from '../../actions/modal'
|
||||
import WrappedRoute from './util/wrapped_route'
|
||||
import NotificationsContainer from '../../containers/notifications_container'
|
||||
import ModalRoot from '../../components/modal/modal_root'
|
||||
import PopoverRoot from '../../components/popover/popover_root'
|
||||
import UploadArea from '../../components/upload_area'
|
||||
@@ -373,9 +372,9 @@ class UI extends PureComponent {
|
||||
componentDidMount() {
|
||||
if (!me) return
|
||||
|
||||
this.hotkeys.__mousetrap__.stopCallback = (e, element) => {
|
||||
return ['TEXTAREA', 'SELECT', 'INPUT'].includes(element.tagName)
|
||||
}
|
||||
// this.hotkeys.__mousetrap__.stopCallback = (e, element) => {
|
||||
// return ['TEXTAREA', 'SELECT', 'INPUT'].includes(element.tagName)
|
||||
// }
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@@ -489,27 +488,18 @@ class UI extends PureComponent {
|
||||
} : {}
|
||||
|
||||
return (
|
||||
<HotKeys
|
||||
keyMap={keyMap}
|
||||
handlers={handlers}
|
||||
ref={this.setHotkeysRef}
|
||||
attach={window}
|
||||
focused
|
||||
>
|
||||
<div ref={this.setRef}>
|
||||
<SwitchingArea
|
||||
location={location}
|
||||
onLayoutChange={this.handleLayoutChange}
|
||||
>
|
||||
{children}
|
||||
</SwitchingArea>
|
||||
<div ref={this.setRef}>
|
||||
<SwitchingArea
|
||||
location={location}
|
||||
onLayoutChange={this.handleLayoutChange}
|
||||
>
|
||||
{children}
|
||||
</SwitchingArea>
|
||||
|
||||
{ /* <NotificationsContainer /> */ }
|
||||
<ModalRoot />
|
||||
<PopoverRoot />
|
||||
<UploadArea active={draggingOver} onClose={this.closeUploadModal} />
|
||||
</div>
|
||||
</HotKeys>
|
||||
<ModalRoot />
|
||||
<PopoverRoot />
|
||||
<UploadArea active={draggingOver} onClose={this.closeUploadModal} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user