Merge pull request #84 from oobjectt/guide-helper-invite

Guide - Invite button enabled
This commit is contained in:
Bill 2022-12-13 23:45:10 -05:00 committed by GitHub
commit 234ca8df2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 21 deletions

View File

@ -20,23 +20,23 @@
.chat-messages { .chat-messages {
height: 200px; height: 200px;
.message-avatar { .message-avatar {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
width: 50px; width: 50px;
height: 50px; height: 50px;
.avatar-image { .avatar-image {
position: absolute; position: absolute;
margin-left: -22px; margin-left: -22px;
margin-top: -25px; margin-top: -25px;
} }
} }
.messages-group-left { .messages-group-left {
position: relative; position: relative;
&:before { &:before {
position: absolute; position: absolute;
content: ' '; content: ' ';
@ -49,10 +49,10 @@
left: -8px; left: -8px;
} }
} }
.messages-group-right { .messages-group-right {
position: relative; position: relative;
&:before { &:before {
position: absolute; position: absolute;
content: ' '; content: ' ';
@ -78,5 +78,10 @@
resize: none; resize: none;
outline: none; outline: none;
line-height: 17px; line-height: 17px;
} }
.text-underline
{
text-decoration: underline;
}
} }

View File

@ -199,20 +199,23 @@ export const GuideToolView: FC<{}> = props =>
{ {
const parser = event.getParser(); const parser = event.getParser();
const messageGroups = [ ...ongoingMessageGroups ]; if (parser.roomId !== 0)
let lastGroup = messageGroups[messageGroups.length - 1];
const guideId = (isOnDuty ? GetSessionDataManager().userId : ongoingUserId);
if(!lastGroup || lastGroup.userId !== guideId)
{ {
lastGroup = new GuideToolMessageGroup(guideId); const messageGroups = [ ...ongoingMessageGroups ];
messageGroups.push(lastGroup);
}
lastGroup.addChat(new GuideToolMessage(parser.roomName, parser.roomId)); let lastGroup = messageGroups[messageGroups.length - 1];
setOngoingMessageGroups(messageGroups);
const guideId = (isOnDuty ? GetSessionDataManager().userId : ongoingUserId);
if(!lastGroup || lastGroup.userId !== guideId)
{
lastGroup = new GuideToolMessageGroup(guideId);
messageGroups.push(lastGroup);
}
lastGroup.addChat(new GuideToolMessage(parser.roomName, parser.roomId));
setOngoingMessageGroups(messageGroups);
}
}); });
useMessageEvent<GuideSessionEndedMessageEvent>(GuideSessionEndedMessageEvent, event => useMessageEvent<GuideSessionEndedMessageEvent>(GuideSessionEndedMessageEvent, event =>

View File

@ -76,7 +76,7 @@ export const GuideToolOngoingView: FC<GuideToolOngoingViewProps> = props =>
{ isGuide && { isGuide &&
<ButtonGroup> <ButtonGroup>
<Button onClick={ visit }>{ LocalizeText('guide.help.request.guide.ongoing.visit.button') }</Button> <Button onClick={ visit }>{ LocalizeText('guide.help.request.guide.ongoing.visit.button') }</Button>
<Button disabled onClick={ invite }>{ LocalizeText('guide.help.request.guide.ongoing.invite.button') }</Button> <Button onClick={ invite }>{ LocalizeText('guide.help.request.guide.ongoing.invite.button') }</Button>
</ButtonGroup> } </ButtonGroup> }
{ !isGuide && { !isGuide &&
<Column gap={ 0 }> <Column gap={ 0 }>
@ -100,7 +100,7 @@ export const GuideToolOngoingView: FC<GuideToolOngoingViewProps> = props =>
{ (isOwnChat(group.userId)) && GetSessionDataManager().userName } { (isOwnChat(group.userId)) && GetSessionDataManager().userName }
{ (!isOwnChat(group.userId)) && userName } { (!isOwnChat(group.userId)) && userName }
</Text> </Text>
{ group.messages.map((chat, index) => <Base key={ index } className="text-break">{ chat.message }</Base>) } { group.messages.map((chat, index) => <Base key={ index } pointer={ chat.roomId ? true : false } className={ chat.roomId ? 'text-break text-underline' : 'text-break' } onClick={ () => chat.roomId ? TryVisitRoom(chat.roomId) : null }>{ chat.message }</Base>) }
</Base> </Base>
{ (isOwnChat(group.userId)) && { (isOwnChat(group.userId)) &&
<Base className="message-avatar flex-shrink-0"> <Base className="message-avatar flex-shrink-0">