Skip to content

Commit

Permalink
fix: toolbar toast theming by adding is isDarkModeOn logic (#27220)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamleithp authored Jan 2, 2025
1 parent a7e1413 commit 1018ca8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/toolbar/ToolbarApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useRef, useState } from 'react'
import root from 'react-shadow'
import { Slide, ToastContainer } from 'react-toastify'

import { themeLogic } from '~/layout/navigation-3000/themeLogic'
import { toolbarConfigLogic } from '~/toolbar/toolbarConfigLogic'
import { ToolbarContainer } from '~/toolbar/ToolbarContainer'
import { ToolbarProps } from '~/types'
Expand All @@ -14,7 +15,7 @@ type HTMLElementWithShadowRoot = HTMLElement & { shadowRoot: ShadowRoot }

export function ToolbarApp(props: ToolbarProps = {}): JSX.Element {
const { apiURL } = useValues(toolbarConfigLogic(props))

const { isDarkModeOn } = useValues(themeLogic)
const shadowRef = useRef<HTMLElementWithShadowRoot | null>(null)
const [didLoadStyles, setDidLoadStyles] = useState(false)

Expand Down Expand Up @@ -61,6 +62,7 @@ export function ToolbarApp(props: ToolbarProps = {}): JSX.Element {
closeOnClick={false}
draggable={false}
position="bottom-center"
theme={isDarkModeOn ? 'dark' : 'light'}
/>
</root.div>
</>
Expand Down

1 comment on commit 1018ca8

@adamleithp
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been reverted in #27294, kea was making some API calls when hitting the themeLogic and causing errors on users websites.

Please sign in to comment.