Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit 6ec82f7

Browse files
authored
Merge pull request #3112 from withspectrum/2.2.13
2.2.13
2 parents e7d6e6b + 5949c95 commit 6ec82f7

File tree

6 files changed

+37
-14
lines changed

6 files changed

+37
-14
lines changed

api/mutations/message/addMessage.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export default requireAuth(async (_: any, args: Input, ctx: GraphQLContext) => {
127127

128128
if (message.parentId) {
129129
const parent = await getMessage(message.parentId);
130-
if (parent.threadId !== message.threadId)
130+
if (parent.threadId !== message.threadId) {
131131
trackQueue.add({
132132
userId: user.id,
133133
event: eventFailed,
@@ -137,7 +137,8 @@ export default requireAuth(async (_: any, args: Input, ctx: GraphQLContext) => {
137137
},
138138
});
139139

140-
return new UserError('You can only quote messages from the same thread.');
140+
return new UserError('You can only quote messages from the same thread.');
141+
}
141142
}
142143

143144
// construct the shape of the object to be stored in the db

mobile/components/Avatar/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ type AvatarProps = {
66
src: string,
77
size: number,
88
radius: number,
9+
style?: Object,
910
};
1011

1112
export default class Avatar extends Component<AvatarProps> {
1213
render() {
13-
const { src, size, radius } = this.props;
14+
const { src, size, radius, style } = this.props;
1415
let source = src ? { uri: src } : {};
1516

16-
return <AvatarImage source={source} size={size} radius={radius} />;
17+
return (
18+
<AvatarImage source={source} size={size} radius={radius} style={style} />
19+
);
1720
}
1821
}

mobile/components/Avatar/style.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ export const AvatarImage = styled.Image`
55
width: ${props => (props.size ? `${props.size}px` : '30px')};
66
height: ${props => (props.size ? `${props.size}px` : '30px')};
77
border-radius: ${props => (props.radius ? `${props.radius}px` : '15px')};
8-
margin-right: 5px;
98
`;

mobile/components/ThreadItem/Facepile.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
import * as React from 'react';
33
import Avatar from '../Avatar';
44
import type { UserInfoType } from '../../../shared/graphql/fragments/user/userInfo';
5-
import { FacepileContainer, EmptyParticipantHead } from './style';
5+
import {
6+
FacepileContainer,
7+
StackedEmptyParticipantHead,
8+
StackedAvatar,
9+
} from './style';
610
const NUM_TO_DISPLAY = 5;
711

812
const messageAvatars = list => {
@@ -13,7 +17,7 @@ const messageAvatars = list => {
1317
return null;
1418
}
1519
return (
16-
<Avatar
20+
<StackedAvatar
1721
key={participant.id}
1822
src={participant.profilePhoto}
1923
size={30}
@@ -50,12 +54,12 @@ const Facepile = ({ participants, creator }: FacepileProps) => {
5054

5155
return (
5256
<FacepileContainer>
53-
<Avatar src={creator.profilePhoto} size={30} radius={15} />
57+
<StackedAvatar src={creator.profilePhoto} size={30} radius={15} />
5458
{messageAvatars(participantList)}
5559
{hasOverflow && (
56-
<EmptyParticipantHead adjustsFontSizeToFit>
60+
<StackedEmptyParticipantHead size={30} adjustsFontSizeToFit>
5761
{overflowAmount}
58-
</EmptyParticipantHead>
62+
</StackedEmptyParticipantHead>
5963
)}
6064
</FacepileContainer>
6165
);

mobile/components/ThreadItem/style.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @flow
2-
import styled from 'styled-components/native';
2+
import styled, { css } from 'styled-components/native';
33
import { Stylesheet } from 'react-native';
4+
import Avatar from '../Avatar';
45

56
export const InboxThreadItem = styled.View`
67
display: flex;
@@ -53,11 +54,26 @@ export const FacepileContainer = styled.View`
5354
export const EmptyParticipantHead = styled.Text`
5455
color: ${props => props.theme.text.alt};
5556
background: ${props => props.theme.bg.wash};
56-
border-radius: 15px;
57+
border-radius: ${props => (props.radius ? `${props.radius}px` : '15px')};
5758
text-align: center;
5859
text-align-vertical: center;
5960
font-size: 12px;
6061
font-weight: 600;
61-
width: 30px;
62+
height: ${props => (props.size ? `${props.size}px` : '30px')};
63+
width: ${props => (props.size ? `${props.size}px` : '30px')};
6264
overflow: hidden;
6365
`;
66+
67+
const stackingStyles = css`
68+
margin-right: -10px;
69+
border-width: 2px;
70+
border-color: #ffffff;
71+
`;
72+
73+
export const StackedEmptyParticipantHead = styled(EmptyParticipantHead)`
74+
${stackingStyles};
75+
`;
76+
77+
export const StackedAvatar = styled(Avatar)`
78+
${stackingStyles};
79+
`;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Spectrum",
3-
"version": "2.2.12",
3+
"version": "2.2.13",
44
"license": "BSD-3-Clause",
55
"devDependencies": {
66
"babel-cli": "^6.24.1",

0 commit comments

Comments
 (0)