mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-16 15:57:48 +00:00
* Make Jitsi WCAG 2.1 compliant * Fixed password form keypress handling * Added keypress handler to name form * Removed unneccessary dom query * Fixed mouse hove style * Removed obsolete css rules * accessibilty background feature * Merge remote-tracking branch 'upstream/master' into nic/fix/merge-conflicts * fix error * add german translation * Fixed merge issue * Add id prop back to device selection * Fixed lockfile Co-authored-by: AHMAD KADRI <52747422+ahmadkadri@users.noreply.github.com>
49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
// @flow
|
|
|
|
import React, { useCallback } from 'react';
|
|
|
|
import { Icon, IconArrowDown } from '../../../base/icons';
|
|
|
|
type Props = {
|
|
|
|
/**
|
|
* Country object of the entry.
|
|
*/
|
|
country: { name: string, dialCode: string, code: string },
|
|
|
|
/**
|
|
* Click handler for the selector.
|
|
*/
|
|
onClick: Function,
|
|
};
|
|
|
|
/**
|
|
* This component displays the country selector with the flag.
|
|
*
|
|
* @returns {ReactElement}
|
|
*/
|
|
function CountrySelector({ country: { code, dialCode }, onClick }: Props) {
|
|
const onKeyPressHandler = useCallback(e => {
|
|
if (onClick && (e.key === ' ' || e.key === 'Enter')) {
|
|
e.preventDefault();
|
|
onClick();
|
|
}
|
|
}, [ onClick ]);
|
|
|
|
return (
|
|
<div
|
|
className = 'cpick-selector'
|
|
onClick = { onClick }
|
|
onKeyPress = { onKeyPressHandler }>
|
|
<div className = { `prejoin-dialog-flag iti-flag ${code}` } />
|
|
<span>{`+${dialCode}`}</span>
|
|
<Icon
|
|
className = 'cpick-icon'
|
|
size = { 16 }
|
|
src = { IconArrowDown } />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default CountrySelector;
|