fix(ui): removed popup from country flag component; added bg to toggler head
This commit is contained in:
parent
e1ae8bae20
commit
387e946dfe
1 changed files with 4 additions and 11 deletions
|
|
@ -7,24 +7,17 @@ const CountryFlag = React.memo(({ country, className, style = {}, label = false
|
|||
const knownCountry = !!country && country !== 'UN';
|
||||
const countryFlag = knownCountry ? country.toLowerCase() : '';
|
||||
const countryName = knownCountry ? countries[ country ] : 'Unknown Country';
|
||||
|
||||
|
||||
return (
|
||||
<div className="flex items-center" style={style}>
|
||||
<Popup
|
||||
trigger={ knownCountry
|
||||
{knownCountry
|
||||
? <div className={ cn(`flag flag-${ countryFlag }`, className, stl.default) } />
|
||||
: (
|
||||
<div className="flex items-center w-full">
|
||||
<Icon name="flag-na" size="22" className="" />
|
||||
<div className="ml-2 leading-none" style={{ whiteSpace: 'nowrap'}}>Unknown Country</div>
|
||||
</div>
|
||||
)
|
||||
// : <div className={ cn('text-sm', className) }>{ "N/A" }</div>
|
||||
}
|
||||
content={ countryName }
|
||||
inverted
|
||||
size="tiny"
|
||||
/>
|
||||
)}
|
||||
{ knownCountry && label && <div className={ stl.label }>{ countryName }</div> }
|
||||
</div>
|
||||
);
|
||||
|
|
@ -32,4 +25,4 @@ const CountryFlag = React.memo(({ country, className, style = {}, label = false
|
|||
|
||||
CountryFlag.displayName = "CountryFlag";
|
||||
|
||||
export default CountryFlag;
|
||||
export default CountryFlag;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue