-
-
Notifications
You must be signed in to change notification settings - Fork 412
/
Copy pathSidebar.jsx
111 lines (104 loc) · 5.05 KB
/
Sidebar.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import React, { useState, useEffect } from 'react';
import { FaLinkedin } from 'react-icons/fa';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCode, faMoon, faSun } from '@fortawesome/free-solid-svg-icons';
import { useNavigate } from 'react-router-dom';
import { PiUserCirclePlusFill } from 'react-icons/pi';
import { SiSpotlight } from 'react-icons/si';
import { MdHub } from 'react-icons/md';
function Sidebar() {
const navigate = useNavigate();
const [theme, setTheme] = useState(() => {
const storedTheme = localStorage.getItem('theme');
return storedTheme || (document.documentElement.classList.contains('dark') ? 'dark' : 'light');
});
useEffect(() => {
const htmlElement = document.documentElement;
htmlElement.classList.toggle('dark', theme === 'dark');
htmlElement.classList.toggle('light', theme === 'light');
localStorage.setItem('theme', JSON.stringify(theme));
}, [theme]);
function toggleTheme() {
setTheme((prevTheme) => (prevTheme === 'dark' ? 'light' : 'dark'));
}
function handleOpportunities() {
navigate('/opportunities');
}
return (
<div className="my-7 w-full border-r-2 border-borderSecondary px-7 font-spaceMono dark:border-borderColor md:h-[90vh] md:w-[23%] md:px-2 lg:px-7">
<div className="mb-2 flex h-12 items-center gap-2.5">
<div className="text-secondaryColor dark:text-white">
<FontAwesomeIcon icon={faCode} size="2xl" />
</div>
<a href="https://devdisplay.vercel.app/">
<div
className="flex text-[2rem] font-bold
md:text-[1.05rem] lg:text-[1.25rem] min-[1200px]:text-[1.75rem] "
>
<p className="text-secondaryColor dark:text-white">Dev</p>
<p className="text-textSecondary">Display</p>
</div>
</a>
<div className="ml-auto">
<button
type="button"
className="h-10 w-10 cursor-pointer rounded-lg border-2 border-borderSecondary bg-white transition-all hover:border-textSecondary hover:text-textSecondary dark:border-borderColor dark:bg-textPrimary dark:text-white dark:hover:border-textSecondary dark:hover:text-textSecondary"
onClick={toggleTheme}
>
{theme === 'dark' ? (
<FontAwesomeIcon icon={faSun} fontSize="1rem" />
) : (
<FontAwesomeIcon icon={faMoon} fontSize="1rem" />
)}
</button>
</div>
</div>
<div className="text-secondaryColor dark:text-white">
Open Source community where you can discover, connect, collab with skilled developers, share your ideas then
build projects and also promote the project through this community.
</div>
<div className="flex flex-wrap items-center gap-2 pt-5 ">
<a
href="https://github.com/codeaashu/DevDisplay?tab=readme-ov-file#how-to-add-your-profile-"
target="_blank"
rel="noreferrer"
>
<button
className="
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"
>
<div className="flex items-center gap-1">
<PiUserCirclePlusFill size={18} />
Add your profile
</div>
</button>
</a>
<a href="https://www.linkedin.com/company/devdisplay/" target="_blank" rel="noreferrer">
<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">
<span>Connect</span>
<FaLinkedin className="text-1xl text-black-600 ml-2 duration-300 hover:scale-125" />
</button>
</a>
</div>
<div className="flex flex-row flex-wrap items-center gap-2 pt-6">
<a href="https://ai.google.dev/competition/projects/helpmate-ai" target="_blank" rel="noreferrer">
<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">
<div className="flex items-center gap-1">
<SiSpotlight size={13} />
Spotlight
</div>
</button>
</a>
<button
onClick={handleOpportunities}
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"
>
<div className="flex items-center gap-1">
<MdHub size={11} /> Opportunities Hub
</div>
</button>
</div>
</div>
);
}
export default Sidebar;