mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-12 15:32:27 -05:00
e588b0748a
Add Bootstrap 5 Redesign variant of currency selector GitOrigin-RevId: f0f4176f7d51835a7e15324be7cfcaab0af5bf36
38 lines
1,019 B
TypeScript
38 lines
1,019 B
TypeScript
import { MenuItem, MenuItemProps } from 'react-bootstrap'
|
|
import { DropdownItem } from '@/features/ui/components/bootstrap-5/dropdown-menu'
|
|
import { DropdownItemProps } from '@/features/ui/components/types/dropdown-menu-props'
|
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
|
|
|
type OLDropdownMenuItemProps = DropdownItemProps & {
|
|
bs3Props?: MenuItemProps
|
|
}
|
|
|
|
function OLDropdownMenuItem(props: OLDropdownMenuItemProps) {
|
|
const { bs3Props, ...rest } = props
|
|
|
|
const bs3MenuItemProps: MenuItemProps = {
|
|
children: rest.leadingIcon ? (
|
|
<>
|
|
{rest.leadingIcon}
|
|
|
|
{rest.children}
|
|
</>
|
|
) : (
|
|
rest.children
|
|
),
|
|
onClick: rest.onClick,
|
|
href: rest.href,
|
|
download: rest.download,
|
|
eventKey: rest.eventKey,
|
|
...bs3Props,
|
|
}
|
|
|
|
return (
|
|
<BootstrapVersionSwitcher
|
|
bs3={<MenuItem {...bs3MenuItemProps} />}
|
|
bs5={<DropdownItem {...rest} />}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export default OLDropdownMenuItem
|