-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into new.teams
# Conflicts: # app/containers/RoomTypeIcon.js # app/i18n/locales/en.js # app/presentation/RoomItem/RoomItem.js # app/presentation/RoomItem/TypeIcon.js # app/views/RoomActionsView/index.js # app/views/RoomInfoView/index.js # app/views/RoomView/Header/Header.js # app/views/RoomView/Header/Icon.js # app/views/RoomView/Header/index.js
- Loading branch information
Showing
89 changed files
with
11,193 additions
and
8,888 deletions.
There are no files selected for viewing
2,343 changes: 1,835 additions & 508 deletions
2,343
__tests__/__snapshots__/Storyshots.test.js.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,37 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { View } from 'react-native'; | ||
import { STATUS_COLORS, themes } from '../../constants/colors'; | ||
import { CustomIcon } from '../../lib/Icons'; | ||
import { STATUS_COLORS } from '../../constants/colors'; | ||
|
||
const Status = React.memo(({ | ||
status, size, style, theme, ...props | ||
}) => ( | ||
<View | ||
style={ | ||
[ | ||
style, | ||
{ | ||
borderRadius: size, | ||
width: size, | ||
height: size, | ||
backgroundColor: STATUS_COLORS[status] ?? STATUS_COLORS.offline, | ||
borderColor: themes[theme].backgroundColor | ||
} | ||
]} | ||
{...props} | ||
/> | ||
)); | ||
status, size, style, ...props | ||
}) => { | ||
const name = `status-${ status }`; | ||
const isNameValid = CustomIcon.hasIcon(name); | ||
const iconName = isNameValid ? name : 'status-offline'; | ||
const calculatedStyle = [{ | ||
width: size, height: size, textAlignVertical: 'center' | ||
}, style]; | ||
|
||
return ( | ||
<CustomIcon | ||
style={calculatedStyle} | ||
size={size} | ||
name={iconName} | ||
color={STATUS_COLORS[status] ?? STATUS_COLORS.offline} | ||
{...props} | ||
/> | ||
); | ||
}); | ||
|
||
Status.propTypes = { | ||
status: PropTypes.string, | ||
size: PropTypes.number, | ||
style: PropTypes.any, | ||
theme: PropTypes.string | ||
style: PropTypes.any | ||
}; | ||
Status.defaultProps = { | ||
status: 'offline', | ||
size: 16, | ||
theme: 'light' | ||
size: 32 | ||
}; | ||
|
||
export default Status; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
import React from 'react'; | ||
import React, { memo } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { connect } from 'react-redux'; | ||
|
||
import Status from './Status'; | ||
import { withTheme } from '../../theme'; | ||
|
||
class StatusContainer extends React.PureComponent { | ||
static propTypes = { | ||
style: PropTypes.any, | ||
size: PropTypes.number, | ||
status: PropTypes.string, | ||
theme: PropTypes.string | ||
}; | ||
const StatusContainer = memo(({ style, size = 32, status }) => <Status size={size} style={style} status={status} />); | ||
|
||
static defaultProps = { | ||
size: 16 | ||
} | ||
|
||
render() { | ||
const { | ||
style, size, status, theme | ||
} = this.props; | ||
return <Status size={size} style={style} status={status} theme={theme} />; | ||
} | ||
} | ||
StatusContainer.propTypes = { | ||
style: PropTypes.any, | ||
size: PropTypes.number, | ||
status: PropTypes.string | ||
}; | ||
|
||
const mapStateToProps = (state, ownProps) => ({ | ||
status: state.meteor.connected ? (state.activeUsers[ownProps.id] && state.activeUsers[ownProps.id].status) : 'offline' | ||
status: state.meteor.connected ? (state.activeUsers[ownProps.id] && state.activeUsers[ownProps.id].status) : 'loading' | ||
}); | ||
|
||
export default connect(mapStateToProps)(withTheme(StatusContainer)); | ||
export default connect(mapStateToProps)(StatusContainer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.