@@ -5,21 +5,17 @@ import { faCode, faMoon, faSun } from '@fortawesome/free-solid-svg-icons';
5
5
import { useNavigate } from 'react-router-dom' ;
6
6
7
7
function Sidebar ( ) {
8
+ const navigate = useNavigate ( ) ;
8
9
const [ theme , setTheme ] = useState ( ( ) => {
9
- return document . documentElement . classList . contains ( 'dark' ) ? 'dark' : 'light' ;
10
+ const storedTheme = JSON . parse ( localStorage . getItem ( 'theme' ) ) ;
11
+ return storedTheme || ( document . documentElement . classList . contains ( 'dark' ) ? 'dark' : 'light' ) ;
10
12
} ) ;
11
13
12
- const navigate = useNavigate ( ) ;
13
-
14
14
useEffect ( ( ) => {
15
15
const htmlElement = document . documentElement ;
16
- if ( theme === 'dark' ) {
17
- htmlElement . classList . add ( 'dark' ) ;
18
- htmlElement . classList . remove ( 'light' ) ;
19
- } else {
20
- htmlElement . classList . add ( 'light' ) ;
21
- htmlElement . classList . remove ( 'dark' ) ;
22
- }
16
+ htmlElement . classList . toggle ( 'dark' , theme === 'dark' ) ;
17
+ htmlElement . classList . toggle ( 'light' , theme === 'light' ) ;
18
+ localStorage . setItem ( 'theme' , JSON . stringify ( theme ) ) ;
23
19
} , [ theme ] ) ;
24
20
25
21
function toggleTheme ( ) {
@@ -41,7 +37,10 @@ function Sidebar() {
41
37
< FontAwesomeIcon icon = { faCode } size = "2xl" />
42
38
</ div >
43
39
< a href = "https://devdisplay.vercel.app/" >
44
- < div className = "flex text-[2rem] font-bold md:text-[1rem] lg:text-[2rem]" >
40
+ < div
41
+ className = "flex text-[2rem] font-bold
42
+ md:text-[1.05rem] lg:text-[1.25rem] min-[1200px]:text-[1.75rem] "
43
+ >
45
44
< p className = "text-secondaryColor dark:text-white" > Dev</ p >
46
45
< p className = "text-textSecondary" > Display</ p >
47
46
</ div >
@@ -64,13 +63,17 @@ function Sidebar() {
64
63
Open Source community where you can discover, connect, collab with skilled developers, share your ideas then
65
64
build projects and also promote the project through this community.
66
65
</ div >
67
- < div className = "pt-5" >
66
+ < div className = "flex flex-wrap items-center justify-center gap-2 pt-5 " >
68
67
< a
69
68
href = "https://github.com/codeaashu/DevDisplay?tab=readme-ov-file#how-to-add-your-profile-"
70
69
target = "_blank"
71
70
rel = "noreferrer"
72
71
>
73
- < button className = "mr-4 inline-block cursor-pointer rounded-lg border-2 border-textSecondary bg-textSecondary px-[15px] py-1.5 text-center font-poppoins text-sm transition-all duration-500 hover:bg-transparent hover:text-textSecondary dark:text-white" >
72
+ < button
73
+ className = "mr-4
74
+
75
+ inline-block cursor-pointer rounded-lg border-2 border-textSecondary bg-textSecondary px-[15px] py-1.5 text-center font-poppoins text-sm transition-all duration-500 hover:bg-transparent hover:text-textSecondary dark:text-white"
76
+ >
74
77
Add your profile
75
78
</ button >
76
79
</ a >
@@ -81,21 +84,21 @@ function Sidebar() {
81
84
</ button >
82
85
</ a >
83
86
</ div >
84
- < div className = "pt-6" >
87
+ < div className = "flex flex-row flex-wrap items-center justify-center gap-2 pt-6" >
85
88
< a href = "https://ai.google.dev/competition/projects/helpmate-ai" target = "_blank" rel = "noreferrer" >
86
- < button className = "mr-4 inline-block cursor-pointer rounded-lg border-2 border-textSecondary bg-textSecondary px-[15px] py-1.5 text-center font-poppoins text-sm transition-all duration-500 hover:bg-transparent hover:text-textSecondary dark:text-white" >
89
+ < button className = "inline-flex cursor-pointer items-center rounded-lg border-2 border-textSecondary bg-textSecondary px-[15px] py-1.5 text-center font-poppoins text-sm transition-all duration-500 hover:bg-transparent hover:text-textSecondary dark:text-white" >
87
90
Spotlight
88
91
</ button >
89
92
</ a >
90
93
< button
91
94
onClick = { handleOpportunities }
92
- className = "mr-4 inline-block cursor-pointer rounded-lg border-2 border-textSecondary bg-textSecondary px-[15px] py-1.5 text-center font-poppoins text-sm transition-all duration-500 hover:bg-transparent hover:text-textSecondary dark:text-white"
95
+ className = "inline-flex cursor-pointer items-center rounded-lg border-2 border-textSecondary bg-textSecondary px-[15px] py-1.5 text-center font-poppoins text-sm transition-all duration-500 hover:bg-transparent hover:text-textSecondary dark:text-white"
93
96
>
94
97
Opportunities Hub
95
98
</ button >
96
99
</ div >
97
- < div className = "pt-7" >
98
- < a href = "https://ai.google.dev" target = "_blank" rel = "noreferrer" >
100
+ < div className = "flex flex-wrap items-center justify-center gap-2 pt-7 " >
101
+ < a href = "https://ai.google.dev/competition/projects/helpmate-ai " target = "_blank" rel = "noreferrer" >
99
102
< button className = "mr-4 inline-block cursor-pointer rounded-lg border-2 border-textSecondary bg-textSecondary px-[15px] py-1.5 text-center font-poppoins text-sm transition-all duration-500 hover:bg-transparent hover:text-textSecondary dark:text-white" >
100
103
SpotLight
101
104
</ button >
0 commit comments