diff --git a/frontend/src/lib/components/HedgehogBuddy/HedgehogBuddy.stories.tsx b/frontend/src/lib/components/HedgehogBuddy/HedgehogBuddy.stories.tsx index 9106dabbf4599..63e648a6b07f2 100644 --- a/frontend/src/lib/components/HedgehogBuddy/HedgehogBuddy.stories.tsx +++ b/frontend/src/lib/components/HedgehogBuddy/HedgehogBuddy.stories.tsx @@ -19,6 +19,7 @@ export const TheHedgehog: StoryFn = () => { // eslint-disable-next-line no-console console.log('should close') }} + isDarkModeOn={false} /> ) diff --git a/frontend/src/lib/components/HedgehogBuddy/HedgehogBuddy.tsx b/frontend/src/lib/components/HedgehogBuddy/HedgehogBuddy.tsx index 60b23c8974732..c777e1d06c0a9 100644 --- a/frontend/src/lib/components/HedgehogBuddy/HedgehogBuddy.tsx +++ b/frontend/src/lib/components/HedgehogBuddy/HedgehogBuddy.tsx @@ -390,17 +390,18 @@ export function HedgehogBuddy({ onClick: _onClick, onPositionChange, popoverOverlay, + isDarkModeOn, }: { actorRef?: MutableRefObject onClose: () => void onClick?: () => void onPositionChange?: (actor: HedgehogActor) => void popoverOverlay?: React.ReactNode + // passed in because toolbar needs to check this differently than the app + isDarkModeOn: boolean }): JSX.Element { const actorRef = useRef() - const { isDarkModeOn } = useValues(themeLogic) - if (!actorRef.current) { actorRef.current = new HedgehogActor() if (_actorRef) { @@ -538,6 +539,11 @@ export function HedgehogBuddy({ export function HedgehogBuddyWithLogic(): JSX.Element { const { hedgehogModeEnabled } = useValues(hedgehogbuddyLogic) const { setHedgehogModeEnabled } = useActions(hedgehogbuddyLogic) + const { isDarkModeOn } = useValues(themeLogic) - return hedgehogModeEnabled ? setHedgehogModeEnabled(false)} /> : <> + return hedgehogModeEnabled ? ( + setHedgehogModeEnabled(false)} isDarkModeOn={isDarkModeOn} /> + ) : ( + <> + ) } diff --git a/frontend/src/toolbar/button/HedgehogButton.tsx b/frontend/src/toolbar/button/HedgehogButton.tsx index 634ea3a38732e..44f1b20ae2d0b 100644 --- a/frontend/src/toolbar/button/HedgehogButton.tsx +++ b/frontend/src/toolbar/button/HedgehogButton.tsx @@ -45,6 +45,7 @@ export function HedgehogButton(): JSX.Element { onPositionChange={(actor) => { saveDragPosition(actor.x + SPRITE_SIZE * 0.5, -actor.y - SPRITE_SIZE * 0.5) }} + isDarkModeOn={false} /> )}