2019-10-29 13:53:58 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { Animated } from 'react-native';
|
[NEW] Add/Create/Remove channel on a team (#3090)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* One way to refactor :P
* Next level refactor :)
* Fix create group dm
* Refactor renderItem
* Minor bug fixes
* Fix stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-19 21:14:42 +00:00
|
|
|
import {
|
|
|
|
LongPressGestureHandler, PanGestureHandler, State
|
|
|
|
} from 'react-native-gesture-handler';
|
2019-12-04 16:39:53 +00:00
|
|
|
|
|
|
|
import Touch from '../../utils/touch';
|
2019-10-29 13:53:58 +00:00
|
|
|
import {
|
|
|
|
ACTION_WIDTH,
|
|
|
|
SMALL_SWIPE,
|
|
|
|
LONG_SWIPE
|
|
|
|
} from './styles';
|
2021-04-01 12:58:20 +00:00
|
|
|
import { isRTL } from '../../i18n';
|
2019-12-04 16:39:53 +00:00
|
|
|
import { themes } from '../../constants/colors';
|
2019-10-29 13:53:58 +00:00
|
|
|
import { LeftActions, RightActions } from './Actions';
|
|
|
|
|
|
|
|
class Touchable extends React.Component {
|
|
|
|
static propTypes = {
|
|
|
|
type: PropTypes.string.isRequired,
|
|
|
|
onPress: PropTypes.func,
|
[NEW] Add/Create/Remove channel on a team (#3090)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* One way to refactor :P
* Next level refactor :)
* Fix create group dm
* Refactor renderItem
* Minor bug fixes
* Fix stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-19 21:14:42 +00:00
|
|
|
onLongPress: PropTypes.func,
|
2019-10-29 13:53:58 +00:00
|
|
|
testID: PropTypes.string,
|
|
|
|
width: PropTypes.number,
|
|
|
|
favorite: PropTypes.bool,
|
|
|
|
isRead: PropTypes.bool,
|
|
|
|
rid: PropTypes.string,
|
|
|
|
toggleFav: PropTypes.func,
|
|
|
|
toggleRead: PropTypes.func,
|
|
|
|
hideChannel: PropTypes.func,
|
2019-12-04 16:39:53 +00:00
|
|
|
children: PropTypes.element,
|
2020-06-15 14:00:46 +00:00
|
|
|
theme: PropTypes.string,
|
2020-07-31 18:22:30 +00:00
|
|
|
isFocused: PropTypes.bool,
|
|
|
|
swipeEnabled: PropTypes.bool
|
2019-10-29 13:53:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.dragX = new Animated.Value(0);
|
|
|
|
this.rowOffSet = new Animated.Value(0);
|
2021-04-01 12:58:20 +00:00
|
|
|
this.reverse = new Animated.Value(isRTL() ? -1 : 1);
|
2019-10-29 13:53:58 +00:00
|
|
|
this.transX = Animated.add(
|
|
|
|
this.rowOffSet,
|
|
|
|
this.dragX
|
|
|
|
);
|
2020-11-30 21:47:05 +00:00
|
|
|
this.transXReverse = Animated.multiply(
|
|
|
|
this.transX,
|
|
|
|
this.reverse
|
|
|
|
);
|
2019-10-29 13:53:58 +00:00
|
|
|
this.state = {
|
|
|
|
rowState: 0 // 0: closed, 1: right opened, -1: left opened
|
|
|
|
};
|
|
|
|
this._onGestureEvent = Animated.event(
|
2021-01-07 14:50:09 +00:00
|
|
|
[{ nativeEvent: { translationX: this.dragX } }], { useNativeDriver: true }
|
2019-10-29 13:53:58 +00:00
|
|
|
);
|
|
|
|
this._value = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
_onHandlerStateChange = ({ nativeEvent }) => {
|
|
|
|
if (nativeEvent.oldState === State.ACTIVE) {
|
|
|
|
this._handleRelease(nativeEvent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
[NEW] Add/Create/Remove channel on a team (#3090)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* One way to refactor :P
* Next level refactor :)
* Fix create group dm
* Refactor renderItem
* Minor bug fixes
* Fix stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-19 21:14:42 +00:00
|
|
|
onLongPressHandlerStateChange = ({ nativeEvent }) => {
|
|
|
|
if (nativeEvent.state === State.ACTIVE) {
|
|
|
|
this.onLongPress();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-29 13:53:58 +00:00
|
|
|
|
|
|
|
_handleRelease = (nativeEvent) => {
|
|
|
|
const { translationX } = nativeEvent;
|
|
|
|
const { rowState } = this.state;
|
2020-05-08 16:37:49 +00:00
|
|
|
this._value += translationX;
|
2019-10-29 13:53:58 +00:00
|
|
|
|
|
|
|
let toValue = 0;
|
|
|
|
if (rowState === 0) { // if no option is opened
|
|
|
|
if (translationX > 0 && translationX < LONG_SWIPE) {
|
2020-11-30 21:47:05 +00:00
|
|
|
// open leading option if he swipe right but not enough to trigger action
|
2021-04-01 12:58:20 +00:00
|
|
|
if (isRTL()) {
|
2020-11-30 21:47:05 +00:00
|
|
|
toValue = 2 * ACTION_WIDTH;
|
|
|
|
} else {
|
|
|
|
toValue = ACTION_WIDTH;
|
|
|
|
}
|
2019-10-29 13:53:58 +00:00
|
|
|
this.setState({ rowState: -1 });
|
|
|
|
} else if (translationX >= LONG_SWIPE) {
|
|
|
|
toValue = 0;
|
2021-04-01 12:58:20 +00:00
|
|
|
if (isRTL()) {
|
2020-11-30 21:47:05 +00:00
|
|
|
this.hideChannel();
|
|
|
|
} else {
|
|
|
|
this.toggleRead();
|
|
|
|
}
|
2019-10-29 13:53:58 +00:00
|
|
|
} else if (translationX < 0 && translationX > -LONG_SWIPE) {
|
2020-11-30 21:47:05 +00:00
|
|
|
// open trailing option if he swipe left
|
2021-04-01 12:58:20 +00:00
|
|
|
if (isRTL()) {
|
2020-11-30 21:47:05 +00:00
|
|
|
toValue = -ACTION_WIDTH;
|
|
|
|
} else {
|
|
|
|
toValue = -2 * ACTION_WIDTH;
|
|
|
|
}
|
2019-10-29 13:53:58 +00:00
|
|
|
this.setState({ rowState: 1 });
|
|
|
|
} else if (translationX <= -LONG_SWIPE) {
|
|
|
|
toValue = 0;
|
|
|
|
this.setState({ rowState: 0 });
|
2021-04-01 12:58:20 +00:00
|
|
|
if (isRTL()) {
|
2020-11-30 21:47:05 +00:00
|
|
|
this.toggleRead();
|
|
|
|
} else {
|
|
|
|
this.hideChannel();
|
|
|
|
}
|
2019-10-29 13:53:58 +00:00
|
|
|
} else {
|
|
|
|
toValue = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rowState === -1) { // if left option is opened
|
|
|
|
if (this._value < SMALL_SWIPE) {
|
|
|
|
toValue = 0;
|
|
|
|
this.setState({ rowState: 0 });
|
|
|
|
} else if (this._value > LONG_SWIPE) {
|
|
|
|
toValue = 0;
|
|
|
|
this.setState({ rowState: 0 });
|
2021-04-01 12:58:20 +00:00
|
|
|
if (isRTL()) {
|
2020-11-30 21:47:05 +00:00
|
|
|
this.hideChannel();
|
|
|
|
} else {
|
|
|
|
this.toggleRead();
|
|
|
|
}
|
2021-04-01 12:58:20 +00:00
|
|
|
} else if (isRTL()) {
|
2020-11-30 21:47:05 +00:00
|
|
|
toValue = 2 * ACTION_WIDTH;
|
2019-10-29 13:53:58 +00:00
|
|
|
} else {
|
|
|
|
toValue = ACTION_WIDTH;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rowState === 1) { // if right option is opened
|
|
|
|
if (this._value > -2 * SMALL_SWIPE) {
|
|
|
|
toValue = 0;
|
|
|
|
this.setState({ rowState: 0 });
|
|
|
|
} else if (this._value < -LONG_SWIPE) {
|
|
|
|
toValue = 0;
|
|
|
|
this.setState({ rowState: 0 });
|
2021-04-01 12:58:20 +00:00
|
|
|
if (isRTL()) {
|
2020-11-30 21:47:05 +00:00
|
|
|
this.toggleRead();
|
|
|
|
} else {
|
|
|
|
this.hideChannel();
|
|
|
|
}
|
2021-04-01 12:58:20 +00:00
|
|
|
} else if (isRTL()) {
|
2020-11-30 21:47:05 +00:00
|
|
|
toValue = -ACTION_WIDTH;
|
2019-10-29 13:53:58 +00:00
|
|
|
} else {
|
|
|
|
toValue = -2 * ACTION_WIDTH;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this._animateRow(toValue);
|
|
|
|
}
|
|
|
|
|
|
|
|
_animateRow = (toValue) => {
|
|
|
|
this.rowOffSet.setValue(this._value);
|
|
|
|
this._value = toValue;
|
|
|
|
this.dragX.setValue(0);
|
|
|
|
Animated.spring(this.rowOffSet, {
|
|
|
|
toValue,
|
|
|
|
bounciness: 0,
|
|
|
|
useNativeDriver: true
|
|
|
|
}).start();
|
|
|
|
}
|
|
|
|
|
|
|
|
close = () => {
|
|
|
|
this.setState({ rowState: 0 });
|
|
|
|
this._animateRow(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
toggleFav = () => {
|
|
|
|
const { toggleFav, rid, favorite } = this.props;
|
|
|
|
if (toggleFav) {
|
|
|
|
toggleFav(rid, favorite);
|
|
|
|
}
|
|
|
|
this.close();
|
|
|
|
};
|
|
|
|
|
|
|
|
toggleRead = () => {
|
|
|
|
const { toggleRead, rid, isRead } = this.props;
|
|
|
|
if (toggleRead) {
|
|
|
|
toggleRead(rid, isRead);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
hideChannel = () => {
|
|
|
|
const { hideChannel, rid, type } = this.props;
|
|
|
|
if (hideChannel) {
|
|
|
|
hideChannel(rid, type);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
onToggleReadPress = () => {
|
|
|
|
this.toggleRead();
|
|
|
|
this.close();
|
|
|
|
};
|
|
|
|
|
|
|
|
onHidePress = () => {
|
|
|
|
this.hideChannel();
|
|
|
|
this.close();
|
|
|
|
};
|
|
|
|
|
|
|
|
onPress = () => {
|
|
|
|
const { rowState } = this.state;
|
|
|
|
if (rowState !== 0) {
|
|
|
|
this.close();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
const { onPress } = this.props;
|
|
|
|
if (onPress) {
|
|
|
|
onPress();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
[NEW] Add/Create/Remove channel on a team (#3090)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* One way to refactor :P
* Next level refactor :)
* Fix create group dm
* Refactor renderItem
* Minor bug fixes
* Fix stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-19 21:14:42 +00:00
|
|
|
onLongPress = () => {
|
|
|
|
const { rowState } = this.state;
|
|
|
|
const { onLongPress } = this.props;
|
|
|
|
if (rowState !== 0) {
|
|
|
|
this.close();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (onLongPress) {
|
|
|
|
onLongPress();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-10-29 13:53:58 +00:00
|
|
|
render() {
|
|
|
|
const {
|
2020-07-31 18:22:30 +00:00
|
|
|
testID, isRead, width, favorite, children, theme, isFocused, swipeEnabled
|
2019-10-29 13:53:58 +00:00
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
return (
|
[NEW] Add/Create/Remove channel on a team (#3090)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* One way to refactor :P
* Next level refactor :)
* Fix create group dm
* Refactor renderItem
* Minor bug fixes
* Fix stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-19 21:14:42 +00:00
|
|
|
<LongPressGestureHandler onHandlerStateChange={this.onLongPressHandlerStateChange}>
|
2019-10-29 13:53:58 +00:00
|
|
|
<Animated.View>
|
[NEW] Add/Create/Remove channel on a team (#3090)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* One way to refactor :P
* Next level refactor :)
* Fix create group dm
* Refactor renderItem
* Minor bug fixes
* Fix stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-19 21:14:42 +00:00
|
|
|
<PanGestureHandler
|
|
|
|
minDeltaX={20}
|
|
|
|
onGestureEvent={this._onGestureEvent}
|
|
|
|
onHandlerStateChange={this._onHandlerStateChange}
|
|
|
|
enabled={swipeEnabled}
|
2019-10-29 13:53:58 +00:00
|
|
|
>
|
[NEW] Add/Create/Remove channel on a team (#3090)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* One way to refactor :P
* Next level refactor :)
* Fix create group dm
* Refactor renderItem
* Minor bug fixes
* Fix stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-19 21:14:42 +00:00
|
|
|
<Animated.View>
|
|
|
|
<LeftActions
|
|
|
|
transX={this.transXReverse}
|
|
|
|
isRead={isRead}
|
|
|
|
width={width}
|
|
|
|
onToggleReadPress={this.onToggleReadPress}
|
|
|
|
theme={theme}
|
|
|
|
/>
|
|
|
|
<RightActions
|
|
|
|
transX={this.transXReverse}
|
|
|
|
favorite={favorite}
|
|
|
|
width={width}
|
|
|
|
toggleFav={this.toggleFav}
|
|
|
|
onHidePress={this.onHidePress}
|
|
|
|
theme={theme}
|
|
|
|
/>
|
|
|
|
<Animated.View
|
|
|
|
style={{
|
|
|
|
transform: [{ translateX: this.transX }]
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<Touch
|
|
|
|
onPress={this.onPress}
|
|
|
|
theme={theme}
|
|
|
|
testID={testID}
|
|
|
|
style={{
|
|
|
|
backgroundColor: isFocused ? themes[theme].chatComponentBackground : themes[theme].backgroundColor
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</Touch>
|
|
|
|
</Animated.View>
|
|
|
|
</Animated.View>
|
2019-10-29 13:53:58 +00:00
|
|
|
|
[NEW] Add/Create/Remove channel on a team (#3090)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* One way to refactor :P
* Next level refactor :)
* Fix create group dm
* Refactor renderItem
* Minor bug fixes
* Fix stories
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-05-19 21:14:42 +00:00
|
|
|
</PanGestureHandler>
|
|
|
|
</Animated.View>
|
|
|
|
</LongPressGestureHandler>
|
2019-10-29 13:53:58 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Touchable;
|