Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions frontend/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
14 changes: 13 additions & 1 deletion frontend/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
@import 'tailwindcss';

:root {
--bg-primary: #ffffff;
--bg-secondary: #f3f4f6;
--bg-card: #ffffff;
--text-primary: #111827;
--text-secondary: #4b5563;
--accent: #6366f1;
--accent-muted: #4f46e5;
--border: #e5e7eb;
}

[data-theme='dark'] {
--bg-primary: #0a0a0f;
--bg-secondary: #12121a;
--bg-card: #1a1a2e;
Expand All @@ -15,4 +26,5 @@ body {
background: var(--bg-primary);
color: var(--text-primary);
font-family: system-ui, -apple-system, sans-serif;
}
transition: background-color 0.3s, color 0.3s;
}
20 changes: 17 additions & 3 deletions frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Metadata } from 'next'
import './globals.css'
import ThemeToggle from '@/components/ThemeToggle'

export const metadata: Metadata = {
title: 'deep-cuts',
Expand All @@ -8,23 +9,36 @@ export const metadata: Metadata = {

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<html lang="en" suppressHydrationWarning>
<head>
<script
dangerouslySetInnerHTML={{
__html: `
(function() {
const savedTheme = localStorage.getItem('theme') || 'dark';
document.documentElement.setAttribute('data-theme', savedTheme);
})();
`,
}}
/>
</head>
<body className="min-h-screen antialiased">
<header className="border-b border-[var(--border)] px-6 py-4">
<div className="max-w-7xl mx-auto flex items-center justify-between">
<h1 className="text-xl font-bold tracking-tight">deep-cuts</h1>
<nav className="flex gap-6 text-sm text-[var(--text-secondary)]">
<nav className="flex items-center gap-6 text-sm text-[var(--text-secondary)]">
<a href="/" className="hover:text-[var(--text-primary)] transition">
Search
</a>
<a href="/threads" className="hover:text-[var(--text-primary)] transition">
Threads
</a>
<ThemeToggle />
</nav>
</div>
</header>
<main className="max-w-7xl mx-auto px-6 py-8">{children}</main>
</body>
</html>
)
}
}
29 changes: 29 additions & 0 deletions frontend/src/components/ThemeToggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use client';

import { useEffect, useState } from 'react';

export default function ThemeToggle() {
const [theme, setTheme] = useState('dark');

useEffect(() => {
const savedTheme = localStorage.getItem('theme') || 'dark';
setTheme(savedTheme);
document.documentElement.setAttribute('data-theme', savedTheme);
}, []);

const toggleTheme = () => {
const newTheme = theme === 'light' ? 'dark' : 'light';
setTheme(newTheme);
document.documentElement.setAttribute('data-theme', newTheme);
localStorage.setItem('theme', newTheme);
};

return (
<button
onClick={toggleTheme}
className="p-2 rounded-full bg-secondary text-primary"
>
{theme === 'dark' ? '🌙' : '☀️'}
</button>
);
}
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.