[MM-11170] Remove loader and someone from LHS (#1973)
This commit is contained in:
parent
b67877889b
commit
b76319e9c6
8 changed files with 24 additions and 1132 deletions
|
|
@ -1,153 +0,0 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`LoadingPlaceholder should match snapshot 1`] = `
|
||||
ShallowWrapper {
|
||||
"length": 1,
|
||||
Symbol(enzyme.__root__): [Circular],
|
||||
Symbol(enzyme.__unrendered__): <LoadingPlaceholder />,
|
||||
Symbol(enzyme.__renderer__): Object {
|
||||
"batchedUpdates": [Function],
|
||||
"getNode": [Function],
|
||||
"render": [Function],
|
||||
"simulateEvent": [Function],
|
||||
"unmount": [Function],
|
||||
},
|
||||
Symbol(enzyme.__node__): Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"accessible": true,
|
||||
"allowFontScaling": true,
|
||||
"children": Array [
|
||||
<InjectIntl(FormattedText)
|
||||
defaultMessage="Loading"
|
||||
id="loading_screen.loading"
|
||||
/>,
|
||||
<AnimatedEllipsis
|
||||
animationDelay={300}
|
||||
minOpacity={0.4}
|
||||
numberOfDots={3}
|
||||
style={
|
||||
Object {
|
||||
"fontSize": 28,
|
||||
"letterSpacing": -3,
|
||||
"lineHeight": 30,
|
||||
"marginLeft": 5,
|
||||
}
|
||||
}
|
||||
/>,
|
||||
],
|
||||
"ellipsizeMode": "tail",
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": Array [
|
||||
Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"defaultMessage": "Loading",
|
||||
"id": "loading_screen.loading",
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": null,
|
||||
"type": [Function],
|
||||
},
|
||||
Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"animationDelay": 300,
|
||||
"minOpacity": 0.4,
|
||||
"numberOfDots": 3,
|
||||
"style": Object {
|
||||
"fontSize": 28,
|
||||
"letterSpacing": -3,
|
||||
"lineHeight": 30,
|
||||
"marginLeft": 5,
|
||||
},
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": null,
|
||||
"type": [Function],
|
||||
},
|
||||
],
|
||||
"type": [Function],
|
||||
},
|
||||
Symbol(enzyme.__nodes__): Array [
|
||||
Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"accessible": true,
|
||||
"allowFontScaling": true,
|
||||
"children": Array [
|
||||
<InjectIntl(FormattedText)
|
||||
defaultMessage="Loading"
|
||||
id="loading_screen.loading"
|
||||
/>,
|
||||
<AnimatedEllipsis
|
||||
animationDelay={300}
|
||||
minOpacity={0.4}
|
||||
numberOfDots={3}
|
||||
style={
|
||||
Object {
|
||||
"fontSize": 28,
|
||||
"letterSpacing": -3,
|
||||
"lineHeight": 30,
|
||||
"marginLeft": 5,
|
||||
}
|
||||
}
|
||||
/>,
|
||||
],
|
||||
"ellipsizeMode": "tail",
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": Array [
|
||||
Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"defaultMessage": "Loading",
|
||||
"id": "loading_screen.loading",
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": null,
|
||||
"type": [Function],
|
||||
},
|
||||
Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"animationDelay": 300,
|
||||
"minOpacity": 0.4,
|
||||
"numberOfDots": 3,
|
||||
"style": Object {
|
||||
"fontSize": 28,
|
||||
"letterSpacing": -3,
|
||||
"lineHeight": 30,
|
||||
"marginLeft": 5,
|
||||
},
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": null,
|
||||
"type": [Function],
|
||||
},
|
||||
],
|
||||
"type": [Function],
|
||||
},
|
||||
],
|
||||
Symbol(enzyme.__options__): Object {
|
||||
"adapter": ReactSixteenAdapter {
|
||||
"options": Object {
|
||||
"enableComponentDidUpdateOnSetState": true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
import AnimatedEllipsis from 'react-native-animated-ellipsis';
|
||||
import FormattedText from 'app/components/formatted_text';
|
||||
|
||||
import {Text} from 'react-native';
|
||||
|
||||
const LoadingPlaceholder = () => (
|
||||
<Text>
|
||||
<FormattedText
|
||||
id='loading_screen.loading'
|
||||
defaultMessage='Loading'
|
||||
/>
|
||||
<AnimatedEllipsis
|
||||
minOpacity={0.4}
|
||||
style={{
|
||||
fontSize: 28,
|
||||
lineHeight: 30,
|
||||
letterSpacing: -3,
|
||||
marginLeft: 5,
|
||||
}}
|
||||
/>
|
||||
</Text>
|
||||
);
|
||||
|
||||
export default LoadingPlaceholder;
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
import {configure, shallow} from 'enzyme';
|
||||
import Adapter from 'enzyme-adapter-react-16';
|
||||
configure({adapter: new Adapter()});
|
||||
|
||||
import LoadingPlaceholder from './index.js';
|
||||
|
||||
describe('LoadingPlaceholder', () => {
|
||||
test('should match snapshot', () => {
|
||||
const wrapper = shallow(
|
||||
<LoadingPlaceholder/>
|
||||
);
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
@ -121,9 +121,7 @@ ShallowWrapper {
|
|||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>
|
||||
/>
|
||||
</Component>
|
||||
</Component>
|
||||
</TouchableHighlight>,
|
||||
|
|
@ -202,9 +200,7 @@ ShallowWrapper {
|
|||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>
|
||||
/>
|
||||
</Component>
|
||||
</Component>,
|
||||
"delayPressOut": 100,
|
||||
|
|
@ -275,9 +271,7 @@ ShallowWrapper {
|
|||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>
|
||||
/>
|
||||
</Component>,
|
||||
],
|
||||
"style": Array [
|
||||
|
|
@ -340,9 +334,7 @@ ShallowWrapper {
|
|||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>,
|
||||
/>,
|
||||
undefined,
|
||||
],
|
||||
"style": Array [
|
||||
|
|
@ -390,7 +382,7 @@ ShallowWrapper {
|
|||
"props": Object {
|
||||
"accessible": true,
|
||||
"allowFontScaling": true,
|
||||
"children": <LoadingPlaceholder />,
|
||||
"children": undefined,
|
||||
"ellipsizeMode": "tail",
|
||||
"numberOfLines": 1,
|
||||
"style": Array [
|
||||
|
|
@ -410,15 +402,7 @@ ShallowWrapper {
|
|||
],
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "function",
|
||||
"props": Object {},
|
||||
"ref": null,
|
||||
"rendered": null,
|
||||
"type": [Function],
|
||||
},
|
||||
"rendered": null,
|
||||
"type": [Function],
|
||||
},
|
||||
undefined,
|
||||
|
|
@ -512,9 +496,7 @@ ShallowWrapper {
|
|||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>
|
||||
/>
|
||||
</Component>
|
||||
</Component>
|
||||
</TouchableHighlight>,
|
||||
|
|
@ -593,9 +575,7 @@ ShallowWrapper {
|
|||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>
|
||||
/>
|
||||
</Component>
|
||||
</Component>,
|
||||
"delayPressOut": 100,
|
||||
|
|
@ -666,9 +646,7 @@ ShallowWrapper {
|
|||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>
|
||||
/>
|
||||
</Component>,
|
||||
],
|
||||
"style": Array [
|
||||
|
|
@ -731,9 +709,7 @@ ShallowWrapper {
|
|||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>,
|
||||
/>,
|
||||
undefined,
|
||||
],
|
||||
"style": Array [
|
||||
|
|
@ -781,7 +757,7 @@ ShallowWrapper {
|
|||
"props": Object {
|
||||
"accessible": true,
|
||||
"allowFontScaling": true,
|
||||
"children": <LoadingPlaceholder />,
|
||||
"children": undefined,
|
||||
"ellipsizeMode": "tail",
|
||||
"numberOfLines": 1,
|
||||
"style": Array [
|
||||
|
|
@ -801,15 +777,7 @@ ShallowWrapper {
|
|||
],
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "function",
|
||||
"props": Object {},
|
||||
"ref": null,
|
||||
"rendered": null,
|
||||
"type": [Function],
|
||||
},
|
||||
"rendered": null,
|
||||
"type": [Function],
|
||||
},
|
||||
undefined,
|
||||
|
|
@ -850,854 +818,3 @@ ShallowWrapper {
|
|||
},
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`ChannelItem should match snapshot for no displayName 1`] = `
|
||||
ShallowWrapper {
|
||||
"length": 1,
|
||||
Symbol(enzyme.__root__): [Circular],
|
||||
Symbol(enzyme.__unrendered__): <ChannelItem
|
||||
channelId="channel_id"
|
||||
currentChannelId="current_channel_id"
|
||||
displayName=""
|
||||
fake={false}
|
||||
isArchived={false}
|
||||
isChannelMuted={false}
|
||||
isMyUser={true}
|
||||
isUnread={true}
|
||||
mentions={0}
|
||||
navigator={
|
||||
Object {
|
||||
"push": [Function],
|
||||
}
|
||||
}
|
||||
onSelectChannel={[Function]}
|
||||
shouldHideChannel={false}
|
||||
showUnreadForMsgs={true}
|
||||
status="online"
|
||||
teammateDeletedAt={0}
|
||||
theme={
|
||||
Object {
|
||||
"sidebarText": "#aaa",
|
||||
"sidebarTextActiveBorder": "#aaa",
|
||||
"sidebarTextActiveColor": "#aaa",
|
||||
"sidebarTextHoverBg": "#aaa",
|
||||
}
|
||||
}
|
||||
type="O"
|
||||
unreadMsgs={1}
|
||||
/>,
|
||||
Symbol(enzyme.__renderer__): Object {
|
||||
"batchedUpdates": [Function],
|
||||
"getNode": [Function],
|
||||
"render": [Function],
|
||||
"simulateEvent": [Function],
|
||||
"unmount": [Function],
|
||||
},
|
||||
Symbol(enzyme.__node__): Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"children": <TouchableHighlight
|
||||
activeOpacity={0.85}
|
||||
delayPressOut={100}
|
||||
onLongPress={[Function]}
|
||||
onPress={[Function]}
|
||||
underlayColor="rgba(170,170,170,0.5)"
|
||||
>
|
||||
<Component
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"height": 44,
|
||||
},
|
||||
undefined,
|
||||
]
|
||||
}
|
||||
>
|
||||
<Component
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"alignItems": "center",
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"paddingLeft": 16,
|
||||
},
|
||||
undefined,
|
||||
]
|
||||
}
|
||||
>
|
||||
<ChannelIcon
|
||||
channelId="channel_id"
|
||||
isActive={false}
|
||||
isArchived={false}
|
||||
isInfo={false}
|
||||
isUnread={true}
|
||||
membersCount={1}
|
||||
size={16}
|
||||
status="online"
|
||||
teammateDeletedAt={0}
|
||||
theme={
|
||||
Object {
|
||||
"sidebarText": "#aaa",
|
||||
"sidebarTextActiveBorder": "#aaa",
|
||||
"sidebarTextActiveColor": "#aaa",
|
||||
"sidebarTextHoverBg": "#aaa",
|
||||
}
|
||||
}
|
||||
type="O"
|
||||
/>
|
||||
<Text
|
||||
accessible={true}
|
||||
allowFontScaling={true}
|
||||
ellipsizeMode="tail"
|
||||
numberOfLines={1}
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"color": "rgba(170,170,170,0.4)",
|
||||
"flex": 1,
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
"height": "100%",
|
||||
"lineHeight": 44,
|
||||
"paddingRight": 40,
|
||||
"textAlignVertical": "center",
|
||||
},
|
||||
Object {
|
||||
"color": undefined,
|
||||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>
|
||||
</Component>
|
||||
</Component>
|
||||
</TouchableHighlight>,
|
||||
},
|
||||
"ref": [Function],
|
||||
"rendered": Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"activeOpacity": 0.85,
|
||||
"children": <Component
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"height": 44,
|
||||
},
|
||||
undefined,
|
||||
]
|
||||
}
|
||||
>
|
||||
<Component
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"alignItems": "center",
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"paddingLeft": 16,
|
||||
},
|
||||
undefined,
|
||||
]
|
||||
}
|
||||
>
|
||||
<ChannelIcon
|
||||
channelId="channel_id"
|
||||
isActive={false}
|
||||
isArchived={false}
|
||||
isInfo={false}
|
||||
isUnread={true}
|
||||
membersCount={1}
|
||||
size={16}
|
||||
status="online"
|
||||
teammateDeletedAt={0}
|
||||
theme={
|
||||
Object {
|
||||
"sidebarText": "#aaa",
|
||||
"sidebarTextActiveBorder": "#aaa",
|
||||
"sidebarTextActiveColor": "#aaa",
|
||||
"sidebarTextHoverBg": "#aaa",
|
||||
}
|
||||
}
|
||||
type="O"
|
||||
/>
|
||||
<Text
|
||||
accessible={true}
|
||||
allowFontScaling={true}
|
||||
ellipsizeMode="tail"
|
||||
numberOfLines={1}
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"color": "rgba(170,170,170,0.4)",
|
||||
"flex": 1,
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
"height": "100%",
|
||||
"lineHeight": 44,
|
||||
"paddingRight": 40,
|
||||
"textAlignVertical": "center",
|
||||
},
|
||||
Object {
|
||||
"color": undefined,
|
||||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>
|
||||
</Component>
|
||||
</Component>,
|
||||
"delayPressOut": 100,
|
||||
"onLongPress": [Function],
|
||||
"onPress": [Function],
|
||||
"underlayColor": "rgba(170,170,170,0.5)",
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"children": Array [
|
||||
undefined,
|
||||
<Component
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"alignItems": "center",
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"paddingLeft": 16,
|
||||
},
|
||||
undefined,
|
||||
]
|
||||
}
|
||||
>
|
||||
<ChannelIcon
|
||||
channelId="channel_id"
|
||||
isActive={false}
|
||||
isArchived={false}
|
||||
isInfo={false}
|
||||
isUnread={true}
|
||||
membersCount={1}
|
||||
size={16}
|
||||
status="online"
|
||||
teammateDeletedAt={0}
|
||||
theme={
|
||||
Object {
|
||||
"sidebarText": "#aaa",
|
||||
"sidebarTextActiveBorder": "#aaa",
|
||||
"sidebarTextActiveColor": "#aaa",
|
||||
"sidebarTextHoverBg": "#aaa",
|
||||
}
|
||||
}
|
||||
type="O"
|
||||
/>
|
||||
<Text
|
||||
accessible={true}
|
||||
allowFontScaling={true}
|
||||
ellipsizeMode="tail"
|
||||
numberOfLines={1}
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"color": "rgba(170,170,170,0.4)",
|
||||
"flex": 1,
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
"height": "100%",
|
||||
"lineHeight": 44,
|
||||
"paddingRight": 40,
|
||||
"textAlignVertical": "center",
|
||||
},
|
||||
Object {
|
||||
"color": undefined,
|
||||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>
|
||||
</Component>,
|
||||
],
|
||||
"style": Array [
|
||||
Object {
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"height": 44,
|
||||
},
|
||||
undefined,
|
||||
],
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": Array [
|
||||
undefined,
|
||||
Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"children": Array [
|
||||
<ChannelIcon
|
||||
channelId="channel_id"
|
||||
isActive={false}
|
||||
isArchived={false}
|
||||
isInfo={false}
|
||||
isUnread={true}
|
||||
membersCount={1}
|
||||
size={16}
|
||||
status="online"
|
||||
teammateDeletedAt={0}
|
||||
theme={
|
||||
Object {
|
||||
"sidebarText": "#aaa",
|
||||
"sidebarTextActiveBorder": "#aaa",
|
||||
"sidebarTextActiveColor": "#aaa",
|
||||
"sidebarTextHoverBg": "#aaa",
|
||||
}
|
||||
}
|
||||
type="O"
|
||||
/>,
|
||||
<Text
|
||||
accessible={true}
|
||||
allowFontScaling={true}
|
||||
ellipsizeMode="tail"
|
||||
numberOfLines={1}
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"color": "rgba(170,170,170,0.4)",
|
||||
"flex": 1,
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
"height": "100%",
|
||||
"lineHeight": 44,
|
||||
"paddingRight": 40,
|
||||
"textAlignVertical": "center",
|
||||
},
|
||||
Object {
|
||||
"color": undefined,
|
||||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>,
|
||||
undefined,
|
||||
],
|
||||
"style": Array [
|
||||
Object {
|
||||
"alignItems": "center",
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"paddingLeft": 16,
|
||||
},
|
||||
undefined,
|
||||
],
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": Array [
|
||||
Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"channelId": "channel_id",
|
||||
"isActive": false,
|
||||
"isArchived": false,
|
||||
"isInfo": false,
|
||||
"isUnread": true,
|
||||
"membersCount": 1,
|
||||
"size": 16,
|
||||
"status": "online",
|
||||
"teammateDeletedAt": 0,
|
||||
"theme": Object {
|
||||
"sidebarText": "#aaa",
|
||||
"sidebarTextActiveBorder": "#aaa",
|
||||
"sidebarTextActiveColor": "#aaa",
|
||||
"sidebarTextHoverBg": "#aaa",
|
||||
},
|
||||
"type": "O",
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": null,
|
||||
"type": [Function],
|
||||
},
|
||||
Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"accessible": true,
|
||||
"allowFontScaling": true,
|
||||
"children": <LoadingPlaceholder />,
|
||||
"ellipsizeMode": "tail",
|
||||
"numberOfLines": 1,
|
||||
"style": Array [
|
||||
Object {
|
||||
"color": "rgba(170,170,170,0.4)",
|
||||
"flex": 1,
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
"height": "100%",
|
||||
"lineHeight": 44,
|
||||
"paddingRight": 40,
|
||||
"textAlignVertical": "center",
|
||||
},
|
||||
Object {
|
||||
"color": undefined,
|
||||
},
|
||||
],
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "function",
|
||||
"props": Object {},
|
||||
"ref": null,
|
||||
"rendered": null,
|
||||
"type": [Function],
|
||||
},
|
||||
"type": [Function],
|
||||
},
|
||||
undefined,
|
||||
],
|
||||
"type": [Function],
|
||||
},
|
||||
],
|
||||
"type": [Function],
|
||||
},
|
||||
"type": [Function],
|
||||
},
|
||||
"type": [Function],
|
||||
},
|
||||
Symbol(enzyme.__nodes__): Array [
|
||||
Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"children": <TouchableHighlight
|
||||
activeOpacity={0.85}
|
||||
delayPressOut={100}
|
||||
onLongPress={[Function]}
|
||||
onPress={[Function]}
|
||||
underlayColor="rgba(170,170,170,0.5)"
|
||||
>
|
||||
<Component
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"height": 44,
|
||||
},
|
||||
undefined,
|
||||
]
|
||||
}
|
||||
>
|
||||
<Component
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"alignItems": "center",
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"paddingLeft": 16,
|
||||
},
|
||||
undefined,
|
||||
]
|
||||
}
|
||||
>
|
||||
<ChannelIcon
|
||||
channelId="channel_id"
|
||||
isActive={false}
|
||||
isArchived={false}
|
||||
isInfo={false}
|
||||
isUnread={true}
|
||||
membersCount={1}
|
||||
size={16}
|
||||
status="online"
|
||||
teammateDeletedAt={0}
|
||||
theme={
|
||||
Object {
|
||||
"sidebarText": "#aaa",
|
||||
"sidebarTextActiveBorder": "#aaa",
|
||||
"sidebarTextActiveColor": "#aaa",
|
||||
"sidebarTextHoverBg": "#aaa",
|
||||
}
|
||||
}
|
||||
type="O"
|
||||
/>
|
||||
<Text
|
||||
accessible={true}
|
||||
allowFontScaling={true}
|
||||
ellipsizeMode="tail"
|
||||
numberOfLines={1}
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"color": "rgba(170,170,170,0.4)",
|
||||
"flex": 1,
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
"height": "100%",
|
||||
"lineHeight": 44,
|
||||
"paddingRight": 40,
|
||||
"textAlignVertical": "center",
|
||||
},
|
||||
Object {
|
||||
"color": undefined,
|
||||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>
|
||||
</Component>
|
||||
</Component>
|
||||
</TouchableHighlight>,
|
||||
},
|
||||
"ref": [Function],
|
||||
"rendered": Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"activeOpacity": 0.85,
|
||||
"children": <Component
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"height": 44,
|
||||
},
|
||||
undefined,
|
||||
]
|
||||
}
|
||||
>
|
||||
<Component
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"alignItems": "center",
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"paddingLeft": 16,
|
||||
},
|
||||
undefined,
|
||||
]
|
||||
}
|
||||
>
|
||||
<ChannelIcon
|
||||
channelId="channel_id"
|
||||
isActive={false}
|
||||
isArchived={false}
|
||||
isInfo={false}
|
||||
isUnread={true}
|
||||
membersCount={1}
|
||||
size={16}
|
||||
status="online"
|
||||
teammateDeletedAt={0}
|
||||
theme={
|
||||
Object {
|
||||
"sidebarText": "#aaa",
|
||||
"sidebarTextActiveBorder": "#aaa",
|
||||
"sidebarTextActiveColor": "#aaa",
|
||||
"sidebarTextHoverBg": "#aaa",
|
||||
}
|
||||
}
|
||||
type="O"
|
||||
/>
|
||||
<Text
|
||||
accessible={true}
|
||||
allowFontScaling={true}
|
||||
ellipsizeMode="tail"
|
||||
numberOfLines={1}
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"color": "rgba(170,170,170,0.4)",
|
||||
"flex": 1,
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
"height": "100%",
|
||||
"lineHeight": 44,
|
||||
"paddingRight": 40,
|
||||
"textAlignVertical": "center",
|
||||
},
|
||||
Object {
|
||||
"color": undefined,
|
||||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>
|
||||
</Component>
|
||||
</Component>,
|
||||
"delayPressOut": 100,
|
||||
"onLongPress": [Function],
|
||||
"onPress": [Function],
|
||||
"underlayColor": "rgba(170,170,170,0.5)",
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"children": Array [
|
||||
undefined,
|
||||
<Component
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"alignItems": "center",
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"paddingLeft": 16,
|
||||
},
|
||||
undefined,
|
||||
]
|
||||
}
|
||||
>
|
||||
<ChannelIcon
|
||||
channelId="channel_id"
|
||||
isActive={false}
|
||||
isArchived={false}
|
||||
isInfo={false}
|
||||
isUnread={true}
|
||||
membersCount={1}
|
||||
size={16}
|
||||
status="online"
|
||||
teammateDeletedAt={0}
|
||||
theme={
|
||||
Object {
|
||||
"sidebarText": "#aaa",
|
||||
"sidebarTextActiveBorder": "#aaa",
|
||||
"sidebarTextActiveColor": "#aaa",
|
||||
"sidebarTextHoverBg": "#aaa",
|
||||
}
|
||||
}
|
||||
type="O"
|
||||
/>
|
||||
<Text
|
||||
accessible={true}
|
||||
allowFontScaling={true}
|
||||
ellipsizeMode="tail"
|
||||
numberOfLines={1}
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"color": "rgba(170,170,170,0.4)",
|
||||
"flex": 1,
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
"height": "100%",
|
||||
"lineHeight": 44,
|
||||
"paddingRight": 40,
|
||||
"textAlignVertical": "center",
|
||||
},
|
||||
Object {
|
||||
"color": undefined,
|
||||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>
|
||||
</Component>,
|
||||
],
|
||||
"style": Array [
|
||||
Object {
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"height": 44,
|
||||
},
|
||||
undefined,
|
||||
],
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": Array [
|
||||
undefined,
|
||||
Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"children": Array [
|
||||
<ChannelIcon
|
||||
channelId="channel_id"
|
||||
isActive={false}
|
||||
isArchived={false}
|
||||
isInfo={false}
|
||||
isUnread={true}
|
||||
membersCount={1}
|
||||
size={16}
|
||||
status="online"
|
||||
teammateDeletedAt={0}
|
||||
theme={
|
||||
Object {
|
||||
"sidebarText": "#aaa",
|
||||
"sidebarTextActiveBorder": "#aaa",
|
||||
"sidebarTextActiveColor": "#aaa",
|
||||
"sidebarTextHoverBg": "#aaa",
|
||||
}
|
||||
}
|
||||
type="O"
|
||||
/>,
|
||||
<Text
|
||||
accessible={true}
|
||||
allowFontScaling={true}
|
||||
ellipsizeMode="tail"
|
||||
numberOfLines={1}
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"color": "rgba(170,170,170,0.4)",
|
||||
"flex": 1,
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
"height": "100%",
|
||||
"lineHeight": 44,
|
||||
"paddingRight": 40,
|
||||
"textAlignVertical": "center",
|
||||
},
|
||||
Object {
|
||||
"color": undefined,
|
||||
},
|
||||
]
|
||||
}
|
||||
>
|
||||
<LoadingPlaceholder />
|
||||
</Text>,
|
||||
undefined,
|
||||
],
|
||||
"style": Array [
|
||||
Object {
|
||||
"alignItems": "center",
|
||||
"flex": 1,
|
||||
"flexDirection": "row",
|
||||
"paddingLeft": 16,
|
||||
},
|
||||
undefined,
|
||||
],
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": Array [
|
||||
Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"channelId": "channel_id",
|
||||
"isActive": false,
|
||||
"isArchived": false,
|
||||
"isInfo": false,
|
||||
"isUnread": true,
|
||||
"membersCount": 1,
|
||||
"size": 16,
|
||||
"status": "online",
|
||||
"teammateDeletedAt": 0,
|
||||
"theme": Object {
|
||||
"sidebarText": "#aaa",
|
||||
"sidebarTextActiveBorder": "#aaa",
|
||||
"sidebarTextActiveColor": "#aaa",
|
||||
"sidebarTextHoverBg": "#aaa",
|
||||
},
|
||||
"type": "O",
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": null,
|
||||
"type": [Function],
|
||||
},
|
||||
Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "class",
|
||||
"props": Object {
|
||||
"accessible": true,
|
||||
"allowFontScaling": true,
|
||||
"children": <LoadingPlaceholder />,
|
||||
"ellipsizeMode": "tail",
|
||||
"numberOfLines": 1,
|
||||
"style": Array [
|
||||
Object {
|
||||
"color": "rgba(170,170,170,0.4)",
|
||||
"flex": 1,
|
||||
"fontSize": 14,
|
||||
"fontWeight": "600",
|
||||
"height": "100%",
|
||||
"lineHeight": 44,
|
||||
"paddingRight": 40,
|
||||
"textAlignVertical": "center",
|
||||
},
|
||||
Object {
|
||||
"color": undefined,
|
||||
},
|
||||
],
|
||||
},
|
||||
"ref": null,
|
||||
"rendered": Object {
|
||||
"instance": null,
|
||||
"key": undefined,
|
||||
"nodeType": "function",
|
||||
"props": Object {},
|
||||
"ref": null,
|
||||
"rendered": null,
|
||||
"type": [Function],
|
||||
},
|
||||
"type": [Function],
|
||||
},
|
||||
undefined,
|
||||
],
|
||||
"type": [Function],
|
||||
},
|
||||
],
|
||||
"type": [Function],
|
||||
},
|
||||
"type": [Function],
|
||||
},
|
||||
"type": [Function],
|
||||
},
|
||||
],
|
||||
Symbol(enzyme.__options__): Object {
|
||||
"adapter": ReactSixteenAdapter {
|
||||
"options": Object {
|
||||
"enableComponentDidUpdateOnSetState": true,
|
||||
},
|
||||
},
|
||||
"context": Object {
|
||||
"intl": Object {
|
||||
"formatMessage": [MockFunction] {
|
||||
"calls": Array [
|
||||
Array [
|
||||
Object {
|
||||
"defaultMessage": "{displayName} (you)",
|
||||
"id": "channel_header.directchannel.you",
|
||||
},
|
||||
Object {
|
||||
"displayname": "",
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import {intlShape} from 'react-intl';
|
|||
|
||||
import Badge from 'app/components/badge';
|
||||
import ChannelIcon from 'app/components/channel_icon';
|
||||
import LoadingPlaceholder from 'app/components/loading_placeholder';
|
||||
import {preventDoubleTap} from 'app/utils/tap';
|
||||
import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';
|
||||
|
||||
|
|
@ -112,8 +111,20 @@ export default class ChannelItem extends PureComponent {
|
|||
return null;
|
||||
}
|
||||
|
||||
if (!this.props.displayName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const {intl} = this.context;
|
||||
|
||||
let channelDisplayName = displayName;
|
||||
if (isMyUser) {
|
||||
channelDisplayName = intl.formatMessage({
|
||||
id: 'channel_header.directchannel.you',
|
||||
defaultMessage: '{displayName} (you)',
|
||||
}, {displayname: displayName});
|
||||
}
|
||||
|
||||
const style = getStyleSheet(theme);
|
||||
const isActive = channelId === currentChannelId;
|
||||
|
||||
|
|
@ -133,20 +144,6 @@ export default class ChannelItem extends PureComponent {
|
|||
extraTextStyle = style.textUnread;
|
||||
}
|
||||
|
||||
let channelDisplayName = displayName;
|
||||
if (isMyUser) {
|
||||
channelDisplayName = intl.formatMessage({
|
||||
id: 'channel_header.directchannel.you',
|
||||
defaultMessage: '{displayName} (you)',
|
||||
}, {displayname: displayName});
|
||||
}
|
||||
|
||||
if (!channelDisplayName) {
|
||||
channelDisplayName = (
|
||||
<LoadingPlaceholder/>
|
||||
);
|
||||
}
|
||||
|
||||
let badge;
|
||||
if (mentions) {
|
||||
badge = (
|
||||
|
|
|
|||
|
|
@ -45,18 +45,4 @@ describe('ChannelItem', () => {
|
|||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('should match snapshot for no displayName', () => {
|
||||
const props = {
|
||||
...baseProps,
|
||||
displayName: '',
|
||||
};
|
||||
|
||||
const wrapper = shallow(
|
||||
<ChannelItem {...props}/>,
|
||||
{context: {intl: {formatMessage: jest.fn()}}},
|
||||
);
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
7
package-lock.json
generated
7
package-lock.json
generated
|
|
@ -14641,13 +14641,6 @@
|
|||
"prop-types": "^15.5.10"
|
||||
}
|
||||
},
|
||||
"react-native-animated-ellipsis": {
|
||||
"version": "github:sudheerDev/react-native-animated-ellipsis#326167b8e0fa3b6f0422c06be412bf177b725666",
|
||||
"from": "github:sudheerDev/react-native-animated-ellipsis#326167b8e0fa3b6f0422c06be412bf177b725666",
|
||||
"requires": {
|
||||
"prop-types": "^15.5.10"
|
||||
}
|
||||
},
|
||||
"react-native-bottom-sheet": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/react-native-bottom-sheet/-/react-native-bottom-sheet-1.0.3.tgz",
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
"react-intl": "2.4.0",
|
||||
"react-native": "github:enahum/react-native#mm",
|
||||
"react-native-animatable": "1.2.4",
|
||||
"react-native-animated-ellipsis": "sudheerDev/react-native-animated-ellipsis.git#326167b8e0fa3b6f0422c06be412bf177b725666",
|
||||
"react-native-bottom-sheet": "1.0.3",
|
||||
"react-native-button": "2.3.0",
|
||||
"react-native-circular-progress": "0.2.0",
|
||||
|
|
|
|||
Loading…
Reference in a new issue