This commit is contained in:
mgabdev
2020-04-11 18:29:19 -04:00
parent 7249143d9f
commit 595208780e
160 changed files with 1678 additions and 2103 deletions

View File

@@ -270,7 +270,7 @@ class ComposeForm extends ImmutablePureComponent {
{
shouldCondense &&
<div className={[_s.default, _s.mr10, _s.mt5].join(' ')}>
<Avatar account={account} size='28' />
<Avatar account={account} size={28} />
</div>
}

View File

@@ -6,11 +6,11 @@ const messages = defineMessages({
emoji: { id: 'emoji_button.label', defaultMessage: 'Insert emoji' },
})
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
active: state.getIn(['popover', 'popoverType']) === 'EMOJI_PICKER',
})
const mapDispatchToProps = dispatch => ({
const mapDispatchToProps = (dispatch) => ({
onClick(targetRef) {
dispatch(openPopover('EMOJI_PICKER', {

View File

@@ -10,7 +10,7 @@ const messages = defineMessages({
})
const makeMapStateToProps = () => {
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
acceptContentTypes: state.getIn(['media_attachments', 'accept_content_types']),
disabled: state.getIn(['compose', 'is_uploading']) || (state.getIn(['compose', 'media_attachments']).size > 3 || state.getIn(['compose', 'media_attachments']).some(m => m.get('type') === 'video')),
unavailable: state.getIn(['compose', 'poll']) !== null,
@@ -20,10 +20,8 @@ const makeMapStateToProps = () => {
return mapStateToProps
}
const mapDispatchToProps = dispatch => ({
onSelectFile(files) {
dispatch(uploadCompose(files))
},
const mapDispatchToProps = (dispatch) => ({
onSelectFile: (files) => dispatch(uploadCompose(files)),
})
export default

View File

@@ -22,7 +22,7 @@ const mapStateToProps = (state, { id, otherProps }) => {
}
}
const mapDispatchToProps = dispatch => ({
const mapDispatchToProps = (dispatch) => ({
onUndo: id => {
dispatch(undoUploadCompose(id));

View File

@@ -5,11 +5,9 @@ import Avatar from '../../../../components/avatar';
import Button from '../../../../components/button'
import { me } from '../../../../initial_state';
const mapStateToProps = state => {
return {
account: state.getIn(['accounts', me]),
};
};
const mapStateToProps = (state) => ({
account: state.getIn(['accounts', me]),
})
export default
@connect(mapStateToProps)

View File

@@ -8,12 +8,12 @@ const messages = defineMessages({
remove_poll: { id: 'poll_button.remove_poll', defaultMessage: 'Remove poll' },
})
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
unavailable: state.getIn(['compose', 'is_uploading']) || (state.getIn(['compose', 'media_attachments']).size > 0),
active: state.getIn(['compose', 'poll']) !== null,
})
const mapDispatchToProps = dispatch => ({
const mapDispatchToProps = (dispatch) => ({
onClick() {
dispatch((_, getState) => {

View File

@@ -12,7 +12,7 @@ const mapStateToProps = (state) => ({
active: state.getIn(['compose', 'rte_controls_visible']),
})
const mapDispatchToProps = dispatch => ({
const mapDispatchToProps = (dispatch) => ({
onClick (status) {
dispatch(changeRichTextEditorControlsVisibility(status))

View File

@@ -10,11 +10,11 @@ const messages = defineMessages({
schedule_status: { id: 'schedule_status.title', defaultMessage: 'Schedule' },
})
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
isPro: state.getIn(['accounts', me, 'is_pro']),
})
const mapDispatchToProps = dispatch => ({
const mapDispatchToProps = (dispatch) => ({
onOpenDatePickerPopover(targetRef) {
dispatch(openPopover('DATE_PICKER', {
targetRef,

View File

@@ -10,8 +10,7 @@ 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'
import Account from '../../../../components/account'
export default class SearchResults extends ImmutablePureComponent {
@@ -65,7 +64,7 @@ export default class SearchResults extends ImmutablePureComponent {
</div>
{
results.get('accounts').slice(0, size).map(accountId => <AccountContainer expanded key={accountId} id={accountId} />)
results.get('accounts').slice(0, size).map(accountId => <Account expanded key={accountId} id={accountId} />)
}
</div>
);

View File

@@ -6,12 +6,12 @@ const messages = defineMessages({
markAsSensitive: { id: 'compose_form.sensitive.hide', defaultMessage: 'Mark media as sensitive' },
})
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
active: state.getIn(['compose', 'sensitive']),
disabled: state.getIn(['compose', 'spoiler']),
})
const mapDispatchToProps = dispatch => ({
const mapDispatchToProps = (dispatch) => ({
onClick () {
dispatch(changeComposeSensitivity())

View File

@@ -12,7 +12,7 @@ const mapStateToProps = (state) => ({
active: state.getIn(['compose', 'spoiler']),
})
const mapDispatchToProps = dispatch => ({
const mapDispatchToProps = (dispatch) => ({
onClick () {
dispatch(changeComposeSpoilerness())

View File

@@ -4,7 +4,7 @@ import ProgressBar from '../../../../components/progress_bar'
import Upload from '../media_upload_item'
import SensitiveMediaButton from '../sensitive_media_button'
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
mediaIds: state.getIn(['compose', 'media_attachments']).map(item => item.get('id')),
isUploading: state.getIn(['compose', 'is_uploading']),
uploadProgress: state.getIn(['compose', 'progress']),

View File

@@ -20,7 +20,7 @@ const messages = defineMessages({
home_timeline: { id: 'tabs_bar.home', defaultMessage: 'Home' },
notifications: { id: 'tabs_bar.notifications', defaultMessage: 'Notifications' },
public: { id: 'navigation_bar.public_timeline', defaultMessage: 'Federated timeline' },
community: { id: 'navigation_bar.community_timeline', defaultMessage: 'Local timeline' },
community: { id: 'navigation_bar.community_timeline', defaultMessage: 'Community timeline' },
preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },
compose: { id: 'navigation_bar.compose', defaultMessage: 'Compose new gab' },

View File

@@ -6,14 +6,14 @@ import {
selectComposeSuggestion,
} from '../../../actions/compose';
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
suggestions: state.getIn(['compose', 'suggestions']),
options: state.getIn(['compose', 'poll', 'options']),
expiresIn: state.getIn(['compose', 'poll', 'expires_in']),
isMultiple: state.getIn(['compose', 'poll', 'multiple']),
});
const mapDispatchToProps = dispatch => ({
const mapDispatchToProps = (dispatch) => ({
onAddOption(title) {
dispatch(addPollOption(title));
},

View File

@@ -2,12 +2,12 @@ import SearchResults from '../components/search_results';
import { fetchSuggestions, dismissSuggestion } from '../../../actions/suggestions';
import { withRouter } from 'react-router-dom';
const mapStateToProps = state => ({
const mapStateToProps = (state) => ({
results: state.getIn(['search', 'results']),
suggestions: state.getIn(['suggestions', 'items']),
});
const mapDispatchToProps = dispatch => ({
const mapDispatchToProps = (dispatch) => ({
fetchSuggestions: () => dispatch(fetchSuggestions()),
dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),
});