From 492ea8cbaa7193176ee6d4d43f8fb629b8f70b2b Mon Sep 17 00:00:00 2001 From: Benjamin Arias Date: Thu, 26 Jan 2023 14:58:30 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Force=20le=20theme=20par=20d?= =?UTF-8?q?=C3=A9faut=20sur=20PopoverWithTrigger=20(#2477)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Force le theme par défaut sur PopoverWithTrigger --- .../popover/PopoverWithTrigger.tsx | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/site/source/design-system/popover/PopoverWithTrigger.tsx b/site/source/design-system/popover/PopoverWithTrigger.tsx index 5ba186c81..0f5398019 100644 --- a/site/source/design-system/popover/PopoverWithTrigger.tsx +++ b/site/source/design-system/popover/PopoverWithTrigger.tsx @@ -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 && ( - { - state.close() - }} - isDismissable - role="dialog" - small={small} - contentRef={contentRef} - > - {typeof children === 'function' - ? children(() => { - state.close() - }) - : children} - + + { + state.close() + }} + isDismissable + role="dialog" + small={small} + contentRef={contentRef} + > + {typeof children === 'function' + ? children(() => { + state.close() + }) + : children} + + )} )