update eslint's comma-dangle rule to always-multiline (#1457)

* update eslint's `comma-dangle` rule to `always-multiline`

* add check and fix scripts to package.json

* Invoke `yarn fix` to adopt the updated eslint rules. No other changes are included.
This commit is contained in:
Jesse Hallam 2018-02-23 09:06:02 -05:00 committed by Harrison Healey
parent 4b3bc57643
commit 58b72302d6
411 changed files with 3944 additions and 3942 deletions

View file

@ -40,7 +40,7 @@
"brace-style": [2, "1tbs", { "allowSingleLine": false }],
"camelcase": [2, {"properties": "never"}],
"class-methods-use-this": 0,
"comma-dangle": [2, "never"],
"comma-dangle": [2, "always-multiline"],
"comma-spacing": [2, {"before": false, "after": true}],
"comma-style": [2, "last"],
"complexity": [1, 10],

View file

@ -47,7 +47,7 @@ pre-run: | .yarninstall .podinstall dist/assets ## Installs dependencies and ass
check-style: .yarninstall ## Runs eslint
@echo Checking for style guide compliance
@node_modules/.bin/eslint --ext \".js\" --ignore-pattern node_modules --quiet .
@yarn run check
clean: ## Cleans dependencies, previous builds and temp files
@echo Cleaning started

View file

@ -11,8 +11,8 @@ export function calculateDeviceDimensions() {
type: DeviceTypes.DEVICE_DIMENSIONS_CHANGED,
data: {
deviceHeight: height,
deviceWidth: width
}
deviceWidth: width,
},
};
}
@ -20,7 +20,7 @@ export function connection(isOnline) {
return async (dispatch, getState) => {
dispatch({
type: DeviceTypes.CONNECTION_CHANGED,
data: isOnline
data: isOnline,
}, getState);
};
}
@ -28,21 +28,21 @@ export function connection(isOnline) {
export function setStatusBarHeight(height = 20) {
return {
type: DeviceTypes.STATUSBAR_HEIGHT_CHANGED,
data: height
data: height,
};
}
export function setDeviceOrientation(orientation) {
return {
type: DeviceTypes.DEVICE_ORIENTATION_CHANGED,
data: orientation
data: orientation,
};
}
export function setDeviceAsTablet() {
return {
type: DeviceTypes.DEVICE_TYPE_CHANGED,
data: true
data: true,
};
}
@ -51,5 +51,5 @@ export default {
connection,
setDeviceOrientation,
setDeviceAsTablet,
setStatusBarHeight
setStatusBarHeight,
};

View file

@ -19,7 +19,7 @@ export function handleUpdateUserNotifyProps(notifyProps) {
user_id: userId,
category: Preferences.CATEGORY_NOTIFICATIONS,
name: Preferences.EMAIL_INTERVAL,
value: interval
value: interval,
}];
savePreferences(currentUserId, emailInterval)(dispatch, getState);

View file

@ -6,6 +6,6 @@ import {ViewTypes} from 'app/constants';
export function dismissBanner(text) {
return {
type: ViewTypes.ANNOUNCEMENT_BANNER,
data: text
data: text,
};
}

View file

@ -10,7 +10,7 @@ import {
fetchMyChannelsAndMembers,
markChannelAsRead,
selectChannel,
leaveChannel as serviceLeaveChannel
leaveChannel as serviceLeaveChannel,
} from 'mattermost-redux/actions/channels';
import {getPosts, getPostsBefore, getPostsSince, getPostThread} from 'mattermost-redux/actions/posts';
import {getFilesForPost} from 'mattermost-redux/actions/files';
@ -25,7 +25,7 @@ import {
getDirectChannelName,
getUserIdFromChannelName,
isDirectChannel,
isGroupChannel
isGroupChannel,
} from 'mattermost-redux/utils/channel_utils';
import {getLastCreateAt} from 'mattermost-redux/utils/post_utils';
import {getPreferencesByCategory} from 'mattermost-redux/utils/preference_utils';
@ -58,7 +58,7 @@ export function loadProfilesAndTeamMembersForDMSidebar(teamId) {
user_id: currentUserId,
category: Preferences.CATEGORY_DIRECT_CHANNEL_SHOW,
name,
value: 'true'
value: 'true',
};
}
@ -130,7 +130,7 @@ export function loadProfilesAndTeamMembersForDMSidebar(teamId) {
actions.push({
type: UserTypes.RECEIVED_PROFILE_IN_CHANNEL,
data: {user_id: members[i]},
id: channel.id
id: channel.id,
});
}
}
@ -184,7 +184,7 @@ export function loadPostsIfNecessaryWithRetry(channelId) {
dispatch({
type: ViewTypes.RECEIVED_POSTS_FOR_CHANNEL_AT_TIME,
channelId,
time
time,
});
}
@ -285,14 +285,14 @@ export function handleSelectChannel(channelId) {
dispatch(batchActions([
{
type: ViewTypes.SET_INITIAL_POST_VISIBILITY,
data: channelId
data: channelId,
},
setChannelLoading(false),
{
type: ViewTypes.SET_LAST_CHANNEL_FOR_TEAM,
teamId: currentTeamId,
channelId
}
channelId,
},
]));
};
}
@ -302,7 +302,7 @@ export function handlePostDraftChanged(channelId, draft) {
dispatch({
type: ViewTypes.POST_DRAFT_CHANGED,
channelId,
draft
draft,
}, getState);
};
}
@ -311,7 +311,7 @@ export function handlePostDraftSelectionChanged(channelId, cursorPosition) {
return {
type: ViewTypes.POST_DRAFT_SELECTION_CHANGED,
channelId,
cursorPosition
cursorPosition,
};
}
@ -330,7 +330,7 @@ export function insertToDraft(value) {
cursorPosition = threadDraft.cursorPosition;
action = {
type: ViewTypes.COMMENT_DRAFT_CHANGED,
rootId: threadId
rootId: threadId,
};
} else if (state.views.channel.drafts[channelId]) {
const channelDraft = state.views.channel.drafts[channelId];
@ -338,7 +338,7 @@ export function insertToDraft(value) {
cursorPosition = channelDraft.cursorPosition;
action = {
type: ViewTypes.POST_DRAFT_CHANGED,
channelId
channelId,
};
}
@ -352,7 +352,7 @@ export function insertToDraft(value) {
if (action && nextDraft !== draft) {
dispatch({
...action,
draft: nextDraft
draft: nextDraft,
});
}
};
@ -367,7 +367,7 @@ export function toggleDMChannel(otherUserId, visible) {
user_id: currentUserId,
category: Preferences.CATEGORY_DIRECT_CHANNEL_SHOW,
name: otherUserId,
value: visible
value: visible,
}];
savePreferences(currentUserId, dm)(dispatch, getState);
@ -383,7 +383,7 @@ export function toggleGMChannel(channelId, visible) {
user_id: currentUserId,
category: Preferences.CATEGORY_GROUP_CHANNEL_SHOW,
name: channelId,
value: visible
value: visible,
}];
savePreferences(currentUserId, gm)(dispatch, getState);
@ -436,28 +436,28 @@ export function leaveChannel(channel, reset = false) {
export function setChannelLoading(loading = true) {
return {
type: ViewTypes.SET_CHANNEL_LOADER,
loading
loading,
};
}
export function setChannelRefreshing(loading = true) {
return {
type: ViewTypes.SET_CHANNEL_REFRESHING,
loading
loading,
};
}
export function setChannelRetryFailed(failed = true) {
return {
type: ViewTypes.SET_CHANNEL_RETRY_FAILED,
failed
failed,
};
}
export function setChannelDisplayName(displayName) {
return {
type: ViewTypes.SET_CHANNEL_DISPLAY_NAME,
displayName
displayName,
};
}
@ -482,7 +482,7 @@ export function increasePostVisibility(channelId, focusedPostId) {
// We already have the posts, so we just need to show them
dispatch(batchActions([
doIncreasePostVisibility(channelId),
setLoadMorePostsVisible(true)
setLoadMorePostsVisible(true),
]));
return;
@ -492,7 +492,7 @@ export function increasePostVisibility(channelId, focusedPostId) {
dispatch({
type: ViewTypes.LOADING_POSTS,
data: true,
channelId
channelId,
});
const pageSize = ViewTypes.POST_VISIBILITY_CHUNK_SIZE;
@ -508,7 +508,7 @@ export function increasePostVisibility(channelId, focusedPostId) {
const actions = [{
type: ViewTypes.LOADING_POSTS,
data: false,
channelId
channelId,
}];
const posts = result.data;
@ -528,13 +528,13 @@ function doIncreasePostVisibility(channelId) {
return {
type: ViewTypes.INCREASE_POST_VISIBILITY,
data: channelId,
amount: ViewTypes.POST_VISIBILITY_CHUNK_SIZE
amount: ViewTypes.POST_VISIBILITY_CHUNK_SIZE,
};
}
function setLoadMorePostsVisible(visible) {
return {
type: ViewTypes.SET_LOAD_MORE_POSTS_VISIBLE,
data: visible
data: visible,
};
}

View file

@ -5,6 +5,6 @@ import {ViewTypes} from 'app/constants';
export function setLastUpgradeCheck() {
return {
type: ViewTypes.SET_LAST_UPGRADE_CHECK
type: ViewTypes.SET_LAST_UPGRADE_CHECK,
};
}

View file

@ -14,7 +14,7 @@ export function executeCommand(message, channelId, rootId) {
channel_id: channelId,
team_id: teamId,
root_id: rootId,
parent_id: rootId
parent_id: rootId,
};
let msg = message;

View file

@ -18,7 +18,7 @@ export function handleCreateChannel(displayName, purpose, header, type) {
display_name: displayName,
purpose,
header,
type
type,
};
const {data} = await createChannel(channel, currentUserId)(dispatch, getState);

View file

@ -29,14 +29,14 @@ export function addReactionToLatestPost(emoji, rootId) {
export function addRecentEmoji(emoji) {
return {
type: ViewTypes.ADD_RECENT_EMOJI,
emoji
emoji,
};
}
export function incrementEmojiPickerPage() {
return async (dispatch) => {
dispatch({
type: ViewTypes.INCREMENT_EMOJI_PICKER_PAGE
type: ViewTypes.INCREMENT_EMOJI_PICKER_PAGE,
});
return {data: true};

View file

@ -6,6 +6,6 @@ import {ViewTypes} from 'app/constants';
export function addFileToFetchCache(url) {
return {
type: ViewTypes.ADD_FILE_TO_FETCH_CACHE,
url
url,
};
}

View file

@ -7,7 +7,7 @@ import {uploadFile} from 'mattermost-redux/actions/files';
import {
buildFileUploadData,
encodeHeaderURIStringToUTF8,
generateId
generateId,
} from 'app/utils/file';
import {ViewTypes} from 'app/constants';
@ -28,7 +28,7 @@ export function handleUploadFiles(files, rootId) {
localPath: fileData.uri,
name: fileData.name,
type: fileData.mimeType,
extension: fileData.extension
extension: fileData.extension,
});
fileData.name = encodeHeaderURIStringToUTF8(file.fileName);
@ -46,7 +46,7 @@ export function handleUploadFiles(files, rootId) {
type: ViewTypes.SET_TEMP_UPLOAD_FILES_FOR_POST_DRAFT,
clientIds,
channelId,
rootId
rootId,
});
const clientIdsArray = clientIds.map((c) => c.clientId);
@ -64,7 +64,7 @@ export function retryFileUpload(file, rootId) {
const fileData = {
uri: file.localPath,
name: file.name,
type: file.type
type: file.type,
};
fileData.name = encodeHeaderURIStringToUTF8(file.fileName);
@ -81,7 +81,7 @@ export function retryFileUpload(file, rootId) {
type: ViewTypes.RETRY_UPLOAD_FILE_FOR_POST,
clientId: file.clientId,
channelId,
rootId
rootId,
});
await uploadFile(channelId, rootId, [file.clientId], formData, formBoundary)(dispatch, getState);
@ -92,7 +92,7 @@ export function handleClearFiles(channelId, rootId) {
return {
type: ViewTypes.CLEAR_FILES_FOR_POST_DRAFT,
channelId,
rootId
rootId,
};
}
@ -100,7 +100,7 @@ export function handleClearFailedFiles(channelId, rootId) {
return {
type: ViewTypes.CLEAR_FAILED_FILES_FOR_POST_DRAFT,
channelId,
rootId
rootId,
};
}
@ -109,7 +109,7 @@ export function handleRemoveFile(clientId, channelId, rootId) {
type: ViewTypes.REMOVE_FILE_FROM_POST_DRAFT,
clientId,
channelId,
rootId
rootId,
};
}
@ -117,6 +117,6 @@ export function handleRemoveLastFile(channelId, rootId) {
return {
type: ViewTypes.REMOVE_LAST_FILE_FROM_POST_DRAFT,
channelId,
rootId
rootId,
};
}

View file

@ -11,7 +11,7 @@ export function handleLoginIdChanged(loginId) {
return async (dispatch, getState) => {
dispatch({
type: ViewTypes.LOGIN_ID_CHANGED,
loginId
loginId,
}, getState);
};
}
@ -20,7 +20,7 @@ export function handlePasswordChanged(password) {
return async (dispatch, getState) => {
dispatch({
type: ViewTypes.PASSWORD_CHANGED,
password
password,
}, getState);
};
}
@ -35,8 +35,8 @@ export function handleSuccessfulLogin() {
type: GeneralTypes.RECEIVED_APP_CREDENTIALS,
data: {
url,
token
}
token,
},
}, getState);
if (config.DataRetentionEnableMessageDeletion && config.DataRetentionEnableMessageDeletion === 'true' &&
@ -73,5 +73,5 @@ export default {
handleLoginIdChanged,
handlePasswordChanged,
handleSuccessfulLogin,
getSession
getSession,
};

View file

@ -14,7 +14,7 @@ import {recordTime} from 'app/utils/segment';
import {
handleSelectChannel,
setChannelDisplayName,
retryGetPostsAction
retryGetPostsAction,
} from 'app/actions/views/channel';
export function loadConfigAndLicense() {
@ -22,7 +22,7 @@ export function loadConfigAndLicense() {
const {currentUserId} = getState().entities.users;
const [configData, licenseData] = await Promise.all([
getClientConfig()(dispatch, getState),
getLicenseConfig()(dispatch, getState)
getLicenseConfig()(dispatch, getState),
]);
const config = configData.data || {};
@ -56,7 +56,7 @@ export function loadFromPushNotification(notification) {
if (teamId && (!teams[teamId] || !myTeamMembers[teamId])) {
await Promise.all([
getMyTeams()(dispatch, getState),
getMyTeamMembers()(dispatch, getState)
getMyTeamMembers()(dispatch, getState),
]);
}
@ -95,7 +95,7 @@ export function createPost(post) {
...post,
pending_post_id: pendingPostId,
create_at: timestamp,
update_at: timestamp
update_at: timestamp,
};
return Client4.createPost({...newPost, create_at: 0}).then((payload) => {
@ -104,10 +104,10 @@ export function createPost(post) {
data: {
order: [],
posts: {
[payload.id]: payload
}
[payload.id]: payload,
},
},
channelId: payload.channel_id
channelId: payload.channel_id,
});
});
};
@ -124,5 +124,5 @@ export function recordLoadTime(screenName, category) {
export default {
loadConfigAndLicense,
loadFromPushNotification,
purgeOfflineStore
purgeOfflineStore,
};

View file

@ -7,7 +7,7 @@ export function handleSearchDraftChanged(text) {
return async (dispatch, getState) => {
dispatch({
type: ViewTypes.SEARCH_DRAFT_CHANGED,
text
text,
}, getState);
};
}

View file

@ -11,11 +11,11 @@ export function handleServerUrlChanged(serverUrl) {
dispatch(batchActions([
{type: GeneralTypes.CLIENT_CONFIG_RESET},
{type: GeneralTypes.CLIENT_LICENSE_RESET},
{type: ViewTypes.SERVER_URL_CHANGED, serverUrl}
{type: ViewTypes.SERVER_URL_CHANGED, serverUrl},
]), getState);
};
}
export default {
handleServerUrlChanged
handleServerUrlChanged,
};

View file

@ -22,7 +22,7 @@ export function handleTeamChange(teamId, selectChannel = true) {
const actions = [
setChannelDisplayName(''),
{type: TeamTypes.SELECT_TEAM, data: teamId}
{type: TeamTypes.SELECT_TEAM, data: teamId},
];
if (selectChannel) {
@ -55,5 +55,5 @@ export function selectFirstAvailableTeam() {
export default {
handleTeamChange,
selectFirstAvailableTeam
selectFirstAvailableTeam,
};

View file

@ -8,7 +8,7 @@ export function handleCommentDraftChanged(rootId, draft) {
dispatch({
type: ViewTypes.COMMENT_DRAFT_CHANGED,
rootId,
draft
draft,
}, getState);
};
}
@ -17,6 +17,6 @@ export function handleCommentDraftSelectionChanged(rootId, cursorPosition) {
return {
type: ViewTypes.COMMENT_DRAFT_SELECTION_CHANGED,
rootId,
cursorPosition
cursorPosition,
};
}

View file

@ -8,7 +8,7 @@ import {
Animated,
StyleSheet,
Text,
TouchableOpacity
TouchableOpacity,
} from 'react-native';
import {intlShape} from 'react-intl';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
@ -18,22 +18,22 @@ const {View: AnimatedView} = Animated;
export default class AnnouncementBanner extends PureComponent {
static propTypes = {
actions: PropTypes.shape({
dismissBanner: PropTypes.func.isRequired
dismissBanner: PropTypes.func.isRequired,
}).isRequired,
allowDismissal: PropTypes.bool,
bannerColor: PropTypes.string,
bannerDismissed: PropTypes.bool,
bannerEnabled: PropTypes.bool,
bannerText: PropTypes.string,
bannerTextColor: PropTypes.string
bannerTextColor: PropTypes.string,
};
static contextTypes = {
intl: intlShape
intl: intlShape,
};
state = {
bannerHeight: new Animated.Value(0)
bannerHeight: new Animated.Value(0),
};
componentWillMount() {
@ -59,13 +59,13 @@ export default class AnnouncementBanner extends PureComponent {
handlePress = () => {
const {formatMessage} = this.context.intl;
const options = [{
text: formatMessage({id: 'mobile.announcement_banner.ok', defaultMessage: 'OK'})
text: formatMessage({id: 'mobile.announcement_banner.ok', defaultMessage: 'OK'}),
}];
if (this.props.allowDismissal) {
options.push({
text: formatMessage({id: 'mobile.announcement_banner.dismiss', defaultMessage: 'Dismiss'}),
onPress: this.handleDismiss
onPress: this.handleDismiss,
});
}
@ -81,7 +81,7 @@ export default class AnnouncementBanner extends PureComponent {
const value = show ? 38 : 0;
Animated.timing(this.state.bannerHeight, {
toValue: value,
duration: 350
duration: 350,
}).start();
};
@ -90,11 +90,11 @@ export default class AnnouncementBanner extends PureComponent {
const bannerStyle = {
backgroundColor: this.props.bannerColor,
height: bannerHeight
height: bannerHeight,
};
const bannerTextStyle = {
color: this.props.bannerTextColor
color: this.props.bannerTextColor,
};
return (
@ -129,16 +129,16 @@ const style = StyleSheet.create({
position: 'absolute',
top: 0,
overflow: 'hidden',
width: '100%'
width: '100%',
},
wrapper: {
alignItems: 'center',
flex: 1,
flexDirection: 'row'
flexDirection: 'row',
},
bannerText: {
flex: 1,
fontSize: 14,
marginRight: 5
}
marginRight: 5,
},
});

View file

@ -21,15 +21,15 @@ function mapStateToProps(state) {
bannerDismissed: config.BannerText === announcement,
bannerEnabled: config.EnableBanner === 'true' && license.IsLicensed === 'true',
bannerText: config.BannerText,
bannerTextColor: config.BannerTextColor
bannerTextColor: config.BannerTextColor,
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
dismissBanner
}, dispatch)
dismissBanner,
}, dispatch),
};
}

View file

@ -5,14 +5,14 @@ import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import Svg, {
G,
Path
Path,
} from 'react-native-svg';
export default class AwayStatus extends PureComponent {
static propTypes = {
width: PropTypes.number.isRequired,
height: PropTypes.number.isRequired,
color: PropTypes.string.isRequired
color: PropTypes.string.isRequired,
};
render() {

View file

@ -19,11 +19,11 @@ export default class AtMention extends React.PureComponent {
onPostPress: PropTypes.func,
textStyle: CustomPropTypes.Style,
theme: PropTypes.object.isRequired,
usersByUsername: PropTypes.object.isRequired
usersByUsername: PropTypes.object.isRequired,
};
static contextTypes = {
intl: intlShape
intl: intlShape,
}
constructor(props) {
@ -32,7 +32,7 @@ export default class AtMention extends React.PureComponent {
const userDetails = this.getUserDetailsFromMentionName(props);
this.state = {
username: userDetails.username,
id: userDetails.id
id: userDetails.id,
};
}
@ -41,7 +41,7 @@ export default class AtMention extends React.PureComponent {
const userDetails = this.getUserDetailsFromMentionName(nextProps);
this.setState({
username: userDetails.username,
id: userDetails.id
id: userDetails.id,
});
}
}
@ -56,14 +56,14 @@ export default class AtMention extends React.PureComponent {
animated: true,
backButtonTitle: '',
passProps: {
userId: this.state.id
userId: this.state.id,
},
navigatorStyle: {
navBarTextColor: theme.sidebarHeaderTextColor,
navBarBackgroundColor: theme.sidebarHeaderBg,
navBarButtonColor: theme.sidebarHeaderTextColor,
screenBackgroundColor: theme.centerChannelBg
}
screenBackgroundColor: theme.centerChannelBg,
},
});
};
@ -75,7 +75,7 @@ export default class AtMention extends React.PureComponent {
const user = props.usersByUsername[mentionName];
return {
username: user.username,
id: user.id
id: user.id,
};
}
@ -88,7 +88,7 @@ export default class AtMention extends React.PureComponent {
}
return {
username: ''
username: '',
};
}
@ -102,9 +102,9 @@ export default class AtMention extends React.PureComponent {
action = {
text: intl.formatMessage({
id: 'mobile.mention.copy_mention',
defaultMessage: 'Copy Mention'
defaultMessage: 'Copy Mention',
}),
onPress: this.handleCopyMention
onPress: this.handleCopyMention,
};
}

View file

@ -12,7 +12,7 @@ import AtMention from './at_mention';
function mapStateToProps(state) {
return {
theme: getTheme(state),
usersByUsername: getUsersByUsername(state)
usersByUsername: getUsersByUsername(state),
};
}

View file

@ -4,7 +4,7 @@ import {injectIntl, intlShape} from 'react-intl';
import {
Platform,
StyleSheet,
TouchableOpacity
TouchableOpacity,
} from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
import ImagePicker from 'react-native-image-picker';
@ -22,11 +22,11 @@ class AttachmentButton extends PureComponent {
onShowFileMaxWarning: PropTypes.func,
theme: PropTypes.object.isRequired,
uploadFiles: PropTypes.func.isRequired,
wrapper: PropTypes.bool
wrapper: PropTypes.bool,
};
static defaultProps = {
maxFileCount: 5
maxFileCount: 5,
};
attachFileFromCamera = () => {
@ -36,23 +36,23 @@ class AttachmentButton extends PureComponent {
noData: true,
storageOptions: {
cameraRoll: true,
waitUntilSaved: true
waitUntilSaved: true,
},
permissionDenied: {
title: formatMessage({
id: 'mobile.android.camera_permission_denied_title',
defaultMessage: 'Camera access is required'
defaultMessage: 'Camera access is required',
}),
text: formatMessage({
id: 'mobile.android.camera_permission_denied_description',
defaultMessage: 'To take photos and videos with your camera, please change your permission settings.'
defaultMessage: 'To take photos and videos with your camera, please change your permission settings.',
}),
reTryTitle: formatMessage({
id: 'mobile.android.permission_denied_retry',
defaultMessage: 'Set Permission'
defaultMessage: 'Set Permission',
}),
okTitle: formatMessage({id: 'mobile.android.permission_denied_dismiss', defaultMessage: 'Dismiss'})
}
okTitle: formatMessage({id: 'mobile.android.permission_denied_dismiss', defaultMessage: 'Dismiss'}),
},
};
ImagePicker.launchCamera(options, (response) => {
@ -72,18 +72,18 @@ class AttachmentButton extends PureComponent {
permissionDenied: {
title: formatMessage({
id: 'mobile.android.photos_permission_denied_title',
defaultMessage: 'Photo library access is required'
defaultMessage: 'Photo library access is required',
}),
text: formatMessage({
id: 'mobile.android.photos_permission_denied_description',
defaultMessage: 'To upload images from your library, please change your permission settings.'
defaultMessage: 'To upload images from your library, please change your permission settings.',
}),
reTryTitle: formatMessage({
id: 'mobile.android.permission_denied_retry',
defaultMessage: 'Set Permission'
defaultMessage: 'Set Permission',
}),
okTitle: formatMessage({id: 'mobile.android.permission_denied_dismiss', defaultMessage: 'Dismiss'})
}
okTitle: formatMessage({id: 'mobile.android.permission_denied_dismiss', defaultMessage: 'Dismiss'}),
},
};
if (Platform.OS === 'ios') {
@ -108,18 +108,18 @@ class AttachmentButton extends PureComponent {
permissionDenied: {
title: formatMessage({
id: 'mobile.android.videos_permission_denied_title',
defaultMessage: 'Video library access is required'
defaultMessage: 'Video library access is required',
}),
text: formatMessage({
id: 'mobile.android.videos_permission_denied_description',
defaultMessage: 'To upload videos from your library, please change your permission settings.'
defaultMessage: 'To upload videos from your library, please change your permission settings.',
}),
reTryTitle: formatMessage({
id: 'mobile.android.permission_denied_retry',
defaultMessage: 'Set Permission'
defaultMessage: 'Set Permission',
}),
okTitle: formatMessage({id: 'mobile.android.permission_denied_dismiss', defaultMessage: 'Dismiss'})
}
okTitle: formatMessage({id: 'mobile.android.permission_denied_dismiss', defaultMessage: 'Dismiss'}),
},
};
ImagePicker.launchImageLibrary(options, (response) => {
@ -137,7 +137,7 @@ class AttachmentButton extends PureComponent {
handleFileAttachmentOption = (action) => {
this.props.navigator.dismissModal({
animationType: 'none'
animationType: 'none',
});
// Have to wait to launch the library attachment action.
@ -164,17 +164,17 @@ class AttachmentButton extends PureComponent {
action: () => this.handleFileAttachmentOption(this.attachFileFromCamera),
text: {
id: 'mobile.file_upload.camera',
defaultMessage: 'Take Photo or Video'
defaultMessage: 'Take Photo or Video',
},
icon: 'camera'
icon: 'camera',
}, {
action: () => this.handleFileAttachmentOption(this.attachFileFromLibrary),
text: {
id: 'mobile.file_upload.library',
defaultMessage: 'Photo Library'
defaultMessage: 'Photo Library',
},
icon: 'photo'
}]
icon: 'photo',
}],
};
if (Platform.OS === 'android') {
@ -182,9 +182,9 @@ class AttachmentButton extends PureComponent {
action: () => this.handleFileAttachmentOption(this.attachVideoFromLibraryAndroid),
text: {
id: 'mobile.file_upload.video',
defaultMessage: 'Video Library'
defaultMessage: 'Video Library',
},
icon: 'file-video-o'
icon: 'file-video-o',
});
}
@ -193,15 +193,15 @@ class AttachmentButton extends PureComponent {
title: '',
animationType: 'none',
passProps: {
items: options.items
items: options.items,
},
navigatorStyle: {
navBarHidden: true,
statusBarHidden: false,
statusBarHideWithNavBar: false,
screenBackgroundColor: 'transparent',
modalPresentationStyle: 'overCurrentContext'
}
modalPresentationStyle: 'overCurrentContext',
},
});
};
@ -238,18 +238,18 @@ const style = StyleSheet.create({
attachIcon: {
marginTop: Platform.select({
ios: 2,
android: 0
})
android: 0,
}),
},
buttonContainer: {
height: Platform.select({
ios: 34,
android: 36
android: 36,
}),
width: 45,
alignItems: 'center',
justifyContent: 'center'
}
justifyContent: 'center',
},
});
export default injectIntl(AttachmentButton);

View file

@ -17,7 +17,7 @@ import {makeStyleSheetFromTheme} from 'app/utils/theme';
export default class AtMention extends PureComponent {
static propTypes = {
actions: PropTypes.shape({
autocompleteUsers: PropTypes.func.isRequired
autocompleteUsers: PropTypes.func.isRequired,
}).isRequired,
currentChannelId: PropTypes.string,
currentTeamId: PropTypes.string.isRequired,
@ -33,20 +33,20 @@ export default class AtMention extends PureComponent {
requestStatus: PropTypes.string.isRequired,
teamMembers: PropTypes.array,
theme: PropTypes.object.isRequired,
value: PropTypes.string
value: PropTypes.string,
};
static defaultProps = {
defaultChannel: {},
isSearch: false,
value: ''
value: '',
};
constructor(props) {
super(props);
this.state = {
sections: []
sections: [],
};
}
@ -56,7 +56,7 @@ export default class AtMention extends PureComponent {
// if the term changes but is null or the mention has been completed we render this component as null
this.setState({
mentionComplete: false,
sections: []
sections: [],
});
this.props.onResultCountChange(0);
@ -84,7 +84,7 @@ export default class AtMention extends PureComponent {
id: 'mobile.suggestion.members',
defaultMessage: 'Members',
data: teamMembers,
key: 'teamMembers'
key: 'teamMembers',
});
} else {
if (inChannel.length) {
@ -92,7 +92,7 @@ export default class AtMention extends PureComponent {
id: 'suggestion.mention.members',
defaultMessage: 'Channel Members',
data: inChannel,
key: 'inChannel'
key: 'inChannel',
});
}
@ -102,7 +102,7 @@ export default class AtMention extends PureComponent {
defaultMessage: 'Special Mentions',
data: this.getSpecialMentions(),
key: 'special',
renderItem: this.renderSpecialMentions
renderItem: this.renderSpecialMentions,
});
}
@ -111,13 +111,13 @@ export default class AtMention extends PureComponent {
id: 'suggestion.mention.nonmembers',
defaultMessage: 'Not in Channel',
data: outChannel,
key: 'outChannel'
key: 'outChannel',
});
}
}
this.setState({
sections
sections,
});
this.props.onResultCountChange(sections.reduce((total, section) => total + section.data.length, 0));
@ -134,16 +134,16 @@ export default class AtMention extends PureComponent {
id: 'suggestion.mention.all',
defaultMessage: 'Notifies everyone in the channel, use in {townsquare} to notify the whole team',
values: {
townsquare: this.props.defaultChannel.display_name
}
townsquare: this.props.defaultChannel.display_name,
},
}, {
completeHandle: 'channel',
id: 'suggestion.mention.channel',
defaultMessage: 'Notifies everyone in the channel'
defaultMessage: 'Notifies everyone in the channel',
}, {
completeHandle: 'here',
id: 'suggestion.mention.here',
defaultMessage: 'Notifies everyone in the channel and online'
defaultMessage: 'Notifies everyone in the channel and online',
}];
};
@ -232,10 +232,10 @@ export default class AtMention extends PureComponent {
const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
return {
listView: {
backgroundColor: theme.centerChannelBg
backgroundColor: theme.centerChannelBg,
},
search: {
minHeight: 125
}
minHeight: 125,
},
};
});

View file

@ -12,7 +12,7 @@ import {
filterMembersInChannel,
filterMembersNotInChannel,
filterMembersInCurrentTeam,
getMatchTermForAtMention
getMatchTermForAtMention,
} from 'app/selectors/autocomplete';
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
@ -44,15 +44,15 @@ function mapStateToProps(state, ownProps) {
inChannel,
outChannel,
requestStatus: state.requests.users.autocompleteUsers.status,
theme: getTheme(state)
theme: getTheme(state),
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
autocompleteUsers
}, dispatch)
autocompleteUsers,
}, dispatch),
};
}

View file

@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import {
Text,
TouchableOpacity,
View
View,
} from 'react-native';
import ProfilePicture from 'app/components/profile_picture';
@ -19,7 +19,7 @@ export default class AtMentionItem extends PureComponent {
onPress: PropTypes.func.isRequired,
userId: PropTypes.string.isRequired,
username: PropTypes.string,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
completeMention = () => {
@ -33,7 +33,7 @@ export default class AtMentionItem extends PureComponent {
lastName,
userId,
username,
theme
theme,
} = this.props;
const style = getStyleFromTheme(theme);
@ -67,21 +67,21 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
paddingVertical: 8,
flexDirection: 'row',
alignItems: 'center',
backgroundColor: theme.centerChannelBg
backgroundColor: theme.centerChannelBg,
},
rowPicture: {
marginHorizontal: 8,
width: 20,
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
rowUsername: {
fontSize: 13,
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
rowFullname: {
color: theme.centerChannelColor,
opacity: 0.6
}
opacity: 0.6,
},
};
});

View file

@ -16,7 +16,7 @@ function mapStateToProps(state, ownProps) {
firstName: user.first_name,
lastName: user.last_name,
username: user.username,
theme: getTheme(state)
theme: getTheme(state),
};
}

View file

@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import {
Keyboard,
Platform,
View
View,
} from 'react-native';
import DeviceInfo from 'react-native-device-info';
@ -24,11 +24,11 @@ export default class Autocomplete extends PureComponent {
rootId: PropTypes.string,
isSearch: PropTypes.bool,
theme: PropTypes.object.isRequired,
value: PropTypes.string
value: PropTypes.string,
};
static defaultProps = {
isSearch: false
isSearch: false,
};
state = {
@ -37,12 +37,12 @@ export default class Autocomplete extends PureComponent {
channelMentionCount: 0,
emojiCount: 0,
commandCount: 0,
keyboardOffset: 0
keyboardOffset: 0,
};
handleSelectionChange = (event) => {
this.setState({
cursorPosition: event.nativeEvent.selection.end
cursorPosition: event.nativeEvent.selection.end,
});
};
@ -147,34 +147,34 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
left: 0,
overflow: 'hidden',
position: 'absolute',
right: 0
right: 0,
},
borders: {
borderWidth: 1,
borderColor: changeOpacity(theme.centerChannelColor, 0.2),
borderBottomWidth: 0
borderBottomWidth: 0,
},
bordersSearch: {
borderWidth: 1,
borderColor: changeOpacity(theme.centerChannelColor, 0.2)
borderColor: changeOpacity(theme.centerChannelColor, 0.2),
},
container: {
bottom: 0,
maxHeight: 200
maxHeight: 200,
},
content: {
flex: 1
flex: 1,
},
searchContainer: {
flex: 1,
...Platform.select({
android: {
top: 46
top: 46,
},
ios: {
top: 44
}
})
}
top: 44,
},
}),
},
};
});

View file

@ -9,7 +9,7 @@ import {makeStyleSheetFromTheme, changeOpacity} from 'app/utils/theme';
export default class AutocompleteDivider extends PureComponent {
static propTypes = {
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
render() {
@ -26,7 +26,7 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
return {
divider: {
height: 1,
backgroundColor: changeOpacity(theme.centerChannelColor, 0.2)
}
backgroundColor: changeOpacity(theme.centerChannelColor, 0.2),
},
};
});

View file

@ -9,7 +9,7 @@ import AutocompleteDivider from './autocomplete_divider';
function mapStateToProps(state) {
return {
theme: getTheme(state)
theme: getTheme(state),
};
}

View file

@ -12,7 +12,7 @@ export default class AutocompleteSectionHeader extends PureComponent {
static propTypes = {
defaultMessage: PropTypes.string.isRequired,
id: PropTypes.string.isRequired,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
render() {
@ -40,15 +40,15 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
paddingLeft: 8,
backgroundColor: changeOpacity(theme.centerChannelColor, 0.1),
borderTopWidth: 1,
borderTopColor: changeOpacity(theme.centerChannelColor, 0.2)
borderTopColor: changeOpacity(theme.centerChannelColor, 0.2),
},
sectionText: {
fontSize: 12,
color: changeOpacity(theme.centerChannelColor, 0.7),
paddingVertical: 7
paddingVertical: 7,
},
sectionWrapper: {
backgroundColor: theme.centerChannelBg
}
backgroundColor: theme.centerChannelBg,
},
};
});

View file

@ -16,7 +16,7 @@ import {makeStyleSheetFromTheme} from 'app/utils/theme';
export default class ChannelMention extends PureComponent {
static propTypes = {
actions: PropTypes.shape({
searchChannels: PropTypes.func.isRequired
searchChannels: PropTypes.func.isRequired,
}).isRequired,
currentTeamId: PropTypes.string.isRequired,
cursorPosition: PropTypes.number.isRequired,
@ -31,19 +31,19 @@ export default class ChannelMention extends PureComponent {
publicChannels: PropTypes.array,
requestStatus: PropTypes.string.isRequired,
theme: PropTypes.object.isRequired,
value: PropTypes.string
value: PropTypes.string,
};
static defaultProps = {
isSearch: false,
value: ''
value: '',
};
constructor(props) {
super(props);
this.state = {
sections: []
sections: [],
};
}
@ -54,7 +54,7 @@ export default class ChannelMention extends PureComponent {
// if the term changes but is null or the mention has been completed we render this component as null
this.setState({
mentionComplete: false,
sections: []
sections: [],
});
this.props.onResultCountChange(0);
@ -83,7 +83,7 @@ export default class ChannelMention extends PureComponent {
id: 'suggestion.search.public',
defaultMessage: 'Public Channels',
data: publicChannels,
key: 'publicChannels'
key: 'publicChannels',
});
}
@ -92,7 +92,7 @@ export default class ChannelMention extends PureComponent {
id: 'suggestion.search.private',
defaultMessage: 'Private Channels',
data: privateChannels,
key: 'privateChannels'
key: 'privateChannels',
});
}
} else {
@ -101,7 +101,7 @@ export default class ChannelMention extends PureComponent {
id: 'suggestion.mention.channels',
defaultMessage: 'My Channels',
data: myChannels,
key: 'myChannels'
key: 'myChannels',
});
}
@ -110,13 +110,13 @@ export default class ChannelMention extends PureComponent {
id: 'suggestion.mention.morechannels',
defaultMessage: 'Other Channels',
data: otherChannels,
key: 'otherChannels'
key: 'otherChannels',
});
}
}
this.setState({
sections
sections,
});
this.props.onResultCountChange(sections.reduce((total, section) => total + section.data.length, 0));
@ -196,10 +196,10 @@ export default class ChannelMention extends PureComponent {
const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
return {
listView: {
backgroundColor: theme.centerChannelBg
backgroundColor: theme.centerChannelBg,
},
search: {
minHeight: 125
}
minHeight: 125,
},
};
});

View file

@ -12,7 +12,7 @@ import {
filterOtherChannels,
filterPublicChannels,
filterPrivateChannels,
getMatchTermForChannelMention
getMatchTermForChannelMention,
} from 'app/selectors/autocomplete';
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
@ -44,15 +44,15 @@ function mapStateToProps(state, ownProps) {
currentTeamId: getCurrentTeamId(state),
matchTerm,
requestStatus: state.requests.channels.getChannels.status,
theme: getTheme(state)
theme: getTheme(state),
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
searchChannels
}, dispatch)
searchChannels,
}, dispatch),
};
}

View file

@ -5,7 +5,7 @@ import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {
Text,
TouchableOpacity
TouchableOpacity,
} from 'react-native';
import {makeStyleSheetFromTheme} from 'app/utils/theme';
@ -16,7 +16,7 @@ export default class ChannelMentionItem extends PureComponent {
displayName: PropTypes.string,
name: PropTypes.string,
onPress: PropTypes.func.isRequired,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
completeMention = () => {
@ -29,7 +29,7 @@ export default class ChannelMentionItem extends PureComponent {
channelId,
displayName,
name,
theme
theme,
} = this.props;
const style = getStyleFromTheme(theme);
@ -53,15 +53,15 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
padding: 8,
flexDirection: 'row',
alignItems: 'center',
backgroundColor: theme.centerChannelBg
backgroundColor: theme.centerChannelBg,
},
rowDisplayName: {
fontSize: 13,
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
rowName: {
color: theme.centerChannelColor,
opacity: 0.6
}
opacity: 0.6,
},
};
});

View file

@ -15,7 +15,7 @@ function mapStateToProps(state, ownProps) {
return {
displayName: channel.display_name,
name: channel.name,
theme: getTheme(state)
theme: getTheme(state),
};
}

View file

@ -7,7 +7,7 @@ import {
FlatList,
Text,
TouchableOpacity,
View
View,
} from 'react-native';
import {isMinimumServerVersion} from 'mattermost-redux/utils/helpers';
@ -23,7 +23,7 @@ export default class EmojiSuggestion extends Component {
static propTypes = {
actions: PropTypes.shape({
addReactionToLatestPost: PropTypes.func.isRequired,
autocompleteCustomEmojis: PropTypes.func.isRequired
autocompleteCustomEmojis: PropTypes.func.isRequired,
}).isRequired,
cursorPosition: PropTypes.number,
emojis: PropTypes.array.isRequired,
@ -34,17 +34,17 @@ export default class EmojiSuggestion extends Component {
onResultCountChange: PropTypes.func.isRequired,
rootId: PropTypes.string,
value: PropTypes.string,
serverVersion: PropTypes.string
serverVersion: PropTypes.string,
};
static defaultProps = {
defaultChannel: {},
value: ''
value: '',
};
state = {
active: false,
dataSource: []
dataSource: [],
};
constructor(props) {
@ -64,7 +64,7 @@ export default class EmojiSuggestion extends Component {
if (!match || this.state.emojiComplete) {
this.setState({
active: false,
emojiComplete: false
emojiComplete: false,
});
this.props.onResultCountChange(0);
@ -118,7 +118,7 @@ export default class EmojiSuggestion extends Component {
setEmojiData = (data) => {
this.setState({
active: data.length > 0,
dataSource: data
dataSource: data,
});
this.props.onResultCountChange(data.length);
@ -143,7 +143,7 @@ export default class EmojiSuggestion extends Component {
this.setState({
active: false,
emojiComplete: true
emojiComplete: true,
});
};
@ -198,22 +198,22 @@ export default class EmojiSuggestion extends Component {
const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
return {
emoji: {
marginRight: 5
marginRight: 5,
},
emojiName: {
fontSize: 13,
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
listView: {
flex: 1,
backgroundColor: theme.centerChannelBg
backgroundColor: theme.centerChannelBg,
},
row: {
height: 40,
flexDirection: 'row',
alignItems: 'center',
paddingHorizontal: 8,
backgroundColor: theme.centerChannelBg
}
backgroundColor: theme.centerChannelBg,
},
};
});

View file

@ -35,7 +35,7 @@ function mapStateToProps(state) {
location: 0,
distance: 100,
minMatchCharLength: 2,
maxPatternLength: 32
maxPatternLength: 32,
};
const emojis = getEmojisByName(state);
@ -46,7 +46,7 @@ function mapStateToProps(state) {
fuse,
emojis,
theme: getTheme(state),
serverVersion: state.entities.general.serverVersion || Client4.getServerVersion()
serverVersion: state.entities.general.serverVersion || Client4.getServerVersion(),
};
}
@ -54,8 +54,8 @@ function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
addReactionToLatestPost,
autocompleteCustomEmojis
}, dispatch)
autocompleteCustomEmojis,
}, dispatch),
};
}

View file

@ -13,7 +13,7 @@ function mapStateToProps(state) {
const {deviceHeight} = getDimensions(state);
return {
deviceHeight,
theme: getTheme(state)
theme: getTheme(state),
};
}

View file

@ -30,15 +30,15 @@ function mapStateToProps(state) {
commands: mobileCommandsSelector(state),
commandsRequest: state.requests.integrations.getAutocompleteCommands,
currentTeamId: getCurrentTeamId(state),
theme: getTheme(state)
theme: getTheme(state),
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
getAutocompleteCommands
}, dispatch)
getAutocompleteCommands,
}, dispatch),
};
}

View file

@ -4,7 +4,7 @@
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {
FlatList
FlatList,
} from 'react-native';
import {RequestStatus} from 'mattermost-redux/constants';
@ -19,7 +19,7 @@ const TIME_BEFORE_NEXT_COMMAND_REQUEST = 1000 * 60 * 5;
export default class SlashSuggestion extends Component {
static propTypes = {
actions: PropTypes.shape({
getAutocompleteCommands: PropTypes.func.isRequired
getAutocompleteCommands: PropTypes.func.isRequired,
}).isRequired,
currentTeamId: PropTypes.string.isRequired,
commands: PropTypes.array,
@ -28,19 +28,19 @@ export default class SlashSuggestion extends Component {
theme: PropTypes.object.isRequired,
onChangeText: PropTypes.func.isRequired,
onResultCountChange: PropTypes.func.isRequired,
value: PropTypes.string
value: PropTypes.string,
};
static defaultProps = {
defaultChannel: {},
value: ''
value: '',
};
state = {
active: false,
suggestionComplete: false,
dataSource: [],
lastCommandRequest: 0
lastCommandRequest: 0,
};
componentWillReceiveProps(nextProps) {
@ -53,12 +53,12 @@ export default class SlashSuggestion extends Component {
commands: nextCommands,
commandsRequest: nextCommandsRequest,
currentTeamId: nextTeamId,
value: nextValue
value: nextValue,
} = nextProps;
if (currentTeamId !== nextTeamId) {
this.setState({
lastCommandRequest: 0
lastCommandRequest: 0,
});
}
@ -68,7 +68,7 @@ export default class SlashSuggestion extends Component {
this.setState({
active: false,
matchTerm: null,
suggestionComplete: false
suggestionComplete: false,
});
this.props.onResultCountChange(0);
return;
@ -79,7 +79,7 @@ export default class SlashSuggestion extends Component {
if ((!nextCommands.length || dataIsStale) && nextCommandsRequest.status !== RequestStatus.STARTED) {
this.props.actions.getAutocompleteCommands(nextProps.currentTeamId);
this.setState({
lastCommandRequest: Date.now()
lastCommandRequest: Date.now(),
});
}
@ -89,7 +89,7 @@ export default class SlashSuggestion extends Component {
this.setState({
active: data.length,
dataSource: data
dataSource: data,
});
this.props.onResultCountChange(data.length);
@ -116,7 +116,7 @@ export default class SlashSuggestion extends Component {
this.setState({
active: false,
suggestionComplete: true
suggestionComplete: true,
});
};
@ -161,7 +161,7 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
return {
listView: {
flex: 1,
backgroundColor: theme.centerChannelBg
}
backgroundColor: theme.centerChannelBg,
},
};
});

View file

@ -5,7 +5,7 @@ import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {
Text,
TouchableOpacity
TouchableOpacity,
} from 'react-native';
import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';
@ -17,7 +17,7 @@ export default class SlashSuggestionItem extends PureComponent {
hint: PropTypes.string,
onPress: PropTypes.func.isRequired,
theme: PropTypes.object.isRequired,
trigger: PropTypes.string
trigger: PropTypes.string,
};
completeSuggestion = () => {
@ -31,7 +31,7 @@ export default class SlashSuggestionItem extends PureComponent {
description,
hint,
theme,
trigger
trigger,
} = this.props;
const style = getStyleFromTheme(theme);
@ -60,24 +60,24 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
borderLeftWidth: 1,
borderLeftColor: changeOpacity(theme.centerChannelColor, 0.2),
borderRightWidth: 1,
borderRightColor: changeOpacity(theme.centerChannelColor, 0.2)
borderRightColor: changeOpacity(theme.centerChannelColor, 0.2),
},
rowDisplayName: {
fontSize: 13,
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
rowName: {
color: theme.centerChannelColor,
opacity: 0.6
opacity: 0.6,
},
suggestionDescription: {
fontSize: 11,
color: changeOpacity(theme.centerChannelColor, 0.6)
color: changeOpacity(theme.centerChannelColor, 0.6),
},
suggestionName: {
fontSize: 13,
color: theme.centerChannelColor,
marginBottom: 5
}
marginBottom: 5,
},
};
});

View file

@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import {
Text,
TouchableOpacity,
View
View,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
@ -20,7 +20,7 @@ export default class SpecialMentionItem extends PureComponent {
id: PropTypes.string.isRequired,
onPress: PropTypes.func.isRequired,
theme: PropTypes.object.isRequired,
values: PropTypes.object
values: PropTypes.object,
};
completeMention = () => {
@ -34,7 +34,7 @@ export default class SpecialMentionItem extends PureComponent {
id,
completeHandle,
theme,
values
values,
} = this.props;
const style = getStyleFromTheme(theme);
@ -70,31 +70,31 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
paddingVertical: 8,
flexDirection: 'row',
alignItems: 'center',
backgroundColor: theme.centerChannelBg
backgroundColor: theme.centerChannelBg,
},
rowPicture: {
marginHorizontal: 8,
width: 20,
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
rowIcon: {
color: changeOpacity(theme.centerChannelColor, 0.7),
fontSize: 14
fontSize: 14,
},
rowUsername: {
fontSize: 13,
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
rowFullname: {
color: theme.centerChannelColor,
flex: 1,
opacity: 0.6
opacity: 0.6,
},
textWrapper: {
flex: 1,
flexWrap: 'wrap',
paddingRight: 8
}
paddingRight: 8,
},
};
});

View file

@ -9,14 +9,14 @@ import {
Text,
TouchableWithoutFeedback,
View,
ViewPropTypes
ViewPropTypes,
} from 'react-native';
export default class Badge extends PureComponent {
static defaultProps = {
extraPaddingHorizontal: 10,
minHeight: 0,
minWidth: 0
minWidth: 0,
};
static propTypes = {
@ -26,7 +26,7 @@ export default class Badge extends PureComponent {
countStyle: Text.propTypes.style,
minHeight: PropTypes.number,
minWidth: PropTypes.number,
onPress: PropTypes.func
onPress: PropTypes.func,
};
constructor(props) {
@ -42,7 +42,7 @@ export default class Badge extends PureComponent {
onMoveShouldSetPanResponder: () => true,
onStartShouldSetResponderCapture: () => true,
onMoveShouldSetResponderCapture: () => true,
onResponderMove: () => false
onResponderMove: () => false,
});
}
@ -87,8 +87,8 @@ export default class Badge extends PureComponent {
style: {
width,
borderRadius,
opacity: 1
}
opacity: 1,
},
});
this.layoutReady = true;
}
@ -147,15 +147,15 @@ const styles = StyleSheet.create({
paddingBottom: 3,
position: 'absolute',
right: 30,
top: 2
top: 2,
},
wrapper: {
alignItems: 'center',
flex: 1,
justifyContent: 'center'
justifyContent: 'center',
},
text: {
fontSize: 14,
color: 'white'
}
color: 'white',
},
});

View file

@ -11,19 +11,19 @@ import {GlobalStyles} from 'app/styles';
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row'
flexDirection: 'row',
},
loading: {
marginLeft: 3
}
marginLeft: 3,
},
});
export default class Button extends PureComponent {
static propTypes = {
children: PropTypes.node,
loading: PropTypes.bool,
onPress: PropTypes.func.isRequired
onPress: PropTypes.func.isRequired,
};
onPress = () => {

View file

@ -9,7 +9,7 @@ import {
Keyboard,
Platform,
StyleSheet,
View
View,
} from 'react-native';
import {General, WebsocketEvents} from 'mattermost-redux/constants';
@ -29,7 +29,7 @@ const {
ANDROID_TOP_LANDSCAPE,
ANDROID_TOP_PORTRAIT,
IOS_TOP_LANDSCAPE,
IOS_TOP_PORTRAIT
IOS_TOP_PORTRAIT,
} = ViewTypes;
const DRAWER_INITIAL_OFFSET = 40;
const DRAWER_LANDSCAPE_OFFSET = 150;
@ -43,7 +43,7 @@ export default class ChannelDrawer extends Component {
makeDirectChannel: PropTypes.func.isRequired,
markChannelAsRead: PropTypes.func.isRequired,
setChannelDisplayName: PropTypes.func.isRequired,
setChannelLoading: PropTypes.func.isRequired
setChannelLoading: PropTypes.func.isRequired,
}).isRequired,
blurPostTextBox: PropTypes.func.isRequired,
children: PropTypes.node,
@ -54,7 +54,7 @@ export default class ChannelDrawer extends Component {
intl: PropTypes.object.isRequired,
navigator: PropTypes.object,
teamsCount: PropTypes.number.isRequired,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
closeHandle = null;
@ -69,7 +69,7 @@ export default class ChannelDrawer extends Component {
openDrawerOffset = DRAWER_LANDSCAPE_OFFSET;
}
this.state = {
openDrawerOffset
openDrawerOffset,
};
}
@ -175,12 +175,12 @@ export default class ChannelDrawer extends Component {
mainOverlay: {
backgroundColor: this.props.theme.centerChannelBg,
elevation: 3,
opacity
opacity,
},
drawerOverlay: {
backgroundColor: ratio ? '#000' : '#FFF',
opacity: ratio ? (1 - ratio) / 2 : 1
}
opacity: ratio ? (1 - ratio) / 2 : 1,
},
};
};
@ -202,7 +202,7 @@ export default class ChannelDrawer extends Component {
selectChannel = (channel, currentChannelId) => {
const {
actions
actions,
} = this.props;
const {
@ -210,7 +210,7 @@ export default class ChannelDrawer extends Component {
markChannelAsRead,
setChannelLoading,
setChannelDisplayName,
markChannelAsViewed
markChannelAsViewed,
} = actions;
tracker.channelSwitch = Date.now();
@ -236,12 +236,12 @@ export default class ChannelDrawer extends Component {
actions,
currentTeamId,
currentUserId,
intl
intl,
} = this.props;
const {
joinChannel,
makeDirectChannel
makeDirectChannel,
} = actions;
const displayValue = {displayName: channel.display_name};
@ -253,7 +253,7 @@ export default class ChannelDrawer extends Component {
if (result.error) {
const dmFailedMessage = {
id: 'mobile.open_dm.error',
defaultMessage: "We couldn't open a direct message with {displayName}. Please check your connection and try again."
defaultMessage: "We couldn't open a direct message with {displayName}. Please check your connection and try again.",
};
alertErrorWithFallback(intl, result.error, dmFailedMessage, displayValue);
}
@ -263,7 +263,7 @@ export default class ChannelDrawer extends Component {
if (result.error) {
const joinFailedMessage = {
id: 'mobile.join_channel.error',
defaultMessage: "We couldn't join the channel {displayName}. Please check your connection and try again."
defaultMessage: "We couldn't join the channel {displayName}. Please check your connection and try again.",
};
alertErrorWithFallback(intl, result.error, joinFailedMessage, displayValue);
}
@ -319,11 +319,11 @@ export default class ChannelDrawer extends Component {
const {
navigator,
teamsCount,
theme
theme,
} = this.props;
const {
openDrawerOffset
openDrawerOffset,
} = this.state;
const multipleTeams = teamsCount > 1;
@ -428,9 +428,9 @@ export default class ChannelDrawer extends Component {
shadowRadius: 12,
shadowOffset: {
width: -4,
height: 0
}
}
height: 0,
},
},
}}
>
{children}
@ -442,6 +442,6 @@ export default class ChannelDrawer extends Component {
const style = StyleSheet.create({
swiperContent: {
flex: 1,
marginBottom: 10
}
marginBottom: 10,
},
});

View file

@ -8,7 +8,7 @@ import {
Platform,
TouchableHighlight,
Text,
View
View,
} from 'react-native';
import {intlShape} from 'react-intl';
@ -33,11 +33,11 @@ export default class ChannelItem extends PureComponent {
status: PropTypes.string,
teammateDeletedAt: PropTypes.number,
type: PropTypes.string.isRequired,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
static contextTypes = {
intl: intlShape
intl: intlShape,
};
onPress = wrapWithPreventDoubleTap(() => {
@ -58,11 +58,11 @@ export default class ChannelItem extends PureComponent {
previewView: this.previewRef,
previewActions: [{
id: 'action-mark-as-read',
title: intl.formatMessage({id: 'mobile.channel.markAsRead', defaultMessage: 'Mark As Read'})
title: intl.formatMessage({id: 'mobile.channel.markAsRead', defaultMessage: 'Mark As Read'}),
}],
passProps: {
channelId
}
channelId,
},
});
}
};
@ -82,7 +82,7 @@ export default class ChannelItem extends PureComponent {
status,
teammateDeletedAt,
theme,
type
type,
} = this.props;
const {intl} = this.context;
@ -91,7 +91,7 @@ export default class ChannelItem extends PureComponent {
if (isMyUser) {
channelDisplayName = intl.formatMessage({
id: 'channel_header.directchannel.you',
defaultMessage: '{displayName} (you)'
defaultMessage: '{displayName} (you)',
}, {displayname: displayName});
}
@ -173,22 +173,22 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
container: {
flex: 1,
flexDirection: 'row',
height: 44
height: 44,
},
borderActive: {
backgroundColor: theme.sidebarTextActiveBorder,
width: 5
width: 5,
},
item: {
alignItems: 'center',
height: 44,
flex: 1,
flexDirection: 'row',
paddingLeft: 16
paddingLeft: 16,
},
itemActive: {
backgroundColor: changeOpacity(theme.sidebarTextActiveColor, 0.1),
paddingLeft: 11
paddingLeft: 11,
},
text: {
color: changeOpacity(theme.sidebarText, 0.4),
@ -196,13 +196,13 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
fontSize: 14,
fontWeight: '600',
lineHeight: 16,
paddingRight: 40
paddingRight: 40,
},
textActive: {
color: theme.sidebarTextActiveColor
color: theme.sidebarTextActiveColor,
},
textUnread: {
color: theme.sidebarUnreadText
color: theme.sidebarUnreadText,
},
badge: {
backgroundColor: theme.mentionBj,
@ -211,11 +211,11 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
borderWidth: 1,
padding: 3,
position: 'relative',
right: 16
right: 16,
},
mention: {
color: theme.mentionColor,
fontSize: 10
}
fontSize: 10,
},
};
});

View file

@ -40,7 +40,7 @@ function makeMapStateToProps() {
status: channel.status,
teammateDeletedAt,
theme: getTheme(state),
type: channel.type
type: channel.type,
};
};
}

View file

@ -5,7 +5,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import {
Platform,
View
View,
} from 'react-native';
import {injectIntl, intlShape} from 'react-intl';
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
@ -29,7 +29,7 @@ class ChannelsList extends React.PureComponent {
onSearchStart: PropTypes.func.isRequired,
onSelectChannel: PropTypes.func.isRequired,
onShowTeams: PropTypes.func.isRequired,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
constructor(props) {
@ -37,7 +37,7 @@ class ChannelsList extends React.PureComponent {
this.state = {
searching: false,
term: ''
term: '',
};
MaterialIcon.getImageSource('close', 20, this.props.theme.sidebarHeaderTextColor).then((source) => {
@ -77,7 +77,7 @@ class ChannelsList extends React.PureComponent {
intl,
navigator,
onShowTeams,
theme
theme,
} = this.props;
const {searching, term} = this.state;
@ -108,9 +108,9 @@ class ChannelsList extends React.PureComponent {
fontSize: 15,
...Platform.select({
android: {
marginBottom: -5
}
})
marginBottom: -5,
},
}),
};
const title = (
@ -161,10 +161,10 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
return {
container: {
backgroundColor: theme.sidebarBg,
flex: 1
flex: 1,
},
statusBar: {
backgroundColor: theme.sidebarHeaderBg
backgroundColor: theme.sidebarHeaderBg,
},
headerContainer: {
alignItems: 'center',
@ -175,30 +175,30 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
borderBottomColor: changeOpacity(theme.sidebarHeaderTextColor, 0.10),
...Platform.select({
android: {
height: ANDROID_TOP_PORTRAIT
height: ANDROID_TOP_PORTRAIT,
},
ios: {
height: 44
}
})
height: 44,
},
}),
},
header: {
color: theme.sidebarHeaderTextColor,
flex: 1,
fontSize: 17,
fontWeight: 'normal',
paddingLeft: 16
paddingLeft: 16,
},
switchContainer: {
position: 'relative',
top: -1
top: -1,
},
titleContainer: { // These aren't used by this component, but they are passed down to the list component
alignItems: 'center',
flex: 1,
flexDirection: 'row',
height: 48,
marginLeft: 16
marginLeft: 16,
},
title: {
flex: 1,
@ -207,40 +207,40 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
fontSize: 15,
fontWeight: '400',
letterSpacing: 0.8,
lineHeight: 18
lineHeight: 18,
},
searchContainer: {
flex: 1,
paddingRight: 10,
...Platform.select({
android: {
marginBottom: 1
marginBottom: 1,
},
ios: {
marginBottom: 3
}
})
marginBottom: 3,
},
}),
},
divider: {
backgroundColor: changeOpacity(theme.sidebarText, 0.1),
height: 1
height: 1,
},
actionContainer: {
alignItems: 'center',
height: 48,
justifyContent: 'center',
width: 50
width: 50,
},
action: {
color: theme.sidebarText,
fontSize: 20,
fontWeight: '500',
lineHeight: 18
lineHeight: 18,
},
above: {
backgroundColor: theme.mentionBj,
top: 9
}
top: 9,
},
};
});

View file

@ -8,7 +8,7 @@ import {
FlatList,
Text,
TouchableHighlight,
View
View,
} from 'react-native';
import {injectIntl, intlShape} from 'react-intl';
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
@ -30,7 +30,7 @@ class FilteredList extends Component {
getProfilesInTeam: PropTypes.func.isRequired,
makeGroupMessageVisibleIfNecessary: PropTypes.func.isRequired,
searchChannels: PropTypes.func.isRequired,
searchProfiles: PropTypes.func.isRequired
searchProfiles: PropTypes.func.isRequired,
}).isRequired,
channels: PropTypes.object.isRequired,
currentTeam: PropTypes.object.isRequired,
@ -49,19 +49,19 @@ class FilteredList extends Component {
statuses: PropTypes.object,
styles: PropTypes.object.isRequired,
term: PropTypes.string,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
static defaultProps = {
currentTeam: {},
currentChannel: {},
pastDirectMessages: []
pastDirectMessages: [],
};
constructor(props) {
super(props);
this.state = {
dataSource: this.buildData(props)
dataSource: this.buildData(props),
};
}
@ -146,28 +146,28 @@ class FilteredList extends Component {
unreads: {
builder: this.buildUnreadChannelsForSearch,
id: 'mobile.channel_list.unreads',
defaultMessage: 'UNREADS'
defaultMessage: 'UNREADS',
},
channels: {
builder: this.buildChannelsForSearch,
id: 'mobile.channel_list.channels',
defaultMessage: 'CHANNELS'
defaultMessage: 'CHANNELS',
},
dms: {
builder: this.buildCurrentDMSForSearch,
id: 'sidebar.direct',
defaultMessage: 'DIRECT MESSAGES'
defaultMessage: 'DIRECT MESSAGES',
},
members: {
builder: this.buildMembersForSearch,
id: 'mobile.channel_list.members',
defaultMessage: 'MEMBERS'
defaultMessage: 'MEMBERS',
},
nonmembers: {
builder: this.buildOtherMembersForSearch,
id: 'mobile.channel_list.not_member',
defaultMessage: 'NOT A MEMBER'
}
defaultMessage: 'NOT A MEMBER',
},
});
buildUnreadChannelsForSearch = (props, term) => {
@ -212,14 +212,14 @@ class FilteredList extends Component {
type: General.DM_CHANNEL,
fake: true,
nickname: u.nickname,
fullname: `${u.first_name} ${u.last_name}`
fullname: `${u.first_name} ${u.last_name}`,
};
});
groupChannels = groupChannels.map((channel) => {
return {
...channel,
...groupChannelMemberDetails[channel.id]
...groupChannelMemberDetails[channel.id],
};
});
@ -253,7 +253,7 @@ class FilteredList extends Component {
type: General.DM_CHANNEL,
fake: true,
nickname: u.nickname,
fullname: `${u.first_name} ${u.last_name}`
fullname: `${u.first_name} ${u.last_name}`,
};
});
@ -266,7 +266,7 @@ class FilteredList extends Component {
const {
favoriteChannels,
publicChannels,
privateChannels
privateChannels,
} = props.channels;
const favorites = favoriteChannels.filter((c) => {
@ -283,7 +283,7 @@ class FilteredList extends Component {
const notMemberOf = otherChannels.map((o) => {
return {
...o,
fake: true
fake: true,
};
});
@ -369,7 +369,7 @@ class FilteredList extends Component {
</View>
{bottomDivider && this.renderDivider(styles, 16)}
</View>
)
),
};
};

View file

@ -13,7 +13,7 @@ import {
getChannelsWithUnreadSection,
getCurrentChannel,
getGroupChannels,
getOtherChannels
getOtherChannels,
} from 'mattermost-redux/selectors/entities/channels';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {getCurrentUserId, getProfilesInCurrentTeam, getUsers, getUserIdsInChannels, getUserStatuses} from 'mattermost-redux/selectors/entities/users';
@ -72,14 +72,14 @@ function getGroupDetails(currentUserId, userIdsInChannels, profiles, groupChanne
email: [],
fullname: [],
nickname: [],
username: []
username: [],
});
groupMemberDetails[channel.id] = {
email: members.email.join(','),
fullname: members.fullname.join(','),
nickname: members.nickname.join(','),
username: members.username.join(',')
username: members.username.join(','),
};
return groupMemberDetails;
@ -119,7 +119,7 @@ function mapStateToProps(state) {
searchOrder,
pastDirectMessages: pastDirectMessages(state),
restrictDms,
theme: getTheme(state)
theme: getTheme(state),
};
}
@ -129,8 +129,8 @@ function mapDispatchToProps(dispatch) {
getProfilesInTeam,
makeGroupMessageVisibleIfNecessary,
searchChannels,
searchProfiles
}, dispatch)
searchProfiles,
}, dispatch),
};
}

View file

@ -9,7 +9,7 @@ import ChannelsList from './channels_list';
function mapStateToProps(state) {
return {
theme: getTheme(state)
theme: getTheme(state),
};
}

View file

@ -9,7 +9,7 @@ import {
getSortedFavoriteChannelIds,
getSortedPublicChannelIds,
getSortedPrivateChannelIds,
getSortedDirectChannelIds
getSortedDirectChannelIds,
} from 'mattermost-redux/selectors/entities/channels';
import {getCurrentUserId, getCurrentUserRoles} from 'mattermost-redux/selectors/entities/users';
import {getTheme, getFavoritesPreferences} from 'mattermost-redux/selectors/entities/preferences';
@ -34,7 +34,7 @@ function mapStateToProps(state) {
publicChannelIds,
privateChannelIds,
directChannelIds,
theme: getTheme(state)
theme: getTheme(state),
};
}

View file

@ -8,7 +8,7 @@ import {
SectionList,
Text,
TouchableHighlight,
View
View,
} from 'react-native';
import {intlShape} from 'react-intl';
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
@ -24,7 +24,7 @@ import {changeOpacity} from 'app/utils/theme';
const VIEWABILITY_CONFIG = {
...ListTypes.VISIBILITY_CONFIG_DEFAULTS,
waitForInteraction: true
waitForInteraction: true,
};
export default class List extends PureComponent {
@ -38,11 +38,11 @@ export default class List extends PureComponent {
privateChannelIds: PropTypes.array.isRequired,
styles: PropTypes.object.isRequired,
theme: PropTypes.object.isRequired,
unreadChannelIds: PropTypes.array.isRequired
unreadChannelIds: PropTypes.array.isRequired,
};
static contextTypes = {
intl: intlShape
intl: intlShape,
};
constructor(props) {
@ -51,7 +51,7 @@ export default class List extends PureComponent {
this.state = {
sections: this.buildSections(props),
showIndicator: false,
width: 0
width: 0,
};
MaterialIcon.getImageSource('close', 20, this.props.theme.sidebarHeaderTextColor).then((source) => {
@ -66,7 +66,7 @@ export default class List extends PureComponent {
favoriteChannelIds,
publicChannelIds,
privateChannelIds,
unreadChannelIds
unreadChannelIds,
} = this.props;
if (nextProps.canCreatePrivateChannels !== canCreatePrivateChannels ||
@ -93,7 +93,7 @@ export default class List extends PureComponent {
favoriteChannelIds,
publicChannelIds,
privateChannelIds,
unreadChannelIds
unreadChannelIds,
} = props;
const sections = [];
@ -104,7 +104,7 @@ export default class List extends PureComponent {
data: unreadChannelIds,
renderItem: this.renderUnreadItem,
topSeparator: false,
bottomSeparator: true
bottomSeparator: true,
});
}
@ -114,7 +114,7 @@ export default class List extends PureComponent {
defaultMessage: 'FAVORITES',
data: favoriteChannelIds,
topSeparator: unreadChannelIds.length > 0,
bottomSeparator: true
bottomSeparator: true,
});
}
@ -124,7 +124,7 @@ export default class List extends PureComponent {
defaultMessage: 'PUBLIC CHANNELS',
data: publicChannelIds,
topSeparator: favoriteChannelIds.length > 0 || unreadChannelIds.length > 0,
bottomSeparator: publicChannelIds.length > 0
bottomSeparator: publicChannelIds.length > 0,
});
sections.push({
@ -133,7 +133,7 @@ export default class List extends PureComponent {
defaultMessage: 'PRIVATE CHANNELS',
data: privateChannelIds,
topSeparator: true,
bottomSeparator: privateChannelIds.length > 0
bottomSeparator: privateChannelIds.length > 0,
});
sections.push({
@ -142,7 +142,7 @@ export default class List extends PureComponent {
defaultMessage: 'DIRECT MESSAGES',
data: directChannelIds,
topSeparator: true,
bottomSeparator: directChannelIds.length > 0
bottomSeparator: directChannelIds.length > 0,
});
return sections;
@ -162,12 +162,12 @@ export default class List extends PureComponent {
navBarTextColor: theme.sidebarHeaderTextColor,
navBarBackgroundColor: theme.sidebarHeaderBg,
navBarButtonColor: theme.sidebarHeaderTextColor,
screenBackgroundColor: theme.centerChannelBg
screenBackgroundColor: theme.centerChannelBg,
},
passProps: {
channelType: General.PRIVATE_CHANNEL,
closeButton: this.closeButton
}
closeButton: this.closeButton,
},
});
});
@ -185,14 +185,14 @@ export default class List extends PureComponent {
navBarTextColor: theme.sidebarHeaderTextColor,
navBarBackgroundColor: theme.sidebarHeaderBg,
navBarButtonColor: theme.sidebarHeaderTextColor,
screenBackgroundColor: theme.centerChannelBg
screenBackgroundColor: theme.centerChannelBg,
},
navigatorButtons: {
leftButtons: [{
id: 'close-dms',
icon: this.closeButton
}]
}
icon: this.closeButton,
}],
},
});
});
@ -210,11 +210,11 @@ export default class List extends PureComponent {
navBarTextColor: theme.sidebarHeaderTextColor,
navBarBackgroundColor: theme.sidebarHeaderBg,
navBarButtonColor: theme.sidebarHeaderTextColor,
screenBackgroundColor: theme.centerChannelBg
screenBackgroundColor: theme.centerChannelBg,
},
passProps: {
closeButton: this.closeButton
}
closeButton: this.closeButton,
},
});
});
@ -282,7 +282,7 @@ export default class List extends PureComponent {
bottomSeparator,
defaultMessage,
id,
topSeparator
topSeparator,
} = section;
return (
@ -304,7 +304,7 @@ export default class List extends PureComponent {
this.refs.list._wrapperListRef.getListRef().scrollToOffset({ //eslint-disable-line no-underscore-dangle
x: 0,
y: 0,
animated: true
animated: true,
});
}
};

View file

@ -16,7 +16,7 @@ function mapStateToProps(state) {
displayName: team.display_name,
mentionCount: getChannelDrawerBadgeCount(state),
teamsCount: getMyTeamsCount(state),
theme: getTheme(state)
theme: getTheme(state),
};
}

View file

@ -6,7 +6,7 @@ import React from 'react';
import {
Text,
TouchableHighlight,
View
View,
} from 'react-native';
import AwesomeIcon from 'react-native-vector-icons/FontAwesome';
@ -22,7 +22,7 @@ export default class SwitchTeamsButton extends React.PureComponent {
onShowTeams: PropTypes.func.isRequired,
mentionCount: PropTypes.number.isRequired,
teamsCount: PropTypes.number.isRequired,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
showTeams = wrapWithPreventDoubleTap(() => {
@ -36,7 +36,7 @@ export default class SwitchTeamsButton extends React.PureComponent {
mentionCount,
searching,
teamsCount,
theme
theme,
} = this.props;
if (!currentTeamId) {
@ -94,18 +94,18 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
justifyContent: 'center',
marginLeft: 6,
marginRight: 5,
paddingHorizontal: 6
paddingHorizontal: 6,
},
switcherDivider: {
backgroundColor: theme.sidebarHeaderBg,
height: 15,
marginHorizontal: 6,
width: 1
width: 1,
},
switcherTeam: {
color: theme.sidebarHeaderBg,
fontFamily: 'OpenSans',
fontSize: 14
fontSize: 14,
},
badge: {
backgroundColor: theme.mentionBj,
@ -116,11 +116,11 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
padding: 3,
position: 'absolute',
left: -5,
top: -5
top: -5,
},
mention: {
color: theme.mentionColor,
fontSize: 10
}
fontSize: 10,
},
};
});

View file

@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import {
TouchableWithoutFeedback,
View,
ViewPropTypes
ViewPropTypes,
} from 'react-native';
import IonIcon from 'react-native-vector-icons/Ionicons';
@ -18,11 +18,11 @@ export default class UnreadIndicator extends PureComponent {
show: PropTypes.bool,
style: ViewPropTypes.style,
onPress: PropTypes.func,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
static defaultProps = {
onPress: () => true
onPress: () => true,
};
render() {
@ -65,7 +65,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
position: 'absolute',
borderRadius: 15,
marginHorizontal: 15,
height: 25
height: 25,
},
indicatorText: {
backgroundColor: 'transparent',
@ -74,11 +74,11 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
paddingVertical: 2,
paddingHorizontal: 4,
textAlign: 'center',
textAlignVertical: 'center'
textAlignVertical: 'center',
},
arrow: {
position: 'relative',
bottom: -1
}
bottom: -1,
},
};
});

View file

@ -16,12 +16,12 @@ export default class DrawerSwiper extends Component {
onPageSelected: PropTypes.func,
openDrawerOffset: PropTypes.number,
showTeams: PropTypes.bool.isRequired,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
static defaultProps = {
onPageSelected: () => true,
openDrawerOffset: 0
openDrawerOffset: 0,
};
shouldComponentUpdate(nextProps) {
@ -64,7 +64,7 @@ export default class DrawerSwiper extends Component {
deviceWidth,
openDrawerOffset,
showTeams,
theme
theme,
} = this.props;
const initialPage = React.Children.count(children) - 1;
@ -92,6 +92,6 @@ export default class DrawerSwiper extends Component {
const style = StyleSheet.create({
pagination: {
bottom: 0,
position: 'absolute'
}
position: 'absolute',
},
});

View file

@ -12,7 +12,7 @@ import DraweSwiper from './drawer_swiper';
function mapStateToProps(state) {
return {
...getDimensions(state),
theme: getTheme(state)
theme: getTheme(state),
};
}

View file

@ -24,7 +24,7 @@ function mapStateToProps(state) {
isLandscape: isLandscape(state),
isTablet: isTablet(state),
teamsCount: getMyTeamsCount(state),
theme: getTheme(state)
theme: getTheme(state),
};
}
@ -38,8 +38,8 @@ function mapDispatchToProps(dispatch) {
makeDirectChannel,
markChannelAsRead,
setChannelDisplayName,
setChannelLoading
}, dispatch)
setChannelLoading,
}, dispatch),
};
}

View file

@ -22,15 +22,15 @@ function mapStateToProps(state) {
currentTeamId: getCurrentTeamId(state),
currentUrl: removeProtocol(getCurrentUrl(state)),
teamIds: getMySortedTeamIds(state, locale),
theme: getTheme(state)
theme: getTheme(state),
};
}
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
handleTeamChange
}, dispatch)
handleTeamChange,
}, dispatch),
};
}

View file

@ -9,7 +9,7 @@ import {
StatusBar,
Text,
TouchableHighlight,
View
View,
} from 'react-native';
import {injectIntl, intlShape} from 'react-intl';
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
@ -25,13 +25,13 @@ import TeamsListItem from './teams_list_item';
const {ANDROID_TOP_PORTRAIT} = ViewTypes;
const VIEWABILITY_CONFIG = {
...ListTypes.VISIBILITY_CONFIG_DEFAULTS,
waitForInteraction: true
waitForInteraction: true,
};
class TeamsList extends PureComponent {
static propTypes = {
actions: PropTypes.shape({
handleTeamChange: PropTypes.func.isRequired
handleTeamChange: PropTypes.func.isRequired,
}).isRequired,
canJoinOtherTeams: PropTypes.bool.isRequired,
closeChannelDrawer: PropTypes.func.isRequired,
@ -40,7 +40,7 @@ class TeamsList extends PureComponent {
intl: intlShape.isRequired,
navigator: PropTypes.object.isRequired,
teamIds: PropTypes.array.isRequired,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
constructor(props) {
@ -77,18 +77,18 @@ class TeamsList extends PureComponent {
navBarTextColor: theme.sidebarHeaderTextColor,
navBarBackgroundColor: theme.sidebarHeaderBg,
navBarButtonColor: theme.sidebarHeaderTextColor,
screenBackgroundColor: theme.centerChannelBg
screenBackgroundColor: theme.centerChannelBg,
},
navigatorButtons: {
leftButtons: [{
id: 'close-teams',
icon: this.closeButton
}]
icon: this.closeButton,
}],
},
passProps: {
currentUrl,
theme
}
theme,
},
});
});
@ -153,10 +153,10 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
return {
container: {
backgroundColor: theme.sidebarBg,
flex: 1
flex: 1,
},
statusBar: {
backgroundColor: theme.sidebarHeaderBg
backgroundColor: theme.sidebarHeaderBg,
},
headerContainer: {
alignItems: 'center',
@ -166,19 +166,19 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
borderBottomColor: changeOpacity(theme.sidebarHeaderTextColor, 0.10),
...Platform.select({
android: {
height: ANDROID_TOP_PORTRAIT
height: ANDROID_TOP_PORTRAIT,
},
ios: {
height: 44
}
})
height: 44,
},
}),
},
header: {
color: theme.sidebarHeaderTextColor,
flex: 1,
fontSize: 17,
textAlign: 'center',
fontWeight: '600'
fontWeight: '600',
},
moreActionContainer: {
alignItems: 'center',
@ -186,17 +186,17 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
width: 50,
...Platform.select({
android: {
height: ANDROID_TOP_PORTRAIT
height: ANDROID_TOP_PORTRAIT,
},
ios: {
height: 44
}
})
height: 44,
},
}),
},
moreAction: {
color: theme.sidebarHeaderTextColor,
fontSize: 30
}
fontSize: 30,
},
};
});

View file

@ -23,7 +23,7 @@ function makeMapStateToProps() {
displayName: team.display_name,
mentionCount: getMentionCount(state, ownProps.teamId),
name: team.name,
theme: getTheme(state)
theme: getTheme(state),
};
};
}

View file

@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import {
Text,
TouchableHighlight,
View
View,
} from 'react-native';
import IonIcon from 'react-native-vector-icons/Ionicons';
@ -23,7 +23,7 @@ export default class TeamsListItem extends React.PureComponent {
name: PropTypes.string.isRequired,
selectTeam: PropTypes.func.isRequired,
teamId: PropTypes.string.isRequired,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
selectTeam = wrapWithPreventDoubleTap(() => {
@ -38,7 +38,7 @@ export default class TeamsListItem extends React.PureComponent {
mentionCount,
name,
teamId,
theme
theme,
} = this.props;
const styles = getStyleSheet(theme);
@ -104,13 +104,13 @@ export default class TeamsListItem extends React.PureComponent {
const getStyleSheet = makeStyleSheetFromTheme((theme) => {
return {
teamWrapper: {
marginTop: 20
marginTop: 20,
},
teamContainer: {
alignItems: 'center',
flex: 1,
flexDirection: 'row',
marginHorizontal: 16
marginHorizontal: 16,
},
teamIconContainer: {
alignItems: 'center',
@ -118,33 +118,33 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
borderRadius: 2,
height: 40,
justifyContent: 'center',
width: 40
width: 40,
},
teamIcon: {
color: theme.sidebarBg,
fontFamily: 'OpenSans',
fontSize: 18,
fontWeight: '600'
fontWeight: '600',
},
teamNameContainer: {
flex: 1,
flexDirection: 'column',
marginLeft: 10
marginLeft: 10,
},
teamName: {
color: theme.sidebarText,
fontSize: 18
fontSize: 18,
},
teamUrl: {
color: changeOpacity(theme.sidebarText, 0.5),
fontSize: 12
fontSize: 12,
},
checkmarkContainer: {
alignItems: 'flex-end'
alignItems: 'flex-end',
},
checkmark: {
color: theme.sidebarText,
fontSize: 20
fontSize: 20,
},
badge: {
backgroundColor: theme.mentionBj,
@ -155,11 +155,11 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
padding: 3,
position: 'absolute',
left: 45,
top: -7.5
top: -7.5,
},
mention: {
color: theme.mentionColor,
fontSize: 10
}
fontSize: 10,
},
};
});

View file

@ -5,7 +5,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import {
Text,
View
View,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
@ -14,7 +14,7 @@ import {
AwayAvatar,
DndAvatar,
OfflineAvatar,
OnlineAvatar
OnlineAvatar,
} from 'app/components/status_icons';
import {General} from 'mattermost-redux/constants';
@ -31,14 +31,14 @@ export default class ChannelIcon extends React.PureComponent {
status: PropTypes.string,
teammateDeletedAt: PropTypes.number,
theme: PropTypes.object.isRequired,
type: PropTypes.string.isRequired
type: PropTypes.string.isRequired,
};
static defaultProps = {
isActive: false,
isInfo: false,
isUnread: false,
size: 12
size: 12,
};
render() {
@ -51,7 +51,7 @@ export default class ChannelIcon extends React.PureComponent {
status,
teammateDeletedAt,
theme,
type
type,
} = this.props;
const style = getStyleSheet(theme);
@ -167,49 +167,49 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
return {
container: {
marginRight: 12,
alignItems: 'center'
alignItems: 'center',
},
icon: {
color: changeOpacity(theme.sidebarText, 0.4)
color: changeOpacity(theme.sidebarText, 0.4),
},
iconActive: {
color: theme.sidebarTextActiveColor
color: theme.sidebarTextActiveColor,
},
iconUnread: {
color: theme.sidebarUnreadText
color: theme.sidebarUnreadText,
},
iconInfo: {
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
groupBox: {
alignSelf: 'flex-start',
alignItems: 'center',
borderWidth: 1,
borderColor: changeOpacity(theme.sidebarText, 0.4),
justifyContent: 'center'
justifyContent: 'center',
},
groupBoxActive: {
borderColor: theme.sidebarTextActiveColor
borderColor: theme.sidebarTextActiveColor,
},
groupBoxUnread: {
borderColor: theme.sidebarUnreadText
borderColor: theme.sidebarUnreadText,
},
groupBoxInfo: {
borderColor: theme.centerChannelColor
borderColor: theme.centerChannelColor,
},
group: {
color: changeOpacity(theme.sidebarText, 0.4),
fontSize: 10,
fontWeight: '600'
fontWeight: '600',
},
groupActive: {
color: theme.sidebarTextActiveColor
color: theme.sidebarTextActiveColor,
},
groupUnread: {
color: theme.sidebarUnreadText
color: theme.sidebarUnreadText,
},
groupInfo: {
color: theme.centerChannelColor
}
color: theme.centerChannelColor,
},
};
});

View file

@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import {
Text,
TouchableOpacity,
View
View,
} from 'react-native';
import {getFullName} from 'mattermost-redux/utils/user_utils';
import {General} from 'mattermost-redux/constants';
@ -25,7 +25,7 @@ class ChannelIntro extends PureComponent {
intl: intlShape.isRequired,
isLoadingPosts: PropTypes.bool,
navigator: PropTypes.object.isRequired,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
goToUserProfile = (userId) => {
@ -37,14 +37,14 @@ class ChannelIntro extends PureComponent {
animated: true,
backButtonTitle: '',
passProps: {
userId
userId,
},
navigatorStyle: {
navBarTextColor: theme.sidebarHeaderTextColor,
navBarBackgroundColor: theme.sidebarHeaderBg,
navBarButtonColor: theme.sidebarHeaderTextColor,
screenBackgroundColor: theme.centerChannelBg
}
screenBackgroundColor: theme.centerChannelBg,
},
});
};
@ -109,9 +109,9 @@ class ChannelIntro extends PureComponent {
<Text style={style.message}>
{intl.formatMessage({
id: 'mobile.intro_messages.DM',
defaultMessage: 'This is the start of your direct message history with {teammate}. Direct messages and files shared here are not shown to people outside this area.'
defaultMessage: 'This is the start of your direct message history with {teammate}. Direct messages and files shared here are not shown to people outside this area.',
}, {
teammate
teammate,
})}
</Text>
);
@ -128,7 +128,7 @@ class ChannelIntro extends PureComponent {
<Text style={style.message}>
{intl.formatMessage({
id: 'intro_messages.group_message',
defaultMessage: 'This is the start of your group message history with these teammates. Messages and files shared here are not shown to people outside this area.'
defaultMessage: 'This is the start of your group message history with these teammates. Messages and files shared here are not shown to people outside this area.',
})}
</Text>
);
@ -141,7 +141,7 @@ class ChannelIntro extends PureComponent {
const date = intl.formatDate(currentChannel.create_at, {
year: 'numeric',
month: 'long',
day: 'numeric'
day: 'numeric',
});
let mainMessageIntl;
@ -156,9 +156,9 @@ class ChannelIntro extends PureComponent {
date,
type: intl.formatMessage({
id: 'intro_messages.channel',
defaultMessage: 'channel'
})
}
defaultMessage: 'channel',
}),
},
};
} else {
mainMessageIntl = {
@ -169,20 +169,20 @@ class ChannelIntro extends PureComponent {
date,
type: intl.formatMessage({
id: 'intro_messages.channel',
defaultMessage: 'channel'
})
}
defaultMessage: 'channel',
}),
},
};
}
const mainMessage = intl.formatMessage({
id: mainMessageIntl.id,
defaultMessage: mainMessageIntl.defaultMessage
defaultMessage: mainMessageIntl.defaultMessage,
}, mainMessageIntl.values);
const anyMemberMessage = intl.formatMessage({
id: 'intro_messages.anyMember',
defaultMessage: ' Any member can join and read this channel.'
defaultMessage: ' Any member can join and read this channel.',
});
return (
@ -190,9 +190,9 @@ class ChannelIntro extends PureComponent {
<Text style={style.channelTitle}>
{intl.formatMessage({
id: 'intro_messages.beginning',
defaultMessage: 'Beginning of {name}'
defaultMessage: 'Beginning of {name}',
}, {
name: currentChannel.display_name
name: currentChannel.display_name,
})}
</Text>
<Text style={style.message}>
@ -210,25 +210,25 @@ class ChannelIntro extends PureComponent {
const date = intl.formatDate(currentChannel.create_at, {
year: 'numeric',
month: 'long',
day: 'numeric'
day: 'numeric',
});
const mainMessage = intl.formatMessage({
id: 'intro_messages.creator',
defaultMessage: 'This is the start of the {name} {type}, created by {creator} on {date}.'
defaultMessage: 'This is the start of the {name} {type}, created by {creator} on {date}.',
}, {
name: currentChannel.display_name,
creator: creatorName,
date,
type: intl.formatMessage({
id: 'intro_messages.group',
defaultMessage: 'private channel'
})
defaultMessage: 'private channel',
}),
});
const onlyInvitedMessage = intl.formatMessage({
id: 'intro_messages.onlyInvited',
defaultMessage: ' Only invited members can see this private channel.'
defaultMessage: ' Only invited members can see this private channel.',
});
return (
@ -236,9 +236,9 @@ class ChannelIntro extends PureComponent {
<Text style={style.channelTitle}>
{intl.formatMessage({
id: 'intro_messages.beginning',
defaultMessage: 'Beginning of {name}'
defaultMessage: 'Beginning of {name}',
}, {
name: currentChannel.display_name
name: currentChannel.display_name,
})}
</Text>
<Text style={style.message}>
@ -257,23 +257,23 @@ class ChannelIntro extends PureComponent {
<Text style={style.channelTitle}>
{intl.formatMessage({
id: 'intro_messages.beginning',
defaultMessage: 'Beginning of {name}'
defaultMessage: 'Beginning of {name}',
}, {
name: currentChannel.display_name
name: currentChannel.display_name,
})}
</Text>
<Text style={style.channelWelcome}>
{intl.formatMessage({
id: 'mobile.intro_messages.default_welcome',
defaultMessage: 'Welcome to {name}!'
defaultMessage: 'Welcome to {name}!',
}, {
name: currentChannel.display_name
name: currentChannel.display_name,
})}
</Text>
<Text style={style.message}>
{intl.formatMessage({
id: 'mobile.intro_messages.default_message',
defaultMessage: 'This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.'
defaultMessage: 'This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.',
})}
</Text>
</View>
@ -348,42 +348,42 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
color: theme.centerChannelColor,
fontSize: 19,
fontWeight: '600',
marginBottom: 12
marginBottom: 12,
},
channelWelcome: {
color: theme.centerChannelColor,
marginBottom: 12
marginBottom: 12,
},
container: {
marginTop: 60,
marginHorizontal: 12,
marginBottom: 12
marginBottom: 12,
},
displayName: {
color: theme.centerChannelColor,
fontSize: 15,
fontWeight: '600'
fontWeight: '600',
},
message: {
color: changeOpacity(theme.centerChannelColor, 0.8),
fontSize: 15,
lineHeight: 22
lineHeight: 22,
},
namesContainer: {
flexDirection: 'row',
flexWrap: 'wrap',
marginBottom: 12
marginBottom: 12,
},
profile: {
height: 67,
marginBottom: 12,
marginRight: 12
marginRight: 12,
},
profilesContainer: {
flexDirection: 'row',
flexWrap: 'wrap',
justifyContent: 'flex-start'
}
justifyContent: 'flex-start',
},
};
});

View file

@ -51,7 +51,7 @@ function makeMapStateToProps() {
currentChannel,
currentChannelMembers,
isLoadingPosts: (!postsInChannel || postsInChannel.length === 0) && getPostsRequestStatus === RequestStatus.STARTED,
theme: getTheme(state)
theme: getTheme(state),
};
};
}

View file

@ -15,22 +15,22 @@ export default class ChannelLink extends React.PureComponent {
channelsByName: PropTypes.object.isRequired,
actions: PropTypes.shape({
handleSelectChannel: PropTypes.func.isRequired,
setChannelDisplayName: PropTypes.func.isRequired
}).isRequired
setChannelDisplayName: PropTypes.func.isRequired,
}).isRequired,
};
constructor(props) {
super(props);
this.state = {
channel: this.getChannelFromChannelName(props)
channel: this.getChannelFromChannelName(props),
};
}
componentWillReceiveProps(nextProps) {
if (nextProps.channelName !== this.props.channelName || nextProps.channelsByName !== this.props.channelsByName) {
this.setState({
channel: this.getChannelFromChannelName(nextProps)
channel: this.getChannelFromChannelName(nextProps),
});
}
}

View file

@ -12,7 +12,7 @@ import ChannelLink from './channel_link';
function mapStateToProps(state) {
return {
channelsByName: getChannelsNameMapInCurrentTeam(state)
channelsByName: getChannelsNameMapInCurrentTeam(state),
};
}
@ -20,8 +20,8 @@ function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
handleSelectChannel,
setChannelDisplayName
}, dispatch)
setChannelDisplayName,
}, dispatch),
};
}

View file

@ -5,7 +5,7 @@ import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {
Platform,
View
View,
} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
@ -19,7 +19,7 @@ export default class ChannelLoader extends PureComponent {
static propTypes = {
channelIsLoading: PropTypes.bool.isRequired,
deviceWidth: PropTypes.number.isRequired,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
buildSections(key, style, top) {
@ -36,7 +36,7 @@ export default class ChannelLoader extends PureComponent {
colors={[
changeOpacity('#e5e5e4', GRADIENT_START),
changeOpacity('#d6d6d5', GRADIENT_MIDDLE),
changeOpacity('#e5e5e4', GRADIENT_END)
changeOpacity('#e5e5e4', GRADIENT_END),
]}
locations={[0.1, 0.3, 0.7]}
style={[style.messageText, {width: 106}]}
@ -47,7 +47,7 @@ export default class ChannelLoader extends PureComponent {
colors={[
changeOpacity('#e5e5e4', GRADIENT_START),
changeOpacity('#d6d6d5', GRADIENT_MIDDLE),
changeOpacity('#e5e5e4', GRADIENT_END)
changeOpacity('#e5e5e4', GRADIENT_END),
]}
locations={[0.1, 0.3, 0.7]}
style={[style.messageText, {alignSelf: 'stretch'}]}
@ -58,7 +58,7 @@ export default class ChannelLoader extends PureComponent {
colors={[
changeOpacity('#e5e5e4', GRADIENT_START),
changeOpacity('#d6d6d5', GRADIENT_MIDDLE),
changeOpacity('#e5e5e4', GRADIENT_END)
changeOpacity('#e5e5e4', GRADIENT_END),
]}
locations={[0.1, 0.3, 0.7]}
style={[style.messageText, {alignSelf: 'stretch'}]}
@ -93,35 +93,35 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
position: 'absolute',
...Platform.select({
android: {
top: 0
top: 0,
},
ios: {
top: 15
}
})
top: 15,
},
}),
},
avatar: {
backgroundColor: changeOpacity(theme.centerChannelColor, 0.1),
borderRadius: 16,
height: 32,
width: 32
width: 32,
},
messageText: {
backgroundColor: changeOpacity(theme.centerChannelColor, 0.1),
height: 10,
marginBottom: 10
marginBottom: 10,
},
section: {
backgroundColor: theme.centerChannelBg,
flexDirection: 'row',
paddingLeft: 12,
paddingRight: 20,
marginVertical: 10
marginVertical: 10,
},
sectionMessage: {
marginLeft: 12,
flex: 1
}
flex: 1,
},
};
});

View file

@ -11,7 +11,7 @@ function mapStateToProps(state) {
return {
channelIsLoading: state.views.channel.loading,
deviceWidth,
theme: getTheme(state)
theme: getTheme(state),
};
}

View file

@ -9,7 +9,7 @@ export default class CheckMark extends PureComponent {
static propTypes = {
width: PropTypes.number.isRequired,
height: PropTypes.number.isRequired,
color: PropTypes.string.isRequired
color: PropTypes.string.isRequired,
};
render() {

View file

@ -8,7 +8,7 @@ import {
Animated,
Linking,
TouchableOpacity,
View
View,
} from 'react-native';
import {intlShape} from 'react-intl';
import DeviceInfo from 'react-native-device-info';
@ -27,7 +27,7 @@ export default class ClientUpgradeListener extends PureComponent {
static propTypes = {
actions: PropTypes.shape({
logError: PropTypes.func.isRequired,
setLastUpgradeCheck: PropTypes.func.isRequired
setLastUpgradeCheck: PropTypes.func.isRequired,
}).isRequired,
currentVersion: PropTypes.string,
downloadLink: PropTypes.string,
@ -37,11 +37,11 @@ export default class ClientUpgradeListener extends PureComponent {
latestVersion: PropTypes.string,
minVersion: PropTypes.string,
navigator: PropTypes.object,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
static contextTypes = {
intl: intlShape
intl: intlShape,
};
constructor(props) {
@ -54,7 +54,7 @@ export default class ClientUpgradeListener extends PureComponent {
});
this.state = {
top: new Animated.Value(-100)
top: new Animated.Value(-100),
};
}
@ -108,7 +108,7 @@ export default class ClientUpgradeListener extends PureComponent {
}
Animated.timing(this.state.top, {
toValue,
duration: 300
duration: 300,
}).start();
};
@ -128,11 +128,11 @@ export default class ClientUpgradeListener extends PureComponent {
Alert.alert(
intl.formatMessage({
id: 'mobile.client_upgrade.download_error.title',
defaultMessage: 'Upgrade Error'
defaultMessage: 'Upgrade Error',
}),
intl.formatMessage({
id: 'mobile.client_upgrade.download_error.message',
defaultMessage: 'An error occurred while trying to open the download link.'
defaultMessage: 'An error occurred while trying to open the download link.',
})
);
@ -152,17 +152,17 @@ export default class ClientUpgradeListener extends PureComponent {
navigatorStyle: {
navBarHidden: false,
statusBarHidden: false,
statusBarHideWithNavBar: false
statusBarHideWithNavBar: false,
},
navigatorButtons: {
leftButtons: [{
id: 'close-upgrade',
icon: this.closeButton
}]
icon: this.closeButton,
}],
},
passProps: {
upgradeType: this.state.upgradeType
}
upgradeType: this.state.upgradeType,
},
});
this.toggleUpgradeMessage(false);
@ -226,28 +226,28 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
justifyContent: 'space-around',
borderTopColor: changeOpacity(theme.centerChannelColor, 0.2),
backgroundColor: changeOpacity(theme.centerChannelColor, 0.06),
borderTopWidth: 1
borderTopWidth: 1,
},
button: {
color: theme.linkColor,
fontSize: 13,
paddingHorizontal: 5,
paddingVertical: 5
paddingVertical: 5,
},
container: {
flex: 1,
backgroundColor: changeOpacity(theme.centerChannelBg, 0.8),
borderRadius: 5
borderRadius: 5,
},
message: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
alignItems: 'center',
},
messageText: {
fontSize: 16,
color: changeOpacity(theme.centerChannelColor, 0.8),
fontWeight: '600'
fontWeight: '600',
},
wrapper: {
position: 'absolute',
@ -262,10 +262,10 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
shadowColor: theme.centerChannelColor,
shadowOffset: {
width: 0,
height: 3
height: 3,
},
shadowOpacity: 0.2,
shadowRadius: 2
}
shadowRadius: 2,
},
};
});

View file

@ -21,7 +21,7 @@ function mapStateToProps(state) {
lastUpgradeCheck: state.views.clientUpgrade.lastUpdateCheck,
latestVersion,
minVersion,
theme: getTheme(state)
theme: getTheme(state),
};
}
@ -29,8 +29,8 @@ function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
logError,
setLastUpgradeCheck
}, dispatch)
setLastUpgradeCheck,
}, dispatch),
};
}

View file

@ -10,7 +10,7 @@ import CustomPropTypes from 'app/constants/custom_prop_types';
export default class ConditionalTouchable extends React.PureComponent {
static propTypes = {
touchable: PropTypes.bool,
children: CustomPropTypes.Children.isRequired
children: CustomPropTypes.Children.isRequired,
};
render() {

View file

@ -5,7 +5,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import {
Text,
View
View,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import {makeStyleSheetFromTheme, changeOpacity} from 'app/utils/theme';
@ -17,7 +17,7 @@ export default class ChannelListRow extends React.PureComponent {
id: PropTypes.string.isRequired,
theme: PropTypes.object.isRequired,
channel: PropTypes.object.isRequired,
...CustomListRow.propTypes
...CustomListRow.propTypes,
};
onPress = () => {
@ -70,25 +70,25 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
return {
titleContainer: {
alignItems: 'center',
flexDirection: 'row'
flexDirection: 'row',
},
displayName: {
fontSize: 16,
color: theme.centerChannelColor,
marginLeft: 5
marginLeft: 5,
},
icon: {
fontSize: 16,
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
container: {
flex: 1,
flexDirection: 'column'
flexDirection: 'column',
},
purpose: {
marginTop: 7,
fontSize: 13,
color: changeOpacity(theme.centerChannelColor, 0.5)
}
color: changeOpacity(theme.centerChannelColor, 0.5),
},
};
});

View file

@ -15,7 +15,7 @@ function makeMapStateToProps() {
return (state, ownProps) => {
return {
theme: getTheme(state),
channel: getChannel(state, ownProps)
channel: getChannel(state, ownProps),
};
};
}

View file

@ -4,7 +4,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import {
View
View,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
@ -19,11 +19,11 @@ export default class CustomListRow extends React.PureComponent {
enabled: PropTypes.bool,
selectable: PropTypes.bool,
selected: PropTypes.bool,
children: CustomPropTypes.Children
children: CustomPropTypes.Children,
};
static defaultProps = {
enabled: true
enabled: true,
};
render() {
@ -62,11 +62,11 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
height: 65,
paddingHorizontal: 15,
alignItems: 'center',
backgroundColor: theme.centerChannelBg
backgroundColor: theme.centerChannelBg,
},
displayName: {
fontSize: 15,
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
selector: {
height: 28,
@ -75,20 +75,20 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
borderWidth: 1,
borderColor: '#888',
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
selectorContainer: {
height: 50,
paddingRight: 15,
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
selectorDisabled: {
backgroundColor: '#888'
backgroundColor: '#888',
},
selectorFilled: {
backgroundColor: '#378FD2',
borderWidth: 0
}
borderWidth: 0,
},
};
});

View file

@ -26,7 +26,7 @@ export default class CustomList extends PureComponent {
onRowSelect: PropTypes.func,
renderRow: PropTypes.func.isRequired,
createSections: PropTypes.func,
showNoResults: PropTypes.bool
showNoResults: PropTypes.bool,
};
static defaultProps = {
@ -40,7 +40,7 @@ export default class CustomList extends PureComponent {
selectable: false,
createSections: () => true,
showSections: true,
showNoResults: true
showNoResults: true,
};
constructor(props) {
@ -64,7 +64,7 @@ export default class CustomList extends PureComponent {
const dataSource = showSections ? this.state.dataSource.cloneWithRowsAndSections(mergedData) : this.state.dataSource.cloneWithRows(mergedData);
this.setState({
data: mergedData,
dataSource
dataSource,
});
}
}
@ -72,7 +72,7 @@ export default class CustomList extends PureComponent {
buildDataSource = (props) => {
const ds = new ListView.DataSource({
rowHasChanged: (r1, r2) => r1 !== r2,
sectionHeaderHasChanged: (s1, s2) => s1 !== s2
sectionHeaderHasChanged: (s1, s2) => s1 !== s2,
});
let newData = props.data;
if (props.showSections) {
@ -81,7 +81,7 @@ export default class CustomList extends PureComponent {
const dataSource = props.showSections ? ds.cloneWithRowsAndSections(newData) : ds.cloneWithRows(newData);
return {
data: newData,
dataSource
dataSource,
};
};
@ -97,7 +97,7 @@ export default class CustomList extends PureComponent {
const dataSource = this.state.dataSource.cloneWithRowsAndSections(mergedData);
this.setState({
data: mergedData,
dataSource
dataSource,
}, () => this.props.onRowSelect(id));
};
@ -118,7 +118,7 @@ export default class CustomList extends PureComponent {
item,
selected: item.selected,
selectable: this.props.selectable,
onPress: this.props.onRowPress
onPress: this.props.onRowPress,
};
if ('disableSelect' in item) {
@ -181,7 +181,7 @@ export default class CustomList extends PureComponent {
searching,
showNoResults,
showSections,
theme
theme,
} = this.props;
const {dataSource} = this.state;
const style = getStyleFromTheme(theme);
@ -245,45 +245,45 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
backgroundColor: theme.centerChannelBg,
...Platform.select({
android: {
marginBottom: 20
}
})
marginBottom: 20,
},
}),
},
loadingText: {
color: changeOpacity(theme.centerChannelColor, 0.6)
color: changeOpacity(theme.centerChannelColor, 0.6),
},
searching: {
backgroundColor: theme.centerChannelBg,
height: '100%',
position: 'absolute',
width: '100%'
width: '100%',
},
sectionContainer: {
backgroundColor: changeOpacity(theme.centerChannelColor, 0.07),
paddingLeft: 10,
paddingVertical: 2
paddingVertical: 2,
},
sectionWrapper: {
backgroundColor: theme.centerChannelBg
backgroundColor: theme.centerChannelBg,
},
sectionText: {
fontWeight: '600',
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
separator: {
height: 1,
flex: 1,
backgroundColor: changeOpacity(theme.centerChannelColor, 0.1)
backgroundColor: changeOpacity(theme.centerChannelColor, 0.1),
},
noResultContainer: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
noResultText: {
fontSize: 26,
color: changeOpacity(theme.centerChannelColor, 0.5)
}
color: changeOpacity(theme.centerChannelColor, 0.5),
},
};
});

View file

@ -13,7 +13,7 @@ function mapStateToProps(state, ownProps) {
isMyUser: getCurrentUserId(state) === ownProps.id,
theme: getTheme(state),
user: getUser(state, ownProps.id),
teammateNameDisplay: getTeammateNameDisplaySetting(state)
teammateNameDisplay: getTeammateNameDisplaySetting(state),
};
}

View file

@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import {intlShape} from 'react-intl';
import {
Text,
View
View,
} from 'react-native';
import ProfilePicture from 'app/components/profile_picture';
import {makeStyleSheetFromTheme, changeOpacity} from 'app/utils/theme';
@ -22,11 +22,11 @@ export default class UserListRow extends React.PureComponent {
theme: PropTypes.object.isRequired,
user: PropTypes.object.isRequired,
teammateNameDisplay: PropTypes.string.isRequired,
...CustomListRow.propTypes
...CustomListRow.propTypes,
};
static contextTypes = {
intl: intlShape
intl: intlShape,
};
onPress = () => {
@ -44,7 +44,7 @@ export default class UserListRow extends React.PureComponent {
selected,
teammateNameDisplay,
theme,
user
user,
} = this.props;
const {id, username} = user;
@ -54,7 +54,7 @@ export default class UserListRow extends React.PureComponent {
if (isMyUser) {
usernameDisplay = formatMessage({
id: 'mobile.more_dms.you',
defaultMessage: '(@{username} - you)'
defaultMessage: '(@{username} - you)',
}, {username});
}
@ -99,24 +99,24 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
height: 65,
paddingHorizontal: 15,
alignItems: 'center',
backgroundColor: theme.centerChannelBg
backgroundColor: theme.centerChannelBg,
},
displayName: {
fontSize: 15,
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
icon: {
fontSize: 20,
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
textContainer: {
flexDirection: 'row',
marginLeft: 5
marginLeft: 5,
},
username: {
marginLeft: 5,
fontSize: 15,
color: changeOpacity(theme.centerChannelColor, 0.5)
color: changeOpacity(theme.centerChannelColor, 0.5),
},
selector: {
height: 28,
@ -125,20 +125,20 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
borderWidth: 1,
borderColor: '#888',
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
selectorContainer: {
height: 50,
paddingRight: 15,
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
selectorDisabled: {
backgroundColor: '#888'
backgroundColor: '#888',
},
selectorFilled: {
backgroundColor: '#378FD2',
borderWidth: 0
}
borderWidth: 0,
},
};
});

View file

@ -6,7 +6,7 @@ import {
Platform,
SectionList,
Text,
View
View,
} from 'react-native';
import Loading from 'app/components/loading';
@ -85,7 +85,7 @@ export default class CustomSectionList extends React.PureComponent {
/*
* How many items to render when the list is first rendered.
*/
initialNumToRender: PropTypes.number
initialNumToRender: PropTypes.number,
};
static defaultProps = {
@ -96,21 +96,21 @@ export default class CustomSectionList extends React.PureComponent {
onListEndReached: () => true,
onListEndReachedThreshold: 50,
loadingText: null,
initialNumToRender: 10
initialNumToRender: 10,
};
constructor(props) {
super(props);
this.state = {
sections: this.extractSections(props.items)
sections: this.extractSections(props.items),
};
}
componentWillReceiveProps(nextProps) {
if (nextProps.items !== this.props.items) {
this.setState({
sections: this.extractSections(nextProps.items)
sections: this.extractSections(nextProps.items),
});
}
}
@ -134,7 +134,7 @@ export default class CustomSectionList extends React.PureComponent {
return sectionKeys.map((sectionKey) => {
return {
key: sectionKey,
data: sections[sectionKey].sort(this.props.compareItems)
data: sections[sectionKey].sort(this.props.compareItems),
};
});
}
@ -156,7 +156,7 @@ export default class CustomSectionList extends React.PureComponent {
const props = {
id: item.id,
item,
onPress: this.props.onRowPress
onPress: this.props.onRowPress,
};
// Allow passing in a component like UserListRow or ChannelListRow
@ -258,51 +258,51 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme) => {
backgroundColor: theme.centerChannelBg,
...Platform.select({
android: {
marginBottom: 20
}
})
marginBottom: 20,
},
}),
},
loading: {
height: 70,
backgroundColor: theme.centerChannelBg,
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
loadingText: {
color: changeOpacity(theme.centerChannelColor, 0.6)
color: changeOpacity(theme.centerChannelColor, 0.6),
},
searching: {
backgroundColor: theme.centerChannelBg,
height: '100%',
position: 'absolute',
width: '100%'
width: '100%',
},
sectionContainer: {
backgroundColor: changeOpacity(theme.centerChannelColor, 0.07),
paddingLeft: 10,
paddingVertical: 2
paddingVertical: 2,
},
sectionWrapper: {
backgroundColor: theme.centerChannelBg
backgroundColor: theme.centerChannelBg,
},
sectionText: {
fontWeight: '600',
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
separator: {
height: 1,
flex: 1,
backgroundColor: changeOpacity(theme.centerChannelColor, 0.1)
backgroundColor: changeOpacity(theme.centerChannelColor, 0.1),
},
noResultContainer: {
flex: 1,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
noResultText: {
fontSize: 26,
color: changeOpacity(theme.centerChannelColor, 0.5)
}
color: changeOpacity(theme.centerChannelColor, 0.5),
},
};
});

View file

@ -11,7 +11,7 @@ export default class Drawer extends BaseDrawer {
...BaseDrawer.propTypes,
onRequestClose: PropTypes.func.isRequired,
bottomPanOffset: PropTypes.number,
topPanOffset: PropTypes.number
topPanOffset: PropTypes.number,
};
constructor(props) {

View file

@ -8,7 +8,7 @@ import {
TouchableWithoutFeedback,
View,
Text,
findNodeHandle
findNodeHandle,
} from 'react-native';
import {KeyboardAwareScrollView} from 'react-native-keyboard-aware-scroll-view';
@ -47,11 +47,11 @@ export default class EditChannelInfo extends PureComponent {
oldDisplayName: PropTypes.string,
oldChannelURL: PropTypes.string,
oldHeader: PropTypes.string,
oldPurpose: PropTypes.string
oldPurpose: PropTypes.string,
};
static defaultProps = {
editing: false
editing: false,
};
blur = () => {
@ -96,7 +96,7 @@ export default class EditChannelInfo extends PureComponent {
this.props.navigator.pop({animated: true});
} else {
this.props.navigator.dismissModal({
animationType: 'slide-down'
animationType: 'slide-down',
});
}
};
@ -110,7 +110,7 @@ export default class EditChannelInfo extends PureComponent {
oldDisplayName,
oldChannelURL,
oldPurpose,
oldHeader
oldHeader,
} = this.props;
return displayName !== oldDisplayName || channelURL !== oldChannelURL ||
@ -190,7 +190,7 @@ export default class EditChannelInfo extends PureComponent {
displayName,
channelURL,
header,
purpose
purpose,
} = this.props;
const {error, saving} = this.props;
const fullUrl = currentTeamUrl + '/channels';
@ -374,54 +374,54 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
return {
container: {
flex: 1,
backgroundColor: theme.centerChannelBg
backgroundColor: theme.centerChannelBg,
},
scrollView: {
flex: 1,
backgroundColor: changeOpacity(theme.centerChannelColor, 0.03),
paddingTop: 10
paddingTop: 10,
},
errorContainer: {
backgroundColor: changeOpacity(theme.centerChannelColor, 0.03)
backgroundColor: changeOpacity(theme.centerChannelColor, 0.03),
},
errorWrapper: {
justifyContent: 'center',
alignItems: 'center'
alignItems: 'center',
},
inputContainer: {
marginTop: 10,
backgroundColor: '#fff'
backgroundColor: '#fff',
},
input: {
color: '#333',
fontSize: 14,
height: 40,
paddingHorizontal: 15
paddingHorizontal: 15,
},
titleContainer30: {
flexDirection: 'row',
marginTop: 30
marginTop: 30,
},
titleContainer15: {
flexDirection: 'row',
marginTop: 15
marginTop: 15,
},
title: {
fontSize: 14,
color: theme.centerChannelColor,
marginLeft: 15
marginLeft: 15,
},
optional: {
color: changeOpacity(theme.centerChannelColor, 0.5),
fontSize: 14,
marginLeft: 5
marginLeft: 5,
},
helpText: {
fontSize: 14,
color: changeOpacity(theme.centerChannelColor, 0.5),
marginTop: 10,
marginHorizontal: 15
}
marginHorizontal: 15,
},
};
});

View file

@ -8,7 +8,7 @@ import {
PixelRatio,
Platform,
StyleSheet,
Text
Text,
} from 'react-native';
import FastImage from 'react-native-fast-image';
@ -46,14 +46,14 @@ export default class Emoji extends React.PureComponent {
literal: PropTypes.string,
size: PropTypes.number,
textStyle: CustomPropTypes.Style,
token: PropTypes.string.isRequired
token: PropTypes.string.isRequired,
};
static defaultProps = {
customEmojis: new Map(),
literal: '',
imageUrl: '',
isCustomEmoji: false
isCustomEmoji: false,
};
constructor(props) {
@ -61,7 +61,7 @@ export default class Emoji extends React.PureComponent {
this.state = {
originalWidth: 0,
originalHeight: 0
originalHeight: 0,
};
}
@ -76,7 +76,7 @@ export default class Emoji extends React.PureComponent {
if (nextProps.emojiName !== this.props.emojiName) {
this.setState({
originalWidth: 0,
originalHeight: 0
originalHeight: 0,
});
}
@ -95,7 +95,7 @@ export default class Emoji extends React.PureComponent {
if (this.mounted) {
this.setState({
originalWidth,
originalHeight
originalHeight,
});
}
});
@ -107,7 +107,7 @@ export default class Emoji extends React.PureComponent {
textStyle,
token,
imageUrl,
displayTextOnly
displayTextOnly,
} = this.props;
let size = this.props.size;
@ -125,8 +125,8 @@ export default class Emoji extends React.PureComponent {
const source = {
uri: imageUrl,
headers: {
Authorization: `Bearer ${token}`
}
Authorization: `Bearer ${token}`,
},
};
let width = size;

View file

@ -38,7 +38,7 @@ function mapStateToProps(state, ownProps) {
imageUrl,
isCustomEmoji,
displayTextOnly,
token: state.entities.general.credentials.token
token: state.entities.general.credentials.token,
};
}

View file

@ -12,7 +12,7 @@ import {
SectionList,
Text,
TouchableOpacity,
View
View,
} from 'react-native';
import DeviceInfo from 'react-native-device-info';
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
@ -50,16 +50,16 @@ export default class EmojiPicker extends PureComponent {
actions: PropTypes.shape({
getCustomEmojis: PropTypes.func.isRequired,
incrementEmojiPickerPage: PropTypes.func.isRequired,
searchCustomEmojis: PropTypes.func.isRequired
}).isRequired
searchCustomEmojis: PropTypes.func.isRequired,
}).isRequired,
};
static defaultProps = {
onEmojiPress: emptyFunction
onEmojiPress: emptyFunction,
};
static contextTypes = {
intl: intlShape.isRequired
intl: intlShape.isRequired,
};
constructor(props) {
@ -69,7 +69,7 @@ export default class EmojiPicker extends PureComponent {
getItemHeight: () => {
return EMOJI_SIZE + (EMOJI_GUTTER * 2);
},
getSectionHeaderHeight: () => SECTION_HEADER_HEIGHT
getSectionHeaderHeight: () => SECTION_HEADER_HEIGHT,
});
const emojis = this.renderableEmojis(props.emojisBySection, props.deviceWidth);
@ -83,7 +83,7 @@ export default class EmojiPicker extends PureComponent {
filteredEmojis: [],
searchTerm: '',
currentSectionIndex: 0,
missingPages: isMinimumServerVersion(this.props.serverVersion, 4, 7)
missingPages: isMinimumServerVersion(this.props.serverVersion, 4, 7),
};
}
@ -104,7 +104,7 @@ export default class EmojiPicker extends PureComponent {
if (rebuildEmojis) {
const emojis = this.renderableEmojis(this.props.emojisBySection, nextProps.deviceWidth);
this.setState({
emojis
emojis,
});
}
}
@ -116,7 +116,7 @@ export default class EmojiPicker extends PureComponent {
const data = [];
let row = {
key: `${section.key}-0`,
items: []
items: [],
};
section.data.forEach((emoji, index) => {
@ -124,7 +124,7 @@ export default class EmojiPicker extends PureComponent {
data.push(row);
row = {
key: `${section.key}-${index}`,
items: []
items: [],
};
}
@ -143,7 +143,7 @@ export default class EmojiPicker extends PureComponent {
return {
...section,
data
data,
};
});
@ -163,7 +163,7 @@ export default class EmojiPicker extends PureComponent {
changeSearchTerm = (text) => {
const nextState = {
searchTerm: text
searchTerm: text,
};
if (!text) {
@ -180,7 +180,7 @@ export default class EmojiPicker extends PureComponent {
}
const filteredEmojis = this.searchEmojis(text);
this.setState({
filteredEmojis
filteredEmojis,
});
}, timeout);
};
@ -189,7 +189,7 @@ export default class EmojiPicker extends PureComponent {
this.setState({
currentSectionIndex: 0,
filteredEmojis: [],
searchTerm: ''
searchTerm: '',
});
};
@ -285,7 +285,7 @@ export default class EmojiPicker extends PureComponent {
if (nextIndex !== this.state.currentSectionIndex) {
this.setState({
currentSectionIndex: nextIndex
currentSectionIndex: nextIndex,
});
}
};
@ -293,7 +293,7 @@ export default class EmojiPicker extends PureComponent {
onMomentumScrollEnd = () => {
if (this.state.jumpToSection) {
this.setState({
jumpToSection: false
jumpToSection: false,
});
}
};
@ -301,12 +301,12 @@ export default class EmojiPicker extends PureComponent {
scrollToSection = (index) => {
this.setState({
jumpToSection: true,
currentSectionIndex: index
currentSectionIndex: index,
}, () => {
this.sectionList.scrollToLocation({
sectionIndex: index,
itemIndex: 0,
viewOffset: 25
viewOffset: 25,
});
});
};
@ -447,9 +447,9 @@ export default class EmojiPicker extends PureComponent {
fontSize: 13,
...Platform.select({
android: {
marginBottom: -3
}
})
marginBottom: -3,
},
}),
};
return (
@ -499,7 +499,7 @@ const getStyleSheetFromTheme = makeStyleSheetFromTheme((theme) => {
borderTopColor: changeOpacity(theme.centerChannelColor, 0.3),
borderTopWidth: 1,
flexDirection: 'row',
justifyContent: 'space-between'
justifyContent: 'space-between',
},
bottomContentWrapper: {
position: 'absolute',
@ -507,43 +507,43 @@ const getStyleSheetFromTheme = makeStyleSheetFromTheme((theme) => {
left: 0,
right: 0,
height: 35,
width: '100%'
width: '100%',
},
columnStyle: {
alignSelf: 'stretch',
flexDirection: 'row',
marginVertical: EMOJI_GUTTER,
justifyContent: 'flex-start'
justifyContent: 'flex-start',
},
container: {
alignItems: 'center',
backgroundColor: theme.centerChannelBg,
flex: 1
flex: 1,
},
emoji: {
width: EMOJI_SIZE,
height: EMOJI_SIZE,
marginHorizontal: EMOJI_GUTTER,
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
emojiLeft: {
marginLeft: 0
marginLeft: 0,
},
emojiRight: {
marginRight: 0
marginRight: 0,
},
flatList: {
flex: 1,
backgroundColor: theme.centerChannelBg,
alignSelf: 'stretch'
alignSelf: 'stretch',
},
flatListEmoji: {
marginRight: 5
marginRight: 5,
},
flatListEmojiName: {
fontSize: 13,
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
flatListRow: {
height: 40,
@ -556,47 +556,47 @@ const getStyleSheetFromTheme = makeStyleSheetFromTheme((theme) => {
borderLeftWidth: 1,
borderLeftColor: changeOpacity(theme.centerChannelColor, 0.2),
borderRightWidth: 1,
borderRightColor: changeOpacity(theme.centerChannelColor, 0.2)
borderRightColor: changeOpacity(theme.centerChannelColor, 0.2),
},
listView: {
backgroundColor: theme.centerChannelBg,
marginBottom: 35
marginBottom: 35,
},
searchBar: {
backgroundColor: changeOpacity(theme.centerChannelColor, 0.2),
paddingVertical: 5
paddingVertical: 5,
},
section: {
alignItems: 'center'
alignItems: 'center',
},
sectionIcon: {
color: changeOpacity(theme.centerChannelColor, 0.3)
color: changeOpacity(theme.centerChannelColor, 0.3),
},
sectionIconContainer: {
flex: 1,
height: 35,
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
sectionIconHighlight: {
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
sectionTitle: {
color: changeOpacity(theme.centerChannelColor, 0.2),
fontSize: 15,
fontWeight: '700'
fontWeight: '700',
},
sectionTitleContainer: {
height: SECTION_HEADER_HEIGHT,
justifyContent: 'center',
backgroundColor: theme.centerChannelBg
backgroundColor: theme.centerChannelBg,
},
wrapper: {
flex: 1
flex: 1,
},
loading: {
flex: 1,
alignItems: 'center'
}
alignItems: 'center',
},
};
});

View file

@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import {
StyleSheet,
TouchableOpacity,
View
View,
} from 'react-native';
import shallowEqual from 'shallow-equals';
@ -17,7 +17,7 @@ export default class EmojiPickerRow extends Component {
emojiGutter: PropTypes.number.isRequired,
emojiSize: PropTypes.number.isRequired,
items: PropTypes.array.isRequired,
onEmojiPress: PropTypes.func.isRequired
onEmojiPress: PropTypes.func.isRequired,
}
shouldComponentUpdate(nextProps) {
@ -32,8 +32,8 @@ export default class EmojiPickerRow extends Component {
{
width: emojiSize,
height: emojiSize,
marginHorizontal: emojiGutter
}
marginHorizontal: emojiGutter,
},
];
if (index === 0) {
style.push(styles.emojiLeft);
@ -81,16 +81,16 @@ const styles = StyleSheet.create({
columnStyle: {
alignSelf: 'stretch',
flexDirection: 'row',
justifyContent: 'space-between'
justifyContent: 'space-between',
},
emoji: {
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
emojiLeft: {
marginLeft: 0
marginLeft: 0,
},
emojiRight: {
marginRight: 0
}
marginRight: 0,
},
});

View file

@ -22,60 +22,60 @@ const categoryToI18n = {
activity: {
id: 'mobile.emoji_picker.activity',
defaultMessage: 'ACTIVITY',
icon: 'futbol-o'
icon: 'futbol-o',
},
custom: {
id: 'mobile.emoji_picker.custom',
defaultMessage: 'CUSTOM',
icon: 'at'
icon: 'at',
},
flags: {
id: 'mobile.emoji_picker.flags',
defaultMessage: 'FLAGS',
icon: 'flag-o'
icon: 'flag-o',
},
foods: {
id: 'mobile.emoji_picker.foods',
defaultMessage: 'FOODS',
icon: 'cutlery'
icon: 'cutlery',
},
nature: {
id: 'mobile.emoji_picker.nature',
defaultMessage: 'NATURE',
icon: 'leaf'
icon: 'leaf',
},
objects: {
id: 'mobile.emoji_picker.objects',
defaultMessage: 'OBJECTS',
icon: 'lightbulb-o'
icon: 'lightbulb-o',
},
people: {
id: 'mobile.emoji_picker.people',
defaultMessage: 'PEOPLE',
icon: 'smile-o'
icon: 'smile-o',
},
places: {
id: 'mobile.emoji_picker.places',
defaultMessage: 'PLACES',
icon: 'plane'
icon: 'plane',
},
recent: {
id: 'mobile.emoji_picker.recent',
defaultMessage: 'RECENTLY USED',
icon: 'clock-o'
icon: 'clock-o',
},
symbols: {
id: 'mobile.emoji_picker.symbols',
defaultMessage: 'SYMBOLS',
icon: 'heart-o'
}
icon: 'heart-o',
},
};
function fillEmoji(indice) {
const emoji = Emojis[indice];
return {
name: emoji.aliases[0],
aliases: emoji.aliases
aliases: emoji.aliases,
};
}
@ -89,7 +89,7 @@ const getEmojisBySection = createSelector(
const section = {
...categoryToI18n[category],
key: category,
data: items
data: items,
};
return section;
@ -99,14 +99,14 @@ const getEmojisBySection = createSelector(
for (const [key] of customEmojis) {
customEmojiItems.push({
name: key
name: key,
});
}
emoticons.push({
...categoryToI18n.custom,
key: 'custom',
data: customEmojiItems
data: customEmojiItems,
});
if (recentEmojis.length) {
@ -115,7 +115,7 @@ const getEmojisBySection = createSelector(
emoticons.unshift({
...categoryToI18n.recent,
key: 'recent',
data: items
data: items,
});
}
@ -145,7 +145,7 @@ function mapStateToProps(state) {
location: 0,
distance: 100,
minMatchCharLength: 2,
maxPatternLength: 32
maxPatternLength: 32,
};
const list = emojis.length ? emojis : [];
@ -160,7 +160,7 @@ function mapStateToProps(state) {
theme: getTheme(state),
customEmojisEnabled: getConfig(state).EnableCustomEmoji === 'true',
customEmojiPage: state.views.emoji.emojiPickerCustomPage,
serverVersion: state.entities.general.serverVersion || Client4.getServerVersion()
serverVersion: state.entities.general.serverVersion || Client4.getServerVersion(),
};
}
@ -169,8 +169,8 @@ function mapDispatchToProps(dispatch) {
actions: bindActionCreators({
getCustomEmojis,
incrementEmojiPickerPage,
searchCustomEmojis
}, dispatch)
searchCustomEmojis,
}, dispatch),
};
}

View file

@ -7,7 +7,7 @@ import {
Dimensions,
StyleSheet,
View,
TouchableOpacity
TouchableOpacity,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import FormattedText from 'app/components/formatted_text';
@ -25,22 +25,22 @@ const style = StyleSheet.create({
borderColor: '#fff',
borderWidth: 1,
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
closeButtonContainer: {
alignItems: 'center',
justifyContent: 'center',
marginTop: 5
marginTop: 5,
},
closeButtonText: {
color: '#fff'
color: '#fff',
},
container: {
paddingTop: 15,
paddingBottom: 15,
alignItems: 'center',
justifyContent: 'center',
minHeight: 75
minHeight: 75,
},
wrapper: {
position: 'absolute',
@ -49,17 +49,17 @@ const style = StyleSheet.create({
width: deviceWidth,
overflow: 'hidden',
backgroundColor: 'rgba(255, 116, 92, 1)',
zIndex: 99999
}
zIndex: 99999,
},
});
export default class ErrorList extends PureComponent {
static propTypes = {
actions: PropTypes.shape({
dismissError: PropTypes.func.isRequired,
clearErrors: PropTypes.func.isRequired
clearErrors: PropTypes.func.isRequired,
}).isRequired,
errors: PropTypes.array.isRequired
errors: PropTypes.array.isRequired,
}
renderErrorsList() {

View file

@ -7,7 +7,7 @@ import {
StyleSheet,
View,
Text,
TouchableOpacity
TouchableOpacity,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
@ -16,22 +16,22 @@ const style = StyleSheet.create({
width: 25,
height: 25,
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
buttons: {
marginHorizontal: 15
marginHorizontal: 15,
},
container: {
alignSelf: 'stretch',
paddingHorizontal: 15,
paddingVertical: 8,
flexDirection: 'row',
alignItems: 'center'
alignItems: 'center',
},
message: {
flex: 1,
color: '#fff'
}
color: '#fff',
},
});
function GeneralError(props) {
@ -66,7 +66,7 @@ function GeneralError(props) {
GeneralError.propTypes = {
dismiss: PropTypes.func.isRequired,
error: PropTypes.object.isRequired
error: PropTypes.object.isRequired,
};
export default GeneralError;

View file

@ -11,7 +11,7 @@ import ErrorList from './error_list';
function mapStateToProps(state) {
return {
errors: getDisplayableErrors(state)
errors: getDisplayableErrors(state),
};
}
@ -19,8 +19,8 @@ function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
dismissError,
clearErrors
}, dispatch)
clearErrors,
}, dispatch),
};
}

View file

@ -16,7 +16,7 @@ class ErrorText extends PureComponent {
static propTypes = {
error: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
textStyle: CustomPropTypes.Style,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
render() {
@ -50,15 +50,15 @@ class ErrorText extends PureComponent {
const getStyleSheet = makeStyleSheetFromTheme((theme) => {
return {
errorLabel: {
color: (theme.errorTextColor || '#DA4A4A')
}
color: (theme.errorTextColor || '#DA4A4A'),
},
};
});
function mapStateToProps(state, ownProps) {
return {
...ownProps,
theme: getTheme(state)
theme: getTheme(state),
};
}

View file

@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import {
Text,
TouchableOpacity,
View
View,
} from 'react-native';
import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';
@ -23,12 +23,12 @@ export default class FileAttachment extends PureComponent {
file: PropTypes.object.isRequired,
onInfoPress: PropTypes.func,
onPreviewPress: PropTypes.func,
theme: PropTypes.object.isRequired
theme: PropTypes.object.isRequired,
};
static defaultProps = {
onInfoPress: () => true,
onPreviewPress: () => true
onPreviewPress: () => true,
};
handlePreviewPress = () => {
@ -117,43 +117,43 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
return {
downloadIcon: {
color: changeOpacity(theme.centerChannelColor, 0.7),
marginRight: 5
marginRight: 5,
},
fileDownloadContainer: {
flexDirection: 'row',
marginTop: 3
marginTop: 3,
},
fileInfo: {
marginLeft: 2,
fontSize: 14,
color: changeOpacity(theme.centerChannelColor, 0.5)
color: changeOpacity(theme.centerChannelColor, 0.5),
},
fileInfoContainer: {
flex: 1,
paddingHorizontal: 8,
paddingVertical: 5,
borderLeftWidth: 1,
borderLeftColor: changeOpacity(theme.centerChannelColor, 0.2)
borderLeftColor: changeOpacity(theme.centerChannelColor, 0.2),
},
fileName: {
flexDirection: 'column',
flexWrap: 'wrap',
marginLeft: 2,
fontSize: 14,
color: theme.centerChannelColor
color: theme.centerChannelColor,
},
fileWrapper: {
flex: 1,
flexDirection: 'row',
marginTop: 10,
borderWidth: 1,
borderColor: changeOpacity(theme.centerChannelColor, 0.2)
borderColor: changeOpacity(theme.centerChannelColor, 0.2),
},
circularProgress: {
width: '100%',
height: '100%',
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
circularProgressContent: {
position: 'absolute',
@ -162,7 +162,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
top: 0,
left: 0,
alignItems: 'center',
justifyContent: 'center'
}
justifyContent: 'center',
},
};
});

View file

@ -8,7 +8,7 @@ import {
Platform,
StyleSheet,
TouchableOpacity,
View
View,
} from 'react-native';
import OpenFile from 'react-native-doc-viewer';
import RNFetchBlob from 'react-native-fetch-blob';
@ -33,7 +33,7 @@ export const SUPPORTED_DOCS_FORMAT = [
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/xml',
'text/csv'
'text/csv',
];
export default class FileAttachmentDocument extends PureComponent {
@ -43,24 +43,24 @@ export default class FileAttachmentDocument extends PureComponent {
file: PropTypes.object.isRequired,
theme: PropTypes.object.isRequired,
wrapperHeight: PropTypes.number,
wrapperWidth: PropTypes.number
wrapperWidth: PropTypes.number,
};
static defaultProps = {
iconHeight: 65,
iconWidth: 65,
wrapperHeight: 100,
wrapperWidth: 100
wrapperWidth: 100,
};
static contextTypes = {
intl: intlShape
intl: intlShape,
};
state = {
didCancel: false,
downloading: false,
progress: 0
progress: 0,
};
componentDidMount() {
@ -102,7 +102,7 @@ export default class FileAttachmentDocument extends PureComponent {
timeout: 10000,
indicator: true,
overwrite: true,
path
path,
};
const exist = await RNFetchBlob.fs.exists(path);
@ -121,7 +121,7 @@ export default class FileAttachmentDocument extends PureComponent {
await this.downloadTask;
if (this.mounted) {
this.setState({
progress: 100
progress: 100,
}, () => {
// need to wait a bit for the progress circle UI to update to the give progress
this.openDocument(file);
@ -165,26 +165,26 @@ export default class FileAttachmentDocument extends PureComponent {
url: `${prefix}${path}`,
fileName: file.name,
fileType: file.extension,
cache: false
cache: false,
}], (error) => {
if (error) {
const {intl} = this.context;
Alert.alert(
intl.formatMessage({
id: 'mobile.document_preview.failed_title',
defaultMessage: 'Open Document failed'
defaultMessage: 'Open Document failed',
}),
intl.formatMessage({
id: 'mobile.document_preview.failed_description',
defaultMessage: 'An error occurred while opening the document. Please make sure you have a {fileType} viewer installed and try again.\n'
defaultMessage: 'An error occurred while opening the document. Please make sure you have a {fileType} viewer installed and try again.\n',
}, {
fileType: file.extension.toUpperCase()
fileType: file.extension.toUpperCase(),
}),
[{
text: intl.formatMessage({
id: 'mobile.server_upgrade.button',
defaultMessage: 'OK'
})
defaultMessage: 'OK',
}),
}]
);
RNFetchBlob.fs.unlink(path);
@ -199,7 +199,7 @@ export default class FileAttachmentDocument extends PureComponent {
if (this.mounted) {
this.setState({
progress: 0,
didCancel: true
didCancel: true,
}, () => {
// need to wait a bit for the progress circle UI to update to the give progress
setTimeout(() => this.setState({downloading: false}), 2000);
@ -230,17 +230,17 @@ export default class FileAttachmentDocument extends PureComponent {
Alert.alert(
intl.formatMessage({
id: 'mobile.downloader.failed_title',
defaultMessage: 'Download failed'
defaultMessage: 'Download failed',
}),
intl.formatMessage({
id: 'mobile.downloader.failed_description',
defaultMessage: 'An error occurred while downloading the file. Please check your internet connection and try again.\n'
defaultMessage: 'An error occurred while downloading the file. Please check your internet connection and try again.\n',
}),
[{
text: intl.formatMessage({
id: 'mobile.server_upgrade.button',
defaultMessage: 'OK'
})
defaultMessage: 'OK',
}),
}]
);
};
@ -290,7 +290,7 @@ const style = StyleSheet.create({
alignItems: 'center',
height: '100%',
justifyContent: 'center',
width: '100%'
width: '100%',
},
circularProgressContent: {
alignItems: 'center',
@ -298,6 +298,6 @@ const style = StyleSheet.create({
justifyContent: 'center',
left: 0,
position: 'absolute',
top: 0
}
top: 0,
},
});

View file

@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import {
View,
Image,
StyleSheet
StyleSheet,
} from 'react-native';
import * as Utils from 'mattermost-redux/utils/file_utils';
@ -32,7 +32,7 @@ const ICON_PATH_FROM_FILE_TYPE = {
presentation: pptIcon,
spreadsheet: excelIcon,
video: videoIcon,
word: wordIcon
word: wordIcon,
};
export default class FileAttachmentIcon extends PureComponent {
@ -41,14 +41,14 @@ export default class FileAttachmentIcon extends PureComponent {
iconHeight: PropTypes.number,
iconWidth: PropTypes.number,
wrapperHeight: PropTypes.number,
wrapperWidth: PropTypes.number
wrapperWidth: PropTypes.number,
};
static defaultProps = {
iconHeight: 60,
iconWidth: 60,
wrapperHeight: 100,
wrapperWidth: 100
wrapperWidth: 100,
};
getFileIconPath(file) {
@ -76,6 +76,6 @@ const styles = StyleSheet.create({
fileIconWrapper: {
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#fff'
}
backgroundColor: '#fff',
},
});

View file

@ -8,7 +8,7 @@ import {
Animated,
View,
Image,
StyleSheet
StyleSheet,
} from 'react-native';
import {Client4} from 'mattermost-redux/client';
@ -20,7 +20,7 @@ const {View: AnimatedView} = Animated;
const IMAGE_SIZE = {
Fullsize: 'fullsize',
Preview: 'preview',
Thumbnail: 'thumbnail'
Thumbnail: 'thumbnail',
};
export default class FileAttachmentImage extends PureComponent {
@ -32,7 +32,7 @@ export default class FileAttachmentImage extends PureComponent {
imageSize: PropTypes.oneOf([
IMAGE_SIZE.Fullsize,
IMAGE_SIZE.Preview,
IMAGE_SIZE.Thumbnail
IMAGE_SIZE.Thumbnail,
]),
imageWidth: PropTypes.number,
loadingBackgroundColor: PropTypes.string,
@ -40,7 +40,7 @@ export default class FileAttachmentImage extends PureComponent {
resizeMethod: PropTypes.string,
wrapperBackgroundColor: PropTypes.string,
wrapperHeight: PropTypes.number,
wrapperWidth: PropTypes.number
wrapperWidth: PropTypes.number,
};
static defaultProps = {
@ -54,13 +54,13 @@ export default class FileAttachmentImage extends PureComponent {
resizeMethod: 'resize',
wrapperBackgroundColor: '#fff',
wrapperHeigh: 100,
wrapperWidth: 100
wrapperWidth: 100,
};
state = {
opacity: new Animated.Value(0),
requesting: true,
retry: 0
retry: 0,
};
// Sometimes the request after a file upload errors out.
@ -71,7 +71,7 @@ export default class FileAttachmentImage extends PureComponent {
setTimeout(() => {
this.setState({
retry: (this.state.retry + 1),
timestamp: Date.now()
timestamp: Date.now(),
});
}, 300);
}
@ -79,12 +79,12 @@ export default class FileAttachmentImage extends PureComponent {
handleLoad = () => {
this.setState({
requesting: false
requesting: false,
});
Animated.timing(this.state.opacity, {
toValue: 1,
duration: 300
duration: 300,
}).start(() => {
this.props.addFileToFetchCache(this.handleGetImageURL());
});
@ -92,7 +92,7 @@ export default class FileAttachmentImage extends PureComponent {
handleLoadStart = () => {
this.setState({
requesting: true
requesting: true,
});
};
@ -137,7 +137,7 @@ export default class FileAttachmentImage extends PureComponent {
resizeMode,
wrapperBackgroundColor,
wrapperHeight,
wrapperWidth
wrapperWidth,
} = this.props;
let source = {};
@ -155,7 +155,7 @@ export default class FileAttachmentImage extends PureComponent {
const imageComponentLoaders = {
onError: isInFetchCache ? null : this.handleLoadError,
onLoadStart: isInFetchCache ? null : this.handleLoadStart,
onLoad: isInFetchCache ? null : this.handleLoad
onLoad: isInFetchCache ? null : this.handleLoad,
};
const opacity = isInFetchCache ? 1 : this.state.opacity;
@ -192,13 +192,13 @@ export default class FileAttachmentImage extends PureComponent {
const style = StyleSheet.create({
fileImageWrapper: {
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
loaderContainer: {
position: 'absolute',
height: '100%',
width: '100%',
alignItems: 'center',
justifyContent: 'center'
}
justifyContent: 'center',
},
});

View file

@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
import {
Keyboard,
View,
TouchableOpacity
TouchableOpacity,
} from 'react-native';
import {RequestStatus} from 'mattermost-redux/constants';
@ -28,7 +28,7 @@ export default class FileAttachmentList extends Component {
postId: PropTypes.string.isRequired,
theme: PropTypes.object.isRequired,
toggleSelected: PropTypes.func.isRequired,
filesForPostRequest: PropTypes.object.isRequired
filesForPostRequest: PropTypes.object.isRequired,
};
componentDidMount() {
@ -52,15 +52,15 @@ export default class FileAttachmentList extends Component {
animationType: 'none',
passProps: {
fileId,
postId
postId,
},
navigatorStyle: {
navBarHidden: true,
statusBarHidden: false,
statusBarHideWithNavBar: false,
screenBackgroundColor: 'black',
modalPresentationStyle: 'overCurrentContext'
}
modalPresentationStyle: 'overCurrentContext',
},
});
};

View file

@ -18,7 +18,7 @@ function makeMapStateToProps() {
fetchCache: state.views.fetchCache,
files: getFilesForPost(state, ownProps.postId),
theme: getTheme(state),
filesForPostRequest: state.requests.files.getFilesForPost
filesForPostRequest: state.requests.files.getFilesForPost,
};
};
}
@ -27,8 +27,8 @@ function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
addFileToFetchCache,
loadFilesForPostIfNecessary
}, dispatch)
loadFilesForPostIfNecessary,
}, dispatch),
};
}

View file

@ -8,7 +8,7 @@ import {
ScrollView,
StyleSheet,
TouchableOpacity,
View
View,
} from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
@ -21,7 +21,7 @@ export default class FileUploadPreview extends PureComponent {
actions: PropTypes.shape({
addFileToFetchCache: PropTypes.func.isRequired,
handleRemoveFile: PropTypes.func.isRequired,
retryFileUpload: PropTypes.func.isRequired
retryFileUpload: PropTypes.func.isRequired,
}).isRequired,
channelId: PropTypes.string.isRequired,
channelIsLoading: PropTypes.bool,
@ -33,7 +33,7 @@ export default class FileUploadPreview extends PureComponent {
rootId: PropTypes.string,
theme: PropTypes.object.isRequired,
filesUploadingForCurrentChannel: PropTypes.bool.isRequired,
showFileMaxWarning: PropTypes.bool.isRequired
showFileMaxWarning: PropTypes.bool.isRequired,
};
handleRetryFileUpload = (file) => {
@ -105,7 +105,7 @@ export default class FileUploadPreview extends PureComponent {
channelIsLoading,
filesUploadingForCurrentChannel,
deviceHeight,
files
files,
} = this.props;
if (channelIsLoading || (!files.length && !filesUploadingForCurrentChannel)) {
return null;
@ -141,7 +141,7 @@ const style = StyleSheet.create({
left: 0,
bottom: 0,
position: 'absolute',
width: '100%'
width: '100%',
},
failed: {
backgroundColor: 'rgba(0, 0, 0, 0.8)',
@ -149,12 +149,12 @@ const style = StyleSheet.create({
height: '100%',
width: '100%',
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
preview: {
justifyContent: 'flex-end',
height: 115,
width: 115
width: 115,
},
previewShadow: {
height: 100,
@ -168,18 +168,18 @@ const style = StyleSheet.create({
shadowRadius: 4,
shadowOffset: {
width: 0,
height: 0
}
}
})
height: 0,
},
},
}),
},
removeButtonIcon: Platform.select({
ios: {
marginTop: 2
marginTop: 2,
},
android: {
marginLeft: 1
}
marginLeft: 1,
},
}),
removeButtonWrapper: {
alignItems: 'center',
@ -194,19 +194,19 @@ const style = StyleSheet.create({
borderRadius: 12,
backgroundColor: '#000',
borderWidth: 1,
borderColor: '#fff'
borderColor: '#fff',
},
scrollView: {
flex: 1,
marginBottom: 12
marginBottom: 12,
},
scrollViewContent: {
alignItems: 'flex-end',
marginLeft: 14
marginLeft: 14,
},
warning: {
color: 'white',
marginLeft: 14,
marginBottom: 12
}
marginBottom: 12,
},
});

Some files were not shown because too many files have changed in this diff Show more