File tree 4 files changed +26
-47
lines changed
4 files changed +26
-47
lines changed Original file line number Diff line number Diff line change @@ -2,36 +2,7 @@ import { Link } from "react-router-dom";
2
2
import { SidebarTrigger } from "./ui/sidebar" ;
3
3
import { Separator } from "./ui/separator" ;
4
4
import { HoverPopover } from "./HoverPopover" ;
5
-
6
- // function HeaderMenuItem({ children }: { children: React.ReactNode }) {
7
- // return (
8
- // <div className="text-black hover:text-gray-800 font-semibold cursor-pointer text-base px-2 py-1 rounded-md hover:bg-brand-50 transition-colors">
9
- // {children}
10
- // </div>
11
- // );
12
- // }
13
-
14
- // function DropdownMenu({ children }: { children: React.ReactNode }) {
15
- // return (
16
- // <div className="absolute right-0 top-full mt-2 w-56 bg-base rounded-lg shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 border border-gray-100">
17
- // <div className="py-1">{children}</div>
18
- // </div>
19
- // );
20
- // }
21
-
22
- // function DropdownMenuItem({
23
- // children,
24
- // to,
25
- // }: {
26
- // to: string;
27
- // children: React.ReactNode;
28
- // }) {
29
- // return (
30
- // <Link to={to} className="block px-5 py-3 text-gray-700 hover:bg-brand-50">
31
- // {children}
32
- // </Link>
33
- // );
34
- // }
5
+ import { ButtonDarkMode } from "@stacklok/ui-kit" ;
35
6
36
7
export function Header ( { hasError } : { hasError ?: boolean } ) {
37
8
return (
@@ -97,6 +68,8 @@ export function Header({ hasError }: { hasError?: boolean }) {
97
68
</ a >
98
69
</ div >
99
70
</ div >
71
+
72
+ < ButtonDarkMode />
100
73
</ div >
101
74
</ header >
102
75
) ;
Original file line number Diff line number Diff line change 1
- import { render } from "@/lib/test-utils" ;
2
1
import { screen } from "@testing-library/react" ;
3
2
import { describe , expect , it , vi } from "vitest" ;
4
3
import ErrorBoundary from "../ErrorBoundary" ;
5
4
import { Error } from "../Error" ;
5
+ import { render } from "@/lib/test-utils" ;
6
6
7
7
const ErrorComponent = ( ) => {
8
8
throw Error ( ) ;
Original file line number Diff line number Diff line change 1
1
import { SidebarProvider } from "@/components/ui/sidebar" ;
2
+ import { DarkModeProvider } from "@stacklok/ui-kit" ;
2
3
import { QueryClient , QueryClientProvider } from "@tanstack/react-query" ;
3
4
import { RenderOptions , render } from "@testing-library/react" ;
4
5
import React from "react" ;
@@ -31,14 +32,16 @@ const renderWithProviders = (
31
32
} )
32
33
}
33
34
>
34
- < MemoryRouter { ...options ?. routeConfig } >
35
- < Routes >
36
- < Route
37
- path = { options ?. pathConfig ?? "*" }
38
- element = { < SidebarProvider > { children } </ SidebarProvider > }
39
- />
40
- </ Routes >
41
- </ MemoryRouter >
35
+ < DarkModeProvider >
36
+ < MemoryRouter { ...options ?. routeConfig } >
37
+ < Routes >
38
+ < Route
39
+ path = { options ?. pathConfig ?? "*" }
40
+ element = { < SidebarProvider > { children } </ SidebarProvider > }
41
+ />
42
+ </ Routes >
43
+ </ MemoryRouter >
44
+ </ DarkModeProvider >
42
45
</ QueryClientProvider > ,
43
46
) ;
44
47
Original file line number Diff line number Diff line change 1
1
import { StrictMode } from "react" ;
2
2
import { createRoot } from "react-dom/client" ;
3
3
import "./index.css" ;
4
- import ' @stacklok/ui-kit/style'
4
+ import " @stacklok/ui-kit/style" ;
5
5
import App from "./App.tsx" ;
6
6
import { BrowserRouter } from "react-router-dom" ;
7
7
import { SidebarProvider } from "./components/ui/sidebar.tsx" ;
8
8
import { QueryClient , QueryClientProvider } from "@tanstack/react-query" ;
9
9
import ErrorBoundary from "./components/ErrorBoundary.tsx" ;
10
10
import { Error } from "./components/Error.tsx" ;
11
+ import { DarkModeProvider } from "@stacklok/ui-kit" ;
11
12
12
13
createRoot ( document . getElementById ( "root" ) ! ) . render (
13
14
< StrictMode >
14
15
< BrowserRouter >
15
- < SidebarProvider >
16
- < ErrorBoundary fallback = { < Error /> } >
17
- < QueryClientProvider client = { new QueryClient ( ) } >
18
- < App />
19
- </ QueryClientProvider >
20
- </ ErrorBoundary >
21
- </ SidebarProvider >
16
+ < DarkModeProvider >
17
+ < SidebarProvider >
18
+ < ErrorBoundary fallback = { < Error /> } >
19
+ < QueryClientProvider client = { new QueryClient ( ) } >
20
+ < App />
21
+ </ QueryClientProvider >
22
+ </ ErrorBoundary >
23
+ </ SidebarProvider >
24
+ </ DarkModeProvider >
22
25
</ BrowserRouter >
23
26
</ StrictMode >
24
27
) ;
You can’t perform that action at this time.
0 commit comments