forked from jitsi/jitsi-meet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from saaltech/implement-chat-toast
Implement chat toast
- Loading branch information
Showing
15 changed files
with
563 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
.chat-preview { | ||
position: absolute; | ||
left: 47px; | ||
top: auto; | ||
bottom: 30px; | ||
z-index: $zindex3; | ||
height: 60vh; | ||
overflow: hidden; | ||
display: flex; | ||
flex-direction: column; | ||
|
||
&::before { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
// background: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(255,255,255,0) 71%); | ||
|
||
height: 50px; | ||
} | ||
|
||
#chatconversation { | ||
display: flex; | ||
flex-direction: column-reverse; | ||
overflow: hidden; | ||
} | ||
} | ||
|
||
.chat-preview-group { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: flex-end; | ||
margin-bottom: 30px; | ||
transition: opacity 0.3s ease-in, transform .5s ease-in; | ||
align-items: flex-end; | ||
|
||
&.expired { | ||
opacity: 0; | ||
transform: translateY(-200%); | ||
} | ||
|
||
.chatmessage { | ||
background-color: #FFF; | ||
border-radius: 6px 6px 6px 0px; | ||
display: inline-block; | ||
margin-top: 3px; | ||
color: #393939; | ||
} | ||
|
||
.chatmessage-wrapper:not(:last-child) .chatmessage { | ||
margin-bottom: 10px; | ||
} | ||
|
||
|
||
.display-name { | ||
display: none; | ||
} | ||
|
||
&.error { | ||
.chatmessage { | ||
background-color: $defaultWarningColor; | ||
border-radius: 0px; | ||
font-weight: 100; | ||
} | ||
|
||
.display-name { | ||
display: none; | ||
} | ||
} | ||
|
||
.chatmessage-wrapper { | ||
max-width: 100%; | ||
|
||
.replywrapper { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
|
||
.messageactions { | ||
align-self: stretch; | ||
border-left: 1px solid $chatActionsSeparatorColor; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
padding: 5px; | ||
|
||
.toolbox-icon { | ||
cursor: pointer; | ||
} | ||
} | ||
} | ||
} | ||
.avatar { | ||
min-width: 45px; | ||
min-height: 45px; | ||
width: 45px !important; | ||
height: 45px !important; | ||
margin-right: 10px; | ||
border: 2px solid #EAEAEA; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
// @flow | ||
|
||
import { Component } from 'react'; | ||
import type { Dispatch } from 'redux'; | ||
|
||
import { getLocalParticipant } from '../../base/participants'; | ||
import { sendMessage, toggleChat, setPrivateMessageRecipient, markAsRead, markPublicAsRead } from '../actions'; | ||
|
||
/** | ||
* The type of the React {@code Component} props of {@code AbstractChatPreview}. | ||
*/ | ||
export type Props = { | ||
|
||
/** | ||
* True if the chat window should be rendered. | ||
*/ | ||
_isOpen: boolean, | ||
|
||
/** | ||
* All the chat messages in the conference. | ||
*/ | ||
_messages: Array<Object>, | ||
|
||
/** | ||
* The local participant. | ||
*/ | ||
_localParticipant: Object, | ||
}; | ||
|
||
/** | ||
* Implements an abstract chat panel. | ||
*/ | ||
export default class AbstractChatPreview<P: Props, S> extends Component<P, S> {} | ||
/** | ||
* Maps redux actions to the props of the component. | ||
* | ||
* @param {Function} dispatch - The redux action {@code dispatch} function. | ||
* @returns {{ | ||
* _onSendMessage: Function, | ||
* _onToggleChat: Function | ||
* }} | ||
* @private | ||
*/ | ||
export function _mapDispatchToProps(dispatch: Dispatch<any>) { | ||
return { | ||
/** | ||
* Toggles the chat window. | ||
* | ||
* @returns {Function} | ||
*/ | ||
_onToggleChat() { | ||
dispatch(toggleChat()); | ||
}, | ||
|
||
/** | ||
* Sends a text message. | ||
* | ||
* @private | ||
* @param {string} text - The text message to be sent. | ||
* @returns {void} | ||
* @type {Function} | ||
*/ | ||
_onSendMessage(text: string) { | ||
dispatch(sendMessage(text)); | ||
}, | ||
|
||
_setPrivateMessageRecipient(participant: Object) { | ||
dispatch(setPrivateMessageRecipient(participant)); | ||
}, | ||
|
||
_markAsRead(localParticipant: Object, participant: Object) { | ||
dispatch(markAsRead(localParticipant, participant)); | ||
}, | ||
|
||
_markPublicAsRead() { | ||
dispatch(markPublicAsRead()); | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
* Maps (parts of) the redux state to {@link Chat} React {@code Component} | ||
* props. | ||
* | ||
* @param {Object} state - The redux store/state. | ||
* @private | ||
* @returns {{ | ||
* _isOpen: boolean, | ||
* _messages: Array<Object>, | ||
* _showNamePrompt: boolean | ||
* }} | ||
*/ | ||
export function _mapStateToProps(state: Object) { | ||
const { | ||
isOpen, | ||
messages | ||
} = state['features/chat']; | ||
|
||
const _localParticipant = getLocalParticipant(state); | ||
|
||
|
||
return { | ||
_isOpen: isOpen, | ||
_messages: messages, | ||
_localParticipant | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.