mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-15 01:57:47 +00:00
Created Reusable components for: - ListItem - used by participants list and lobby participants list - ContextMenu - used by participant context menu and advanced moderation context menu - Quick action button - used by quick action buttons on participant list items Moved participants custom theme to base/components/themes Created reusable button component for all participants pane buttons (Invite, Mute All, More) Moved web components to web folder Moved all styles from Styled Components to JSS Fixed accessibility labels for some buttons Removed unused code Updated all styles to use theme tokens
68 lines
1.5 KiB
JavaScript
68 lines
1.5 KiB
JavaScript
// @flow
|
|
|
|
import { makeStyles } from '@material-ui/styles';
|
|
import React from 'react';
|
|
|
|
type Props = {
|
|
|
|
/**
|
|
* Label used for accessibility.
|
|
*/
|
|
accessibilityLabel: string,
|
|
|
|
/**
|
|
* Additional class name for custom styles.
|
|
*/
|
|
className: string,
|
|
|
|
/**
|
|
* Children of the component.
|
|
*/
|
|
children: string | React$Node,
|
|
|
|
/**
|
|
* Click handler
|
|
*/
|
|
onClick: Function,
|
|
|
|
/**
|
|
* Data test id.
|
|
*/
|
|
testId?: string
|
|
}
|
|
|
|
const useStyles = makeStyles(theme => {
|
|
return {
|
|
button: {
|
|
backgroundColor: theme.palette.action01,
|
|
color: theme.palette.text01,
|
|
borderRadius: `${theme.shape.borderRadius}px`,
|
|
...theme.typography.labelBold,
|
|
lineHeight: `${theme.typography.labelBold.lineHeight}px`,
|
|
padding: '8px 12px',
|
|
display: 'flex',
|
|
justifyContent: 'center',
|
|
alignItems: 'center',
|
|
border: 0,
|
|
|
|
'&:hover': {
|
|
backgroundColor: theme.palette.action01Hover
|
|
}
|
|
}
|
|
};
|
|
});
|
|
|
|
const QuickActionButton = ({ accessibilityLabel, className, children, onClick, testId }: Props) => {
|
|
const styles = useStyles();
|
|
|
|
return (<button
|
|
aria-label = { accessibilityLabel }
|
|
className = { `${styles.button} ${className}` }
|
|
data-testid = { testId }
|
|
onClick = { onClick }>
|
|
{children}
|
|
</button>);
|
|
};
|
|
|
|
export default QuickActionButton;
|