Skip to content

Commit c7dee6a

Browse files
Revert "theme"
This reverts commit a65a562.
1 parent a65a562 commit c7dee6a

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

custom-implementation/src/components/header.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { useEffect, useState, useRef } from 'react'
3+
import { useEffect, useState } from 'react'
44
import {
55
ComponentConfigContext,
66
HeaderV30 as SharedHeader,
@@ -16,17 +16,10 @@ const Header = ({
1616
}: // eslint-disable-next-line @typescript-eslint/no-explicit-any
1717
any) => {
1818
const html = document.getElementsByTagName('html')[0]
19-
const [theme, setTheme] = useState(html.getAttribute('class') || 'light') // Default to 'light' if no class is present
20-
21-
const themeRef = useRef(theme)
22-
themeRef.current = theme
23-
19+
const [theme, setTheme] = useState(html.getAttribute('class'))
2420
useEffect(() => {
2521
const observer = new MutationObserver(() => {
26-
const newTheme = html.getAttribute('class') || 'light'
27-
if (themeRef.current !== newTheme) {
28-
setTheme(newTheme)
29-
}
22+
setTheme(html.getAttribute('class'))
3023
})
3124

3225
const config = { attributes: true, attributeFilter: ['class'] }
@@ -46,7 +39,7 @@ any) => {
4639
logo={logo}
4740
items={links}
4841
actions={actions}
49-
version={theme === 'dark' ? 'dark' : 'light'} // Ensure the theme is correctly reflected
42+
version={theme === 'dark' ? 'light' : 'dark'}
5043
collapseOnScroll={collapseOnScroll}
5144
wrapperClassName="custom-header"
5245
/>

fern/fern.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"organization": "devrev",
3-
"version": "0.29.0"
3+
"version": "0.28.0"
44
}

0 commit comments

Comments
 (0)