Skip to content

Commit

Permalink
fix toolbar toast theming by adding is isDarkModeOn logic
Browse files Browse the repository at this point in the history
  • Loading branch information
adamleithp committed Jan 2, 2025
1 parent 97c9879 commit 8bbac6d
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

0 comments on commit 8bbac6d

Please sign in to comment.