Skip to content

Commit 0f9d79a

Browse files
committed
feat(frontend): complete light/dark theme support across main user pages
1 parent 4e3092b commit 0f9d79a

17 files changed

Lines changed: 346 additions & 352 deletions

backend/package-lock.json

Lines changed: 7 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/components/ContributorCard.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const ContributorCard = ({ contributor }) => {
88
initial={{ opacity: 0, y: 20 }}
99
whileInView={{ opacity: 1, y: 0 }}
1010
viewport={{ once: true }}
11-
className="group relative p-6 rounded-3xl bg-white/5 dark:bg-gray-900/40 backdrop-blur-xl border border-white/10 dark:border-gray-800/50 hover:border-cyan-500/50 transition-all duration-500 overflow-hidden"
11+
className="group relative p-6 rounded-3xl bg-white/85 dark:bg-gray-900/40 backdrop-blur-xl border border-slate-200 dark:border-gray-800/50 hover:border-cyan-500/50 transition-all duration-500 overflow-hidden"
1212
>
1313
{/* Background Glow */}
1414
<div className="absolute -inset-1 bg-gradient-to-r from-cyan-500 to-blue-600 rounded-3xl opacity-0 group-hover:opacity-20 blur-xl transition-opacity duration-500" />
@@ -36,7 +36,7 @@ const ContributorCard = ({ contributor }) => {
3636
</p>
3737

3838
{/* Stats */}
39-
<div className="px-4 py-1.5 rounded-full bg-white/10 dark:bg-black/20 border border-white/10 dark:border-gray-800 text-xs font-medium text-gray-700 dark:text-gray-300">
39+
<div className="px-4 py-1.5 rounded-full bg-slate-100 dark:bg-black/20 border border-slate-200 dark:border-gray-800 text-xs font-medium text-gray-700 dark:text-gray-300">
4040
{contributor.contributions} Contributions
4141
</div>
4242

frontend/src/components/FeaturedContributor.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const FeaturedContributor = ({ contributor, role, description, badge }) => {
88
whileInView={{ opacity: 1, scale: 1 }}
99
viewport={{ once: true }}
1010
transition={{ duration: 0.6 }}
11-
className="group relative p-8 rounded-[40px] bg-white/10 dark:bg-gray-900/60 backdrop-blur-2xl border border-white/20 dark:border-gray-800/80 shadow-2xl overflow-hidden"
11+
className="group relative p-8 rounded-[40px] bg-white/90 dark:bg-gray-900/60 backdrop-blur-2xl border border-slate-200 dark:border-gray-800/80 shadow-2xl overflow-hidden"
1212
>
1313
{/* Animated Gradient Background */}
1414
<div className="absolute -inset-[100%] bg-[conic-gradient(from_0deg,transparent_0deg,transparent_150deg,#06b6d4_180deg,transparent_210deg,transparent_360deg)] animate-spin-slow opacity-10 group-hover:opacity-30 transition-opacity duration-700" />
@@ -18,7 +18,7 @@ const FeaturedContributor = ({ contributor, role, description, badge }) => {
1818
{/* Avatar with Animated Gradient Border */}
1919
<div className="relative w-32 h-32 mb-6">
2020
<div className="absolute inset-[-4px] bg-gradient-to-r from-cyan-400 via-blue-500 to-purple-600 rounded-full animate-spin-slow blur-sm opacity-70 group-hover:blur-md transition-all duration-500" />
21-
<div className="absolute inset-0 bg-gray-900 rounded-full z-0" />
21+
<div className="absolute inset-0 bg-slate-100 dark:bg-gray-900 rounded-full z-0" />
2222
<img
2323
src={`https://github.com/${contributor}.png`}
2424
alt={contributor}
@@ -35,13 +35,13 @@ const FeaturedContributor = ({ contributor, role, description, badge }) => {
3535
<span className="px-4 py-1.5 rounded-full bg-cyan-500/20 border border-cyan-500/30 text-cyan-400 text-xs font-bold uppercase tracking-widest mb-3 block">
3636
{role}
3737
</span>
38-
<h3 className="text-2xl font-black text-white mb-1 tracking-tight">
38+
<h3 className="text-2xl font-black text-slate-900 dark:text-white mb-1 tracking-tight">
3939
{contributor}
4040
</h3>
4141
<p className="text-cyan-400/80 text-sm font-medium">@{contributor}</p>
4242
</div>
4343

44-
<p className="text-gray-400 text-sm leading-relaxed mb-8 max-w-[250px]">
44+
<p className="text-slate-600 dark:text-gray-400 text-sm leading-relaxed mb-8 max-w-[250px]">
4545
{description}
4646
</p>
4747

frontend/src/components/Footer.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function Footer() {
9292
key={index}
9393
type="button"
9494
onClick={() => toast.info(`Follow us on ${social.name} - Coming soon!`)}
95-
className={`w-10 h-10 bg-gray-800 rounded-lg flex items-center justify-center transition-all duration-300 hover:scale-110 ${social.color} cursor-pointer`}
95+
className={`w-10 h-10 bg-slate-200 dark:bg-gray-800 text-slate-700 dark:text-white rounded-lg flex items-center justify-center transition-all duration-300 hover:scale-110 ${social.color} cursor-pointer`}
9696
aria-label={`Follow us on ${social.name}`}
9797
>
9898
{social.icon}
@@ -204,7 +204,7 @@ function Footer() {
204204
placeholder="Enter your email"
205205
value={email}
206206
onChange={(e) => setEmail(e.target.value)}
207-
className="px-4 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:border-transparent w-full sm:w-64"
207+
className="px-4 py-2 bg-white dark:bg-gray-800 border border-slate-300 dark:border-gray-700 rounded-lg text-slate-900 dark:text-white placeholder-slate-500 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:border-transparent w-full sm:w-64"
208208
/>
209209
<button
210210
onClick={handleSubscribe}
@@ -219,19 +219,19 @@ function Footer() {
219219
</div>
220220

221221
{/* Bottom bar */}
222-
<div className="bg-gradient-to-r from-gray-900 to-gray-950 py-6 border-t border-gray-800">
222+
<div className="bg-gradient-to-r from-slate-100 to-slate-200 dark:from-gray-900 dark:to-gray-950 py-6 border-t border-slate-300 dark:border-gray-800">
223223
<div className="max-w-7xl mx-auto px-6 flex flex-col md:flex-row items-center justify-between gap-4">
224-
<p className="text-xs text-gray-500 text-center md:text-left">
224+
<p className="text-xs text-slate-600 dark:text-gray-500 text-center md:text-left">
225225
© {currentYear} <span className="text-cyan-400 font-medium">RIVETO</span> — All rights reserved.
226226
</p>
227227

228-
<div className="flex items-center gap-6 text-xs text-gray-500">
228+
<div className="flex items-center gap-6 text-xs text-slate-600 dark:text-gray-500">
229229
<Link to="/termsandservices" className="hover:text-cyan-400 transition-colors">Terms of Service</Link>
230230
<Link to="/privicypolicy" className="hover:text-cyan-400 transition-colors">Privacy Policy</Link>
231231
<Link to="/cookie-policy" className="hover:text-cyan-400 transition-colors">Cookie Policy</Link>
232232
</div>
233233

234-
<div className="flex items-center gap-2 text-xs text-gray-500">
234+
<div className="flex items-center gap-2 text-xs text-slate-600 dark:text-gray-500">
235235
<span>Made with</span>
236236
<FaHeart className="text-rose-500 animate-pulse" />
237237
<span>for our customers</span>

frontend/src/context/ThemeContext.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ export const ThemeContext = createContext();
44

55
export default function ThemeProvider({ children }) {
66
const [theme, setTheme] = useState(() => {
7-
// Check localStorage or default to 'dark'
87
const stored = localStorage.getItem("theme");
98
return stored ? stored : "dark";
109
});
1110

1211
useEffect(() => {
13-
// Apply theme on mount and when theme changes
1412
if (theme === "dark") {
1513
document.documentElement.classList.add("dark");
1614
} else {

frontend/src/context/UserContext.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { authDataContext } from './AuthContext';
55
export const userDataContext = createContext();
66

77
function UserContext({ children }) {
8-
const [userData, setUserData] = useState(null); // null, not ""
8+
const [userData, setUserData] = useState(null);
99
const { serverUrl } = useContext(authDataContext);
1010

1111
const getCurrentUser = async () => {
1212
try {
1313
const result = await axios.get(`${serverUrl}/api/user/getCurrentUser`, {
14-
withCredentials: true, // ✅ ensures cookie is sent
14+
withCredentials: true,
1515
});
1616
setUserData(result.data);
1717
console.log("✅ Current user:", result.data);

0 commit comments

Comments
 (0)