mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-17 21:05:04 -04:00
Merge pull request #20219 from overleaf/rd-dropdown-alignment
[web] Language picker dropdown should expand to the top GitOrigin-RevId: 591a6fc013d2a9e841acd09d6881727aed38471b
This commit is contained in:
parent
1f6418f48f
commit
54fb884aaf
3 changed files with 9 additions and 2 deletions
|
@ -18,7 +18,7 @@ function LanguagePicker() {
|
|||
const currentUrlWithQueryParams = window.location.pathname
|
||||
|
||||
return (
|
||||
<Dropdown>
|
||||
<Dropdown drop="up">
|
||||
<DropdownToggle
|
||||
id="language-picker-toggle"
|
||||
aria-label={t('select_a_language')}
|
||||
|
@ -37,7 +37,12 @@ function LanguagePicker() {
|
|||
<DropdownMenu className="sm" aria-labelledby="language-picker-toggle">
|
||||
{subdomainLang &&
|
||||
Object.entries(subdomainLang).map(([subdomain, subdomainDetails]) => {
|
||||
if (!subdomainDetails || !subdomainDetails.lngCode) return null
|
||||
if (
|
||||
!subdomainDetails ||
|
||||
!subdomainDetails.lngCode ||
|
||||
subdomainDetails.hide
|
||||
)
|
||||
return null
|
||||
const isActive = subdomainDetails.lngCode === currentLangCode
|
||||
return (
|
||||
<li role="none" key={subdomain}>
|
||||
|
|
|
@ -17,6 +17,7 @@ export type DropdownProps = {
|
|||
onToggle?: (show: boolean) => void
|
||||
show?: boolean
|
||||
autoClose?: boolean | 'inside' | 'outside'
|
||||
drop?: 'up' | 'up-centered' | 'start' | 'end' | 'down' | 'down-centered'
|
||||
}
|
||||
|
||||
export type DropdownItemProps = PropsWithChildren<{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export interface SubdomainDetails {
|
||||
hide?: boolean
|
||||
lngCode: string
|
||||
url: string
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue