Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
a6d05af5
Unverified
Commit
a6d05af5
authored
Feb 28, 2025
by
Igor Stuev
Committed by
GitHub
Feb 28, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix incorrect color mode (#2596)
parent
540d95ee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
chakra.tsx
lib/contexts/chakra.tsx
+7
-3
No files found.
lib/contexts/chakra.tsx
View file @
a6d05af5
...
...
@@ -6,6 +6,7 @@ import {
import
type
{
ChakraProviderProps
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
get
,
NAMES
}
from
'
lib/cookies
'
;
import
theme
from
'
theme/theme
'
;
interface
Props
extends
ChakraProviderProps
{
...
...
@@ -13,8 +14,11 @@ interface Props extends ChakraProviderProps {
}
export
function
ChakraProvider
({
cookies
,
children
}:
Props
)
{
// When a cookie header is present, cookieStorageManagerSSR looks for a "chakra-ui-color-mode" cookie.
// If it doesn’t find one, it doesn’t consider theme’s initialColorMode. Instead, it is defaulting to light mode
// So we need to use localStorageManager instead of cookieStorageManagerSSR to get the correct default color mode
const
colorModeManager
=
typeof
cookies
===
'
string
'
?
typeof
cookies
===
'
string
'
&&
get
(
NAMES
.
COLOR_MODE
,
cookies
)
?
cookieStorageManagerSSR
(
typeof
document
!==
'
undefined
'
?
document
.
cookie
:
cookies
)
:
localStorageManager
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment