fix: gap in menu of country code selector

This commit is contained in:
Koosha Lahouti
2025-09-25 18:00:48 +03:30
parent 4884a5942f
commit 0cd199531e
7 changed files with 16 additions and 20 deletions

2
.npmrc
View File

@@ -1,2 +0,0 @@
@rkheftan:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=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

View File

@@ -163,7 +163,7 @@ export function CountryCodeSelector({
/>
</Box>
<Box sx={{ width: '100%', height: '16rem' }}>
<Box sx={{ width: '100%', height: '25rem' }}>
{filteredCountries.length === 0 ? (
<MenuItem disabled>
<ListItem>
@@ -176,35 +176,33 @@ export function CountryCodeSelector({
<Virtuoso
style={{ height: '100%', width: '100%' }}
data={filteredCountries}
initialTopMostItemIndex={searchTerm ? 0 : initialIndex}
initialTopMostItemIndex={initialIndex}
itemContent={(_, country) => (
<MenuItem
key={country.code}
selected={country.phone === value}
onClick={() => handleSelect(country)}
sx={{
minHeight: '48px',
'&.Mui-selected': {
backgroundColor: 'action.selected',
},
}}
sx={{ justifyContent: 'space-between' }}
>
<ListItemIcon>
<ReactCountryFlag
countryCode={country.code}
svg
style={{ height: '1.125rem', width: '1.125rem' }}
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
<ListItemIcon sx={{ minWidth: 'auto' }}>
<ReactCountryFlag
countryCode={country.code}
svg
style={{ height: '1.125rem', width: '1.125rem' }}
/>
</ListItemIcon>
<ListItemText
primary={t(country.label, { ns: 'country' })}
/>
</ListItemIcon>
<ListItemText
primary={t(country.label, { ns: 'country' })}
/>
</Box>
<Typography color="text.secondary">
<LTRBox>{country.phone}</LTRBox>
</Typography>
</MenuItem>
)}
computeItemKey={(_, country) => country.code}
computeItemKey={(_, c) => c.code}
/>
)}
</Box>