Skip to content

Commit ee733a8

Browse files
fix: sidenav sibling
1 parent 06bd5da commit ee733a8

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2+
export const ThemeSwitch = ({ sibling }: any) => {
3+
return <>{sibling} hello</>
4+
}

custom-implementation/src/main.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import React from 'react'
77

88
import Header from './components/header'
99
import Footer from './components/footer'
10+
import { ThemeSwitch } from './components/theme-switch'
1011

1112
import { getPageData } from './modules/sanity/utils'
1213

@@ -16,6 +17,8 @@ const render = async () => {
1617
*/
1718

1819
const data = await getPageData()
20+
const sidenav = // eslint-disable-next-line @typescript-eslint/no-explicit-any
21+
document.querySelector('button.fern-search-bar')?.parentElement as any
1922

2023
ReactDOM.render(
2124
React.createElement(Header, { ...data.header }),
@@ -35,6 +38,9 @@ const render = async () => {
3538
if (footer) footer.style.display = 'block'
3639
},
3740
)
41+
42+
// console.log('sidenav', sidenav)
43+
ReactDOM.render(React.createElement(ThemeSwitch), sidenav)
3844
}
3945

4046
let observations = 0

0 commit comments

Comments
 (0)