@@ -51,80 +51,85 @@ function withSearchParams(Cmp) {
51
51
} ;
52
52
}
53
53
54
- const App = ( ) => (
55
- < Layout >
56
- < PendoContainer />
57
- < ErrorBoundary >
58
- < Switch >
59
- < Route exact path = { V2Routes . Automations } component = { Automations } />
60
- < Route
61
- path = { V2Routes . Kustomization }
62
- component = { withSearchParams ( KustomizationPage ) }
63
- />
64
- < Route path = { V2Routes . Sources } component = { Sources } />
65
- < Route
66
- path = { V2Routes . ImageAutomation }
67
- component = { ImageAutomationPage }
68
- />
69
- < Route
70
- path = { V2Routes . ImageAutomationUpdatesDetails }
71
- component = { withSearchParams ( ImageAutomationUpdatesDetails ) }
72
- />
73
- < Route
74
- path = { V2Routes . ImageAutomationRepositoryDetails }
75
- component = { withSearchParams ( ImageAutomationRepoDetails ) }
76
- />
77
- < Route
78
- path = { V2Routes . ImagePolicyDetails }
79
- component = { withSearchParams ( ImagePolicyDetails ) }
80
- />
81
- < Route path = { V2Routes . FluxRuntime } component = { FluxRuntime } />
82
- < Route
83
- path = { V2Routes . GitRepo }
84
- component = { withSearchParams ( GitRepositoryDetail ) }
85
- />
86
- < Route
87
- path = { V2Routes . HelmRepo }
88
- component = { withSearchParams ( HelmRepositoryDetail ) }
89
- />
90
- < Route
91
- path = { V2Routes . Bucket }
92
- component = { withSearchParams ( BucketDetail ) }
93
- />
94
- < Route
95
- path = { V2Routes . HelmRelease }
96
- component = { withSearchParams ( HelmReleasePage ) }
97
- />
98
- < Route
99
- path = { V2Routes . HelmChart }
100
- component = { withSearchParams ( HelmChartDetail ) }
101
- />
102
- < Route
103
- path = { V2Routes . OCIRepository }
104
- component = { withSearchParams ( OCIRepositoryPage ) }
105
- />
106
- < Route
107
- path = { V2Routes . Notifications }
108
- component = { withSearchParams ( Notifications ) }
109
- />
110
- < Route
111
- path = { V2Routes . Provider }
112
- component = { withSearchParams ( ProviderPage ) }
113
- />
114
- < Route path = { V2Routes . UserInfo } component = { UserInfo } />
54
+ const App = ( ) => {
55
+ const { settings } = React . useContext ( AppContext ) ;
56
+ const dark = settings . theme === "dark" ;
57
+ return (
58
+ < Layout >
59
+ < PendoContainer />
60
+ < ErrorBoundary >
61
+ < Switch >
62
+ < Route exact path = { V2Routes . Automations } component = { Automations } />
63
+ < Route
64
+ path = { V2Routes . Kustomization }
65
+ component = { withSearchParams ( KustomizationPage ) }
66
+ />
67
+ < Route path = { V2Routes . Sources } component = { Sources } />
68
+ < Route
69
+ path = { V2Routes . ImageAutomation }
70
+ component = { ImageAutomationPage }
71
+ />
72
+ < Route
73
+ path = { V2Routes . ImageAutomationUpdatesDetails }
74
+ component = { withSearchParams ( ImageAutomationUpdatesDetails ) }
75
+ />
76
+ < Route
77
+ path = { V2Routes . ImageAutomationRepositoryDetails }
78
+ component = { withSearchParams ( ImageAutomationRepoDetails ) }
79
+ />
80
+ < Route
81
+ path = { V2Routes . ImagePolicyDetails }
82
+ component = { withSearchParams ( ImagePolicyDetails ) }
83
+ />
84
+ < Route path = { V2Routes . FluxRuntime } component = { FluxRuntime } />
85
+ < Route
86
+ path = { V2Routes . GitRepo }
87
+ component = { withSearchParams ( GitRepositoryDetail ) }
88
+ />
89
+ < Route
90
+ path = { V2Routes . HelmRepo }
91
+ component = { withSearchParams ( HelmRepositoryDetail ) }
92
+ />
93
+ < Route
94
+ path = { V2Routes . Bucket }
95
+ component = { withSearchParams ( BucketDetail ) }
96
+ />
97
+ < Route
98
+ path = { V2Routes . HelmRelease }
99
+ component = { withSearchParams ( HelmReleasePage ) }
100
+ />
101
+ < Route
102
+ path = { V2Routes . HelmChart }
103
+ component = { withSearchParams ( HelmChartDetail ) }
104
+ />
105
+ < Route
106
+ path = { V2Routes . OCIRepository }
107
+ component = { withSearchParams ( OCIRepositoryPage ) }
108
+ />
109
+ < Route
110
+ path = { V2Routes . Notifications }
111
+ component = { withSearchParams ( Notifications ) }
112
+ />
113
+ < Route
114
+ path = { V2Routes . Provider }
115
+ component = { withSearchParams ( ProviderPage ) }
116
+ />
117
+ < Route path = { V2Routes . UserInfo } component = { UserInfo } />
115
118
116
- < Redirect exact from = "/" to = { V2Routes . Automations } />
119
+ < Redirect exact from = "/" to = { V2Routes . Automations } />
117
120
118
- < Route exact path = "*" component = { Error } />
119
- </ Switch >
120
- </ ErrorBoundary >
121
- < ToastContainer
122
- position = "top-center"
123
- autoClose = { 5000 }
124
- newestOnTop = { false }
125
- />
126
- </ Layout >
127
- ) ;
121
+ < Route exact path = "*" component = { Error } />
122
+ </ Switch >
123
+ </ ErrorBoundary >
124
+ < ToastContainer
125
+ position = "top-center"
126
+ autoClose = { 5000 }
127
+ newestOnTop = { false }
128
+ theme = { dark ? "dark" : "light" }
129
+ />
130
+ </ Layout >
131
+ ) ;
132
+ } ;
128
133
129
134
const StylesProvider = ( { children } ) => {
130
135
const { settings } = React . useContext ( AppContext ) ;
0 commit comments