Skip to content

Commit 5e93626

Browse files
fix: sidenav sibling seperated v2
1 parent 5c817ba commit 5e93626

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed
Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
11
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2-
export const ThemeSwitch = ({ sibling }: any) => {
3-
return <>{sibling} hello</>
2+
export const ThemeSwitch = () => {
3+
return (
4+
<>
5+
<button className="fern-search-bar w-full">
6+
<span className="search-placeholder">
7+
<svg
8+
width="15"
9+
height="15"
10+
viewBox="0 0 15 15"
11+
fill="none"
12+
xmlns="http://www.w3.org/2000/svg"
13+
className="size-5">
14+
<path
15+
d="M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z"
16+
fill="currentColor"
17+
fill-rule="evenodd"
18+
clip-rule="evenodd"></path>
19+
</svg>
20+
<span>Search...</span>
21+
</span>
22+
<span className="keyboard-shortcut-hint">/</span>
23+
</button>
24+
hello
25+
</>
26+
)
427
}

custom-implementation/src/main.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ const render = async () => {
4242
)
4343

4444
console.log('sibling', search, search?.parentNode)
45-
ReactDOM.render(
46-
React.createElement(ThemeSwitch, {
47-
sibling: search,
48-
}),
49-
sidenav,
50-
)
45+
ReactDOM.render(React.createElement(ThemeSwitch), sidenav)
5146
}
5247

5348
let observations = 0

0 commit comments

Comments
 (0)