mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02: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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user