Skip to content

Commit 5418a2e

Browse files
authored
Merge pull request #104 from Krishdshah/Krishdshah/Broken-header-fixed
Broken Header Fixed:
2 parents 2facadf + d144e7e commit 5418a2e

File tree

4 files changed

+50
-37
lines changed

4 files changed

+50
-37
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules/
1+
node_modules/
2+
.vscode/

.vscode/settings.json

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/App.tsx

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { ThemeProvider } from './themeContent';
1212
import ScrollToTop from './components/ScrollToTop/ScrollToTop';
1313

1414
function App() {
15-
15+
1616
const [currentPage, setCurrentPage] = useState<string>('home');
1717

1818
const handleNavigate = (page: string) => {
@@ -32,43 +32,43 @@ function App() {
3232
case 'submit':
3333
return <SubmitChallenge />;
3434
case 'community':
35-
return <Community onNavigate={handleNavigate} />; {/* ✅ updated */}
35+
return <Community onNavigate={handleNavigate} />;
3636
default:
3737
return (
3838
<div>
3939
<Hero onNavigate={handleNavigate} />
4040

4141
{/* Quick Access Section */}
42-
<div className="bg-white py-16">
42+
<div className="bg-white dark:bg-gray-800 py-16 transition-colors duration-300">
4343
<div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
4444
<div className="text-center mb-12">
45-
<h2 className="text-3xl font-bold text-gray-900 mb-4">
45+
<h2 className="text-3xl font-bold text-gray-900 dark:text-white mb-4">
4646
Quick Access
4747
</h2>
48-
<p className="text-xl text-gray-600">
48+
<p className="text-xl text-gray-600 dark:text-gray-300">
4949
Jump into what interests you most
5050
</p>
5151
</div>
5252

5353
<div className="grid grid-cols-1 md:grid-cols-2 gap-8">
54-
<div className="bg-gradient-to-br from-purple-50 to-purple-100 p-8 rounded-2xl border border-purple-200 hover:shadow-lg transition-shadow cursor-pointer" onClick={() => handleNavigate('projects')}>
54+
<div className="bg-gradient-to-br from-purple-50 to-purple-100 dark:from-purple-900/20 dark:to-purple-800/20 p-8 rounded-2xl border border-purple-200 dark:border-purple-800 hover:shadow-lg transition-shadow cursor-pointer" onClick={() => handleNavigate('projects')}>
5555
<div className="text-4xl mb-4">🚀</div>
56-
<h3 className="text-2xl font-bold text-purple-900 mb-3">Community Projects</h3>
57-
<p className="text-purple-700 mb-6">
56+
<h3 className="text-2xl font-bold text-purple-900 dark:text-purple-100 mb-3">Community Projects</h3>
57+
<p className="text-purple-700 dark:text-purple-200 mb-6">
5858
Discover inclusive, collaborative projects that welcome contributors of all backgrounds and skill levels. Get hands-on experience with real codebases.
5959
</p>
60-
<div className="inline-flex items-center text-purple-600 font-semibold">
60+
<div className="inline-flex items-center text-purple-600 dark:text-purple-300 font-semibold">
6161
Explore Projects →
6262
</div>
6363
</div>
6464

65-
<div className="bg-gradient-to-br from-blue-50 to-blue-100 p-8 rounded-2xl border border-blue-200 hover:shadow-lg transition-shadow cursor-pointer" onClick={() => handleNavigate('blog')}>
65+
<div className="bg-gradient-to-br from-blue-50 to-blue-100 dark:from-blue-900/20 dark:to-blue-800/20 p-8 rounded-2xl border border-blue-200 dark:border-blue-800 hover:shadow-lg transition-shadow cursor-pointer" onClick={() => handleNavigate('blog')}>
6666
<div className="text-4xl mb-4">📝</div>
67-
<h3 className="text-2xl font-bold text-blue-900 mb-3">Community Blog</h3>
68-
<p className="text-blue-700 mb-6">
67+
<h3 className="text-2xl font-bold text-blue-900 dark:text-blue-100 mb-3">Community Blog</h3>
68+
<p className="text-blue-700 dark:text-blue-200 mb-6">
6969
Stories celebrating diversity, inclusion, and positive collaboration in technology. Learn from community experiences and insights.
7070
</p>
71-
<div className="inline-flex items-center text-blue-600 font-semibold">
71+
<div className="inline-flex items-center text-blue-600 dark:text-blue-300 font-semibold">
7272
Read Stories →
7373
</div>
7474
</div>
@@ -82,28 +82,31 @@ function App() {
8282

8383
return (
8484
<ThemeProvider>
85-
<div className="min-h-screen">
85+
{/* Added bg-gray-50 and dark mode colors here to ensure the full page background is correct */}
86+
<div className="min-h-screen bg-gray-50 dark:bg-gray-900 transition-colors duration-300">
87+
8688
<Header currentPage={currentPage} onNavigate={handleNavigate} />
87-
<main>
89+
90+
<main className="pt-16">
8891
{renderPage()}
8992
</main>
9093

9194
{/* Footer */}
92-
<footer className="bg-gray-900 text-white py-12">
95+
<footer className="bg-gray-900 text-white py-12 border-t border-gray-800">
9396
<div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
9497
<div className="flex items-center justify-center mb-6">
9598
<div className="bg-gradient-to-r from-purple-600 to-blue-600 text-white p-2 rounded-lg mr-3">
9699
<span className="font-bold text-xl">CT</span>
97100
</div>
98-
<div>
101+
<div className="text-left">
99102
<h3 className="text-xl font-bold">Can I Try This?</h3>
100103
<p className="text-gray-400 text-sm">Real Challenges, Real Skills</p>
101104
</div>
102105
</div>
103106
<p className="text-gray-400 mb-6 max-w-2xl mx-auto">
104107
A safe space to explore real-world challenges in design, development, writing, data, and more.
105108
</p>
106-
<div className="flex justify-center space-x-6 mb-8">
109+
<div className="flex justify-center space-x-6 mb-8 flex-wrap gap-y-4">
107110
<button onClick={() => handleNavigate('challenges')} className="text-gray-400 hover:text-white transition-colors">Challenges</button>
108111
<button onClick={() => handleNavigate('projects')} className="text-gray-400 hover:text-white transition-colors">Projects</button>
109112
<button onClick={() => handleNavigate('blog')} className="text-gray-400 hover:text-white transition-colors">Blog</button>
@@ -120,4 +123,4 @@ function App() {
120123
);
121124
}
122125

123-
export default App;
126+
export default App;

src/components/Layout/Header.tsx

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,34 @@ export const Header: React.FC<HeaderProps> = ({ currentPage, onNavigate }) => {
1111
const { theme, toggleTheme } = useTheme();
1212

1313
return (
14-
<header className="bg-white dark:bg-gray-900 shadow-sm border-b border-gray-200 dark:border-gray-700 sticky top-0 z-50 transition-colors duration-300">
15-
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
16-
<div className="flex justify-between items-center h-16">
17-
{/* Logo */}
14+
// Changed 'sticky' to 'fixed' for better stability across full width
15+
<header className="fixed top-0 left-0 w-full z-50 h-16 bg-white dark:bg-gray-900 shadow-sm border-b border-gray-200 dark:border-gray-700 transition-colors duration-300">
16+
17+
{/* LAYOUT FIX:
18+
1. Removed 'max-w-7xl' and 'mx-auto' (which concentrated items in the center).
19+
2. Added 'w-full' to span the whole screen.
20+
3. Increased horizontal padding (px-6 lg:px-12) to 'loosely' fit the edges.
21+
*/}
22+
<div className="w-full px-6 lg:px-12 h-full">
23+
<div className="flex justify-between items-center h-full">
24+
25+
{/* Logo Section */}
1826
<div className="flex items-center cursor-pointer" onClick={() => onNavigate('home')}>
1927
<div className="bg-gradient-to-r from-purple-600 to-blue-600 text-white p-2 rounded-lg mr-3">
2028
<span className="font-bold text-xl">CT</span>
2129
</div>
22-
<div className="hidden sm:block">
23-
<h1 className="text-xl font-bold text-gray-900 dark:text-white">Can I Try This?</h1>
24-
<p className="text-xs text-gray-500 dark:text-gray-400 -mt-1">Real Skills, Real Growth</p>
30+
<div className="hidden sm:flex flex-col justify-center ml-2">
31+
<h1 className="text-xl font-bold text-gray-900 dark:text-white leading-none">
32+
Can I Try This?
33+
</h1>
34+
<p className="text-xs text-gray-500 dark:text-gray-400 mt-1 leading-none">
35+
Real Skills, Real Growth
36+
</p>
2537
</div>
2638
</div>
2739

28-
{/* Navigation */}
29-
<nav className="hidden md:flex space-x-8">
40+
{/* Navigation - Increased spacing (space-x-12) for a looser fit */}
41+
<nav className="hidden md:flex items-center space-x-12">
3042
{[
3143
{ key: 'home', label: 'Home' },
3244
{ key: 'challenges', label: 'Challenges' },
@@ -50,14 +62,14 @@ export const Header: React.FC<HeaderProps> = ({ currentPage, onNavigate }) => {
5062
))}
5163
</nav>
5264

53-
{/* Right side actions */}
54-
<div className="flex items-center space-x-4">
65+
{/* Right side actions - Added extra gap (space-x-6) */}
66+
<div className="flex items-center space-x-6">
5567
<div className="hidden sm:block relative">
5668
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400 dark:text-gray-500" />
5769
<input
5870
type="text"
59-
placeholder="Search challenges..."
60-
className="pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"
71+
placeholder="Search..."
72+
className="pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent w-48 lg:w-64 transition-all"
6173
/>
6274
</div>
6375

@@ -69,7 +81,6 @@ export const Header: React.FC<HeaderProps> = ({ currentPage, onNavigate }) => {
6981
<User className="h-5 w-5" />
7082
</button>
7183

72-
{/* Dark/Light Mode Toggle Button */}
7384
<button
7485
onClick={toggleTheme}
7586
className="p-2 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors"
@@ -86,4 +97,4 @@ export const Header: React.FC<HeaderProps> = ({ currentPage, onNavigate }) => {
8697
</div>
8798
</header>
8899
);
89-
};
100+
};

0 commit comments

Comments
 (0)