🎨 Force le theme par défaut sur PopoverWithTrigger (#2477)

Force le theme par défaut sur PopoverWithTrigger
pull/2478/head
Benjamin Arias 2023-01-26 14:58:30 +01:00 committed by GitHub
parent 0d0491bd17
commit 492ea8cbaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 17 deletions

View File

@ -4,6 +4,7 @@ import { AriaButtonProps } from '@react-types/button'
import React, { ReactElement, Ref, RefObject, useEffect, useRef } from 'react'
import { useLocation } from 'react-router-dom'
import { ForceThemeProvider } from '@/contexts/DarkModeContext'
import { Button } from '@/design-system/buttons'
import { omit } from '@/utils'
@ -60,23 +61,25 @@ export default function PopoverWithTrigger({
<>
{triggerButton}
{state.isOpen && (
<Popover
{...overlayProps}
title={title}
onClose={() => {
state.close()
}}
isDismissable
role="dialog"
small={small}
contentRef={contentRef}
>
{typeof children === 'function'
? children(() => {
state.close()
})
: children}
</Popover>
<ForceThemeProvider forceTheme="default">
<Popover
{...overlayProps}
title={title}
onClose={() => {
state.close()
}}
isDismissable
role="dialog"
small={small}
contentRef={contentRef}
>
{typeof children === 'function'
? children(() => {
state.close()
})
: children}
</Popover>
</ForceThemeProvider>
)}
</>
)