mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-14 15:47:47 +00:00
Update Dial Out Dialog design Update Country Picker design Convert some files to TS Move styles from SCSS to JSS Replace atlaskit InlineDialog with Popover in CountryPIcker and Prejoin components
68 lines
1.6 KiB
TypeScript
68 lines
1.6 KiB
TypeScript
import React from 'react';
|
|
import { makeStyles } from 'tss-react/mui';
|
|
|
|
import { withPixelLineHeight } from '../../../../base/styles/functions.web';
|
|
|
|
interface IProps {
|
|
|
|
/**
|
|
* Country of the entry.
|
|
*/
|
|
country: { code: string; dialCode: string; name: string; };
|
|
|
|
/**
|
|
* Entry click handler.
|
|
*/
|
|
onEntryClick: Function;
|
|
}
|
|
|
|
const useStyles = makeStyles()(theme => {
|
|
return {
|
|
container: {
|
|
display: 'flex',
|
|
padding: '10px',
|
|
alignItems: 'center',
|
|
backgroundColor: theme.palette.action03,
|
|
|
|
'&:hover': {
|
|
backgroundColor: theme.palette.action03Hover
|
|
}
|
|
},
|
|
|
|
flag: {
|
|
marginRight: theme.spacing(2)
|
|
},
|
|
|
|
text: {
|
|
color: theme.palette.text01,
|
|
...withPixelLineHeight(theme.typography.bodyShortRegular),
|
|
flexGrow: 1,
|
|
overflow: 'hidden',
|
|
textOverflow: 'ellipsis',
|
|
whiteSpace: 'nowrap'
|
|
}
|
|
};
|
|
});
|
|
|
|
const CountryRow = ({ country, onEntryClick }: IProps) => {
|
|
const { classes, cx } = useStyles();
|
|
|
|
const _onClick = () => {
|
|
onEntryClick(country);
|
|
};
|
|
|
|
return (
|
|
<div
|
|
className = { classes.container }
|
|
// eslint-disable-next-line react/jsx-no-bind
|
|
onClick = { _onClick }>
|
|
<div className = { cx(classes.flag, 'iti-flag', country.code) } />
|
|
<div className = { classes.text }>
|
|
{`${country.name} (+${country.dialCode})`}
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default CountryRow;
|