File tree Expand file tree Collapse file tree 2 files changed +37
-2
lines changed
src/LinkDotNet.Blog.Web/Features/Home/Components Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 54
54
</li >
55
55
56
56
<AccessControl CurrentUri =" @currentUri" ></AccessControl >
57
- <li ><ThemeToggler Class =" nav-link" ></ThemeToggler ></li >
57
+ <li class = " nav-item d-flex align-items-center justify-content-center " ><ThemeToggler Class =" nav-link" ></ThemeToggler ></li >
58
58
<li class =" d-flex" >
59
59
<SearchInput SearchEntered =" NavigateToSearchPage" ></SearchInput >
60
60
</li >
Original file line number Diff line number Diff line change 2
2
@inject IJSRuntime JSRuntime
3
3
@inject ILocalStorageService LocalStorageService
4
4
5
- <span class =" @Class theme-toggle" style =" cursor : pointer " @onclick =" ToggleMode" > Color Mode</span >
5
+ <div class =" position-relative d-inline-block @Class cursor-pointer" role =" button" @onclick =" ToggleMode" title =" Toggle theme" >
6
+
7
+ @if (currentTheme == " light" )
8
+ {
9
+ <svg xmlns =" http://www.w3.org/2000/svg"
10
+ width =" 20"
11
+ height =" 20"
12
+ viewBox =" 0 0 24 24"
13
+ fill =" none"
14
+ stroke =" currentColor"
15
+ class =" text-secondary" >
16
+ <circle cx =" 12" cy =" 12" r =" 5" />
17
+ <line x1 =" 12" y1 =" 1" x2 =" 12" y2 =" 3" />
18
+ <line x1 =" 12" y1 =" 21" x2 =" 12" y2 =" 23" />
19
+ <line x1 =" 4.22" y1 =" 4.22" x2 =" 5.64" y2 =" 5.64" />
20
+ <line x1 =" 18.36" y1 =" 18.36" x2 =" 19.78" y2 =" 19.78" />
21
+ <line x1 =" 1" y1 =" 12" x2 =" 3" y2 =" 12" />
22
+ <line x1 =" 21" y1 =" 12" x2 =" 23" y2 =" 12" />
23
+ <line x1 =" 4.22" y1 =" 19.78" x2 =" 5.64" y2 =" 18.36" />
24
+ <line x1 =" 18.36" y1 =" 5.64" x2 =" 19.78" y2 =" 4.22" />
25
+ </svg >
26
+ }
27
+ else
28
+ {
29
+ <svg xmlns =" http://www.w3.org/2000/svg"
30
+ width =" 20"
31
+ height =" 20"
32
+ viewBox =" 0 0 24 24"
33
+ fill =" none"
34
+ stroke =" currentColor"
35
+ class =" text-white" >
36
+ <path d =" M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
37
+ </svg >
38
+ }
39
+ </div >
6
40
7
41
@code {
8
42
[Parameter ]
22
56
: await JSRuntime .InvokeAsync <string >(" getCurrentSystemPreference" );
23
57
24
58
await JSRuntime .InvokeVoidAsync (" setTheme" , currentTheme );
59
+ StateHasChanged ();
25
60
}
26
61
}
27
62
You can’t perform that action at this time.
0 commit comments