This commit is contained in:
Anant Bhasin 2021-06-11 17:33:52 +05:30
commit 8b4d2ec152
6 changed files with 410 additions and 5 deletions

View File

@ -59100,6 +59100,404 @@ exports[`Storyshots Room Item Tag 1`] = `
</RCTScrollView> </RCTScrollView>
`; `;
exports[`Storyshots Room Item Touch 1`] = `
<RCTScrollView
style={
Object {
"backgroundColor": "#ffffff",
}
}
>
<View>
<View>
<View>
<View
pointerEvents="box-none"
style={
Array [
Object {
"height": 150,
"left": 0,
"position": "absolute",
"right": 0,
},
undefined,
]
}
>
<View
style={
Object {
"backgroundColor": "#1d74f5",
"height": 150,
"justifyContent": "center",
"position": "absolute",
"right": 670,
"top": 0,
"transform": Array [
Object {
"translateX": -80,
},
],
"width": 750,
}
}
>
<View
style={
Object {
"height": 150,
"justifyContent": "center",
"position": "absolute",
"right": 0,
"top": 0,
}
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"color": "white",
"fontSize": 20,
},
undefined,
Object {
"fontFamily": "custom",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
<Text
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 15,
"fontWeight": "600",
"justifyContent": "center",
"marginTop": 4,
"textAlign": "left",
},
Object {
"color": "#ffffff",
},
]
}
>
Read
</Text>
</View>
</View>
</View>
<View
pointerEvents="box-none"
style={
Object {
"flexDirection": "row",
"height": 75,
"left": 0,
"position": "absolute",
"right": 0,
}
}
>
<View
style={
Object {
"backgroundColor": "#54585e",
"height": 150,
"justifyContent": "center",
"position": "absolute",
"top": 0,
"transform": Array [
Object {
"translateX": 750,
},
],
"width": 750,
}
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"color": "#ffffff",
"fontSize": 20,
},
undefined,
Object {
"fontFamily": "custom",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
<Text
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 15,
"fontWeight": "600",
"justifyContent": "center",
"marginTop": 4,
"textAlign": "left",
},
Object {
"color": "#ffffff",
},
]
}
>
Favorite
</Text>
</View>
<View
style={
Object {
"height": 150,
"justifyContent": "center",
"position": "absolute",
"top": 0,
"transform": Array [
Object {
"translateX": 750,
},
],
"width": 750,
}
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"color": "#ffffff",
"fontSize": 20,
},
undefined,
Object {
"fontFamily": "custom",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
<Text
style={
Array [
Object {
"backgroundColor": "transparent",
"fontFamily": "System",
"fontSize": 15,
"fontWeight": "600",
"justifyContent": "center",
"marginTop": 4,
"textAlign": "left",
},
Object {
"color": "#ffffff",
},
]
}
>
Hide
</Text>
</View>
</View>
<View
style={
Object {
"transform": Array [
Object {
"translateX": 0,
},
],
}
}
>
<View
style={
Object {
"alignItems": "center",
"flexDirection": "row",
"height": 150,
"paddingLeft": 14,
}
}
>
<View
style={
Array [
Object {
"borderRadius": 4,
"height": 48,
"width": 48,
},
Object {
"marginRight": 10,
},
]
}
>
<View
style={
Array [
Object {
"overflow": "hidden",
},
Object {
"borderRadius": 4,
"height": 48,
"width": 48,
},
]
}
>
<FastImageView
resizeMode="cover"
source={
Object {
"headers": undefined,
"priority": "high",
"uri": "https://open.rocket.chat/avatar/rocket.cat?format=png&size=48",
}
}
style={
Object {
"bottom": 0,
"left": 0,
"position": "absolute",
"right": 0,
"top": 0,
}
}
/>
</View>
</View>
<View
style={
Array [
Object {
"borderBottomWidth": 0.5,
"flex": 1,
"paddingRight": 14,
"paddingVertical": 10,
},
Object {
"borderColor": "#cbcbcc",
},
]
}
>
<View
style={
Array [
Object {
"alignItems": "center",
"flexDirection": "row",
"justifyContent": "center",
"width": "100%",
},
Object {
"flex": 1,
},
]
}
>
<Text
allowFontScaling={false}
style={
Array [
Object {
"color": "#cbced1",
"fontSize": 16,
},
Array [
Object {
"height": 16,
"textAlignVertical": "center",
"width": 16,
},
Array [
Array [
Object {
"marginRight": 4,
},
Object {
"color": "#0d0e12",
},
undefined,
],
Object {
"color": "#cbced1",
},
],
],
Object {
"fontFamily": "custom",
"fontStyle": "normal",
"fontWeight": "normal",
},
Object {},
]
}
>
</Text>
<Text
ellipsizeMode="tail"
numberOfLines={1}
style={
Array [
Object {
"backgroundColor": "transparent",
"flex": 1,
"fontFamily": "System",
"fontSize": 17,
"fontWeight": "500",
"lineHeight": 20,
"textAlign": "left",
},
undefined,
Object {
"color": "#0d0e12",
},
]
}
>
rocket.cat
</Text>
</View>
</View>
</View>
</View>
</View>
</View>
</View>
</RCTScrollView>
`;
exports[`Storyshots Room Item Type 1`] = ` exports[`Storyshots Room Item Type 1`] = `
<RCTScrollView <RCTScrollView
style={ style={

View File

@ -12,7 +12,7 @@ const Link = React.memo(({
children, link, theme, onLinkPress children, link, theme, onLinkPress
}) => { }) => {
const handlePress = () => { const handlePress = () => {
if (!link) { if (!link || !onLinkPress) {
return; return;
} }
onLinkPress(link); onLinkPress(link);

View File

@ -117,7 +117,9 @@ class RoomItemContainer extends React.Component {
onLongPress = () => { onLongPress = () => {
const { item, onLongPress } = this.props; const { item, onLongPress } = this.props;
return onLongPress(item); if (onLongPress) {
return onLongPress(item);
}
} }
render() { render() {

View File

@ -27,10 +27,10 @@ export const MessageTypeValues = [
value: 'rm', value: 'rm',
text: 'Message_HideType_rm' text: 'Message_HideType_rm'
}, { }, {
value: 'subscription_role_added', value: 'subscription-role-added',
text: 'Message_HideType_subscription_role_added' text: 'Message_HideType_subscription_role_added'
}, { }, {
value: 'subscription_role_removed', value: 'subscription-role-removed',
text: 'Message_HideType_subscription_role_removed' text: 'Message_HideType_subscription_role_removed'
}, { }, {
value: 'room_archived', value: 'room_archived',

View File

@ -714,7 +714,7 @@ class RoomActionsView extends React.Component {
return null; return null;
} }
if (t === 'd') { if (t === 'd' && !RocketChat.isGroupChat(room)) {
return ( return (
<List.Section> <List.Section>
<List.Separator /> <List.Separator />
@ -751,6 +751,8 @@ class RoomActionsView extends React.Component {
</List.Section> </List.Section>
); );
} }
return null;
} }
teamChannelActions = (t, room) => { teamChannelActions = (t, room) => {

View File

@ -44,6 +44,9 @@ stories.add('Basic', () => (
<RoomItem /> <RoomItem />
)); ));
stories.add('Touch', () => (
<RoomItem onPress={() => alert('on press')} onLongPress={() => alert('on long press')} />
));
stories.add('User', () => ( stories.add('User', () => (
<> <>