Change statuses and remove .scss suffix
This commit is contained in:
parent
f6e0785e6f
commit
b3dd84505e
@ -46,19 +46,19 @@ const propTypes = {
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
return null;
|
||||
},
|
||||
isOpen: PropTypes.bool,
|
||||
onHide: PropTypes.bool,
|
||||
onShow: PropTypes.bool,
|
||||
onHide: PropTypes.func,
|
||||
onShow: PropTypes.func,
|
||||
autoFocus: PropTypes.bool,
|
||||
};
|
||||
|
||||
const defaultProps = {
|
||||
children: null,
|
||||
isOpen: false,
|
||||
onShow: false,
|
||||
onHide: false,
|
||||
onShow: () => { },
|
||||
onHide: () => { },
|
||||
autoFocus: false,
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Icon from '/imports/ui/components/icon/component';
|
||||
import styles from './styles.scss';
|
||||
import styles from './styles';
|
||||
|
||||
const propTypes = {
|
||||
icon: PropTypes.string.isRequired,
|
||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { defineMessages, injectIntl } from 'react-intl';
|
||||
import { withRouter } from 'react-router';
|
||||
import styles from './styles.scss';
|
||||
import styles from './styles';
|
||||
|
||||
const intlMessages = defineMessages({
|
||||
unreadPlural: {
|
||||
|
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { withRouter, Link } from 'react-router';
|
||||
import cx from 'classnames';
|
||||
import { defineMessages, injectIntl } from 'react-intl';
|
||||
import styles from './styles.scss';
|
||||
import styles from './styles';
|
||||
import ChatAvatar from './chat-avatar/component';
|
||||
import ChatIcon from './chat-icon/component';
|
||||
import ChatUnreadMessages from './chat-unread-messages/component';
|
||||
|
@ -2,7 +2,7 @@ import React, { Component } from 'react';
|
||||
import { injectIntl } from 'react-intl';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withRouter } from 'react-router';
|
||||
import styles from './styles.scss';
|
||||
import styles from './styles';
|
||||
import UserListHeader from './user-list-header/component';
|
||||
import UserContent from './user-list-content/component';
|
||||
|
||||
|
@ -5,7 +5,7 @@ import Auth from '/imports/ui/services/auth';
|
||||
import UnreadMessages from '/imports/ui/services/unread-messages';
|
||||
import Storage from '/imports/ui/services/storage/session';
|
||||
import mapUser from '/imports/ui/services/user/mapUser';
|
||||
import { EMOJI_STATUSES } from '/imports/utils/statuses';
|
||||
import { EMOJI_STATUSES, EMOJI_NORMALIZE } from '/imports/utils/statuses';
|
||||
import _ from 'lodash';
|
||||
|
||||
const CHAT_CONFIG = Meteor.settings.public.chat;
|
||||
@ -37,21 +37,20 @@ const sortUsersByName = (a, b) => {
|
||||
};
|
||||
|
||||
const sortUsersByEmoji = (a, b) => {
|
||||
if ((EMOJI_STATUSES.indexOf(a.emoji.status) > -1)
|
||||
&& (EMOJI_STATUSES.indexOf(b.emoji.status) > -1)) {
|
||||
const emojiA = a in EMOJI_STATUSES ? EMOJI_STATUSES[a] : a;
|
||||
const emojiB = b in EMOJI_STATUSES ? EMOJI_STATUSES[b] : b;
|
||||
|
||||
if (emojiA && emojiB) {
|
||||
if (a.emoji.changedAt < b.emoji.changedAt) {
|
||||
return -1;
|
||||
} else if (a.emoji.changedAt > b.emoji.changedAt) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return sortUsersByName(a, b);
|
||||
} else if (EMOJI_STATUSES.indexOf(a.emoji.status) > -1) {
|
||||
} else if (emojiA) {
|
||||
return -1;
|
||||
} else if (EMOJI_STATUSES.indexOf(b.emoji.status) > -1) {
|
||||
} else if (emojiB) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
@ -213,7 +212,7 @@ const getAvailableActions = (currentUser, user, router, isBreakoutRoom) => {
|
||||
const allowedToChatPrivately = !user.isCurrent;
|
||||
const allowedToMuteAudio = hasAuthority && user.isVoiceUser && user.isMuted;
|
||||
const allowedToUnmuteAudio = hasAuthority && user.isVoiceUser && !user.isMuted;
|
||||
const allowedToResetStatus = hasAuthority && user.emoji.status !== 'none';
|
||||
const allowedToResetStatus = hasAuthority && user.emoji.status !== EMOJI_STATUSES.none;
|
||||
|
||||
// if currentUser is a moderator, allow kicking other users
|
||||
const allowedToKick = currentUser.isModerator && !user.isCurrent && !isBreakoutRoom;
|
||||
@ -242,19 +241,9 @@ const getCurrentUser = () => {
|
||||
return (currentUser) ? mapUser(currentUser) : null;
|
||||
};
|
||||
|
||||
const normalizeEmojiName = (emoji) => {
|
||||
const emojisNormalized = {
|
||||
agree: 'thumbs_up',
|
||||
disagree: 'thumbs_down',
|
||||
thumbsUp: 'thumbs_up',
|
||||
thumbsDown: 'thumbs_down',
|
||||
raiseHand: 'hand',
|
||||
away: 'time',
|
||||
neutral: 'undecided',
|
||||
};
|
||||
|
||||
return emoji in emojisNormalized ? emojisNormalized[emoji] : emoji;
|
||||
};
|
||||
const normalizeEmojiName = emoji => (
|
||||
emoji in EMOJI_NORMALIZE ? EMOJI_NORMALIZE[emoji] : emoji
|
||||
);
|
||||
|
||||
const isMeetingLocked = (id) => {
|
||||
const meeting = Meetings.findOne({ meetingId: id });
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import KEY_CODES from '/imports/utils/keyCodes';
|
||||
import styles from './styles.scss';
|
||||
import styles from './styles';
|
||||
import UserParticipants from './user-participants/component';
|
||||
import UserMessages from './user-messages/component';
|
||||
|
||||
|
@ -3,7 +3,7 @@ import CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup';
|
||||
import PropTypes from 'prop-types';
|
||||
import { defineMessages } from 'react-intl';
|
||||
import cx from 'classnames';
|
||||
import styles from './styles.scss';
|
||||
import styles from './styles';
|
||||
import ChatListItem from './../../chat-list-item/component';
|
||||
|
||||
const propTypes = {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Icon from '/imports/ui/components/icon/component';
|
||||
import styles from './styles.scss';
|
||||
import styles from './styles';
|
||||
|
||||
const propTypes = {
|
||||
user: PropTypes.shape({
|
||||
|
@ -11,7 +11,7 @@ import DropdownContent from '/imports/ui/components/dropdown/content/component';
|
||||
import DropdownList from '/imports/ui/components/dropdown/list/component';
|
||||
import DropdownListSeparator from '/imports/ui/components/dropdown/list/separator/component';
|
||||
import DropdownListTitle from '/imports/ui/components/dropdown/list/title/component';
|
||||
import styles from './styles.scss';
|
||||
import styles from './styles';
|
||||
import UserName from './../user-name/component';
|
||||
import UserIcons from './../user-icons/component';
|
||||
|
||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { defineMessages } from 'react-intl';
|
||||
import Icon from '/imports/ui/components/icon/component';
|
||||
import styles from './styles.scss';
|
||||
import styles from './styles';
|
||||
|
||||
|
||||
const messages = defineMessages({
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { defineMessages } from 'react-intl';
|
||||
import PropTypes from 'prop-types';
|
||||
import styles from './styles.scss';
|
||||
import styles from './styles';
|
||||
|
||||
const intlMessages = defineMessages({
|
||||
participantsTitle: {
|
||||
|
@ -1,13 +1,24 @@
|
||||
const EMOJI_STATUSES = [
|
||||
'away',
|
||||
'raiseHand',
|
||||
'neutral',
|
||||
'confused',
|
||||
'sad',
|
||||
'happy',
|
||||
'applause',
|
||||
'thumbsUp',
|
||||
'thumbsDown',
|
||||
];
|
||||
const EMOJI_STATUSES = {
|
||||
away: 'away',
|
||||
raiseHand: 'raiseHand',
|
||||
neutral: 'neutral',
|
||||
confused: 'confused',
|
||||
sad: 'sad',
|
||||
happy: 'happy',
|
||||
applause: 'applause',
|
||||
thumbsUp: 'thumbsUp',
|
||||
thumbsDown: 'thumbsDown',
|
||||
none: 'none',
|
||||
};
|
||||
|
||||
export { EMOJI_STATUSES };
|
||||
const EMOJI_NORMALIZE = {
|
||||
agree: 'thumbs_up',
|
||||
disagree: 'thumbs_down',
|
||||
thumbsUp: 'thumbs_up',
|
||||
thumbsDown: 'thumbs_down',
|
||||
raiseHand: 'hand',
|
||||
away: 'time',
|
||||
neutral: 'undecided',
|
||||
};
|
||||
|
||||
export { EMOJI_STATUSES, EMOJI_NORMALIZE };
|
||||
|
Loading…
Reference in New Issue
Block a user