File tree Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Expand file tree Collapse file tree 2 files changed +26
-10
lines changed Original file line number Diff line number Diff line change
1
+ import ThemeSwitcher from '../hooks/ThemeSwitcher' ;
1
2
import { FiArrowDownCircle } from 'react-icons/fi' ;
2
3
import developerLight from '../images/developer.svg' ;
3
4
import developerDark from '../images/developer-dark.svg' ;
4
5
5
6
const AppBanner = ( ) => {
7
+ const [ activeTheme , seTheme ] = ThemeSwitcher ( ) ;
8
+
6
9
return (
7
10
< section className = "flex flex-col sm:justify-between items-center sm:flex-row mt-12 sm:mt-2" >
8
11
< div className = "w-full sm:w-1/3 text-left" >
@@ -25,7 +28,12 @@ const AppBanner = () => {
25
28
</ div >
26
29
</ div >
27
30
< div className = "w-full sm:w-2/3 text-right float-right mt-8 sm:mt-0" >
28
- < img src = { developerLight } alt = "Developer" />
31
+ < img
32
+ src = {
33
+ activeTheme === 'light' ? developerLight : developerDark
34
+ }
35
+ alt = "Developer"
36
+ />
29
37
</ div >
30
38
</ section >
31
39
) ;
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { FiMoon, FiSun } from 'react-icons/fi';
2
2
import { Link } from 'react-router-dom' ;
3
3
import ThemeSwitcher from '../hooks/ThemeSwitcher' ;
4
4
5
- // import logoLight from '../images/logo-light.svg';
5
+ import logoLight from '../images/logo-light.svg' ;
6
6
import logoDark from '../images/logo-dark.svg' ;
7
7
8
8
const AppHeader = ( ) => {
@@ -17,11 +17,19 @@ const AppHeader = () => {
17
17
< div className = "flex justify-between items-center px-4 sm:px-0" >
18
18
< div >
19
19
< Link to = "/" >
20
- < img
21
- src = { logoDark }
22
- className = "w-36"
23
- alt = "Dark Logo"
24
- />
20
+ { activeTheme === 'dark' ? (
21
+ < img
22
+ src = { logoDark }
23
+ className = "w-36"
24
+ alt = "Dark Logo"
25
+ />
26
+ ) : (
27
+ < img
28
+ src = { logoLight }
29
+ className = "w-36"
30
+ alt = "Dark Logo"
31
+ />
32
+ ) }
25
33
</ Link >
26
34
</ div >
27
35
@@ -108,12 +116,12 @@ const AppHeader = () => {
108
116
< div
109
117
onClick = { ( ) => setTheme ( activeTheme ) }
110
118
aria-label = "Theme Switcher"
111
- className = "ml-8 bg-primary-light dark:bg-ternary-dark px-3 py-2 shadow-sm rounded-xl cursor-pointer"
119
+ className = "ml-8 bg-primary-light dark:bg-ternary-dark p-3 shadow-sm rounded-xl cursor-pointer"
112
120
>
113
121
{ activeTheme === 'dark' ? (
114
- < FiMoon class = "text-liText-ternary-dark hover:text-gray-400 dark:text-liText-ternary-light dark:hover:text-liBorder-primary-light w-5 " />
122
+ < FiMoon class = "text-liText-ternary-dark hover:text-gray-400 dark:text-liText-ternary-light dark:hover:text-liBorder-primary-light text-xl " />
115
123
) : (
116
- < FiSun class = "text-gray-200 hover:text-gray-50 w-5 " />
124
+ < FiSun class = "text-gray-200 hover:text-gray-50 text-xl " />
117
125
) }
118
126
</ div >
119
127
</ div >
You can’t perform that action at this time.
0 commit comments