-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathApp.jsx
More file actions
57 lines (52 loc) · 2.44 KB
/
Copy pathApp.jsx
File metadata and controls
57 lines (52 loc) · 2.44 KB
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
import React, { useState } from 'react';
import { Camera, Sun, Moon, Github } from 'lucide-react';
const ContributorBox = ({ name, imageUrl, darkMode }) => (
<div className="flex flex-col items-center mb-4">
<div className={`w-full aspect-square ${darkMode ? 'bg-gray-700' : 'bg-gray-200'} rounded-lg flex items-center justify-center overflow-hidden`}>
{imageUrl ? (
<img src={imageUrl} alt={name} className="w-full h-full object-cover" />
) : (
<Camera className={darkMode ? 'text-gray-500' : 'text-gray-400'} size={48} />
)}
</div>
<input
type="text"
placeholder="Your Name"
value={name}
readOnly
className={`mt-2 w-full px-3 py-2 text-sm ${darkMode ? 'text-gray-200 bg-gray-800' : 'text-gray-700 bg-white'} placeholder-gray-400 border ${darkMode ? 'border-gray-600' : 'border-gray-300'} rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500`}
/>
</div>
);
const ContributorGrid = () => {
const [darkMode, setDarkMode] = useState(false);
const toggleDarkMode = () => setDarkMode(!darkMode);
// Example data - replace with your own or fetch from an API
const contributors = [
// { name: "Anantesh G", imageUrl: "/images/pfp.jpg" },
// Add more contributors here
{name:"Monish E",imageUrl:"public/images/img1.jpg"},
...Array(49).fill({ name: "", imageUrl: "" }) // Fill the rest with empty boxes
];
return (
<div className={`min-h-screen ${darkMode ? 'bg-gray-900 text-white' : 'bg-white text-black'}`}>
<div className="container mx-auto px-4 py-8 relative">
<div className="absolute top-4 right-4 flex items-center space-x-4">
<button onClick={toggleDarkMode} className="p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700">
{darkMode ? <Sun size={24} /> : <Moon size={24} />}
</button>
<a href="https://github.com/your-repo-url" target="_blank" rel="noopener noreferrer" className="p-2 rounded-full hover:bg-gray-200 dark:hover:bg-gray-700">
<Github size={24} />
</a>
</div>
<h1 className="text-3xl font-bold text-center mb-8">Git Collaboration Project</h1>
<div className="grid grid-cols-3 sm:grid-cols-4 lg:grid-cols-5 gap-4">
{contributors.map((contributor, index) => (
<ContributorBox key={index} {...contributor} darkMode={darkMode} />
))}
</div>
</div>
</div>
);
};
export default ContributorGrid;