-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a4fb72
commit 4f52a29
Showing
4 changed files
with
137 additions
and
17 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
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,61 @@ | ||
// @flow | ||
|
||
import React from 'react'; | ||
|
||
import { Avatar } from '../../../avatar'; | ||
import { connect } from '../../../redux'; | ||
import { calculateAvatarDimensions } from '../../functions'; | ||
|
||
type Props = { | ||
|
||
/** | ||
* The height of the window. | ||
*/ | ||
height: number, | ||
|
||
/** | ||
* The name of the participant (if any). | ||
*/ | ||
name: string | ||
} | ||
|
||
/** | ||
* Component displaying the avatar for the premeeting screen. | ||
* | ||
* @param {Props} props - The props of the component. | ||
* @returns {ReactElement} | ||
*/ | ||
function PremeetingAvatar({ height, name }: Props) { | ||
const { marginTop, size } = calculateAvatarDimensions(height); | ||
|
||
if (size <= 5) { | ||
return null; | ||
} | ||
|
||
|
||
return ( | ||
<div style = {{ marginTop }}> | ||
<Avatar | ||
className = 'preview-avatar' | ||
displayName = { name } | ||
participantId = 'local' | ||
size = { size } /> | ||
</div> | ||
); | ||
} | ||
|
||
/** | ||
* Maps (parts of) the redux state to the React {@code Component} props. | ||
* | ||
* @param {Object} state - The redux state. | ||
* @returns {{ | ||
* height: number | ||
* }} | ||
*/ | ||
function mapStateToProps(state) { | ||
return { | ||
height: state['features/base/responsive-ui'].clientHeight | ||
}; | ||
} | ||
|
||
export default connect(mapStateToProps)(PremeetingAvatar); |
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