mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
Create Tooltip component Fix Popover positioning calculations Add margins to popover Remove @atlaskit/tooltip Update all components to use the new Tooltip component Added tooltip actions and reducers for the following functionality: when a user hovers over an element is sees the tooltip for that element and then hovers another element that has a tooltip, instead of using the delay and animations we just unmount the current tooltip and mount the next one immediately
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
import clsx from 'clsx';
|
|
import React from 'react';
|
|
import { useSelector } from 'react-redux';
|
|
import { makeStyles } from 'tss-react/mui';
|
|
|
|
import { getConferenceName } from '../../../base/conference/functions';
|
|
import { withPixelLineHeight } from '../../../base/styles/functions.web';
|
|
import Tooltip from '../../../base/tooltip/components/Tooltip';
|
|
|
|
const useStyles = makeStyles()(theme => {
|
|
return {
|
|
container: {
|
|
...withPixelLineHeight(theme.typography.bodyLongRegular),
|
|
color: theme.palette.text01,
|
|
padding: '2px 16px',
|
|
backgroundColor: 'rgba(0, 0, 0, 0.6)',
|
|
maxWidth: '324px',
|
|
boxSizing: 'border-box',
|
|
height: '28px',
|
|
borderRadius: `${theme.shape.borderRadius}px 0 0 ${theme.shape.borderRadius}px`,
|
|
marginLeft: '2px',
|
|
|
|
'@media (max-width: 300px)': {
|
|
display: 'none'
|
|
}
|
|
},
|
|
content: {
|
|
overflow: 'hidden',
|
|
textOverflow: 'ellipsis',
|
|
whiteSpace: 'nowrap'
|
|
}
|
|
};
|
|
});
|
|
|
|
/**
|
|
* Label for the conference name.
|
|
*
|
|
* @returns {ReactElement}
|
|
*/
|
|
const SubjectText = () => {
|
|
const subject = useSelector(getConferenceName);
|
|
const { classes } = useStyles();
|
|
|
|
return (
|
|
<Tooltip
|
|
content = { subject }
|
|
position = 'bottom'>
|
|
<div className = { classes.container }>
|
|
<div className = { clsx('subject-text--content', classes.content) }>{subject}</div>
|
|
</div>
|
|
</Tooltip>
|
|
);
|
|
};
|
|
|
|
export default SubjectText;
|