diff --git a/client/pages/DevLinkProfiles.tsx b/client/pages/DevLinkProfiles.tsx index 40ed8a8e..9982d63d 100644 --- a/client/pages/DevLinkProfiles.tsx +++ b/client/pages/DevLinkProfiles.tsx @@ -38,261 +38,26 @@ interface DevProfile { } export default function DevLinkProfiles() { - const [profiles, setProfiles] = useState([]); - const [filteredProfiles, setFilteredProfiles] = useState([]); - const [loading, setLoading] = useState(true); - const [searchTerm, setSearchTerm] = useState(""); - const [experienceFilter, setExperienceFilter] = useState("all"); const navigate = useNavigate(); - useEffect(() => { - const fetchProfiles = async () => { - try { - const { data, error } = await supabase - .from("profiles") - .select("*") - .eq("deleted_at", null) - .order("created_at", { ascending: false }) - .limit(50); - - if (error) throw error; - - const devProfiles: DevProfile[] = data - .map((p: any) => ({ - id: p.id, - user_id: p.user_id, - full_name: p.full_name || "Anonymous Developer", - avatar_url: p.avatar_url, - bio: p.bio, - skills: p.interests || [], - experience_level: p.experience_level || "intermediate", - looking_for: p.looking_for, - portfolio_url: p.portfolio_url, - github_url: p.github_url, - created_at: p.created_at, - })) - .filter((p) => p.full_name !== "Anonymous Developer" || p.bio); - - setProfiles(devProfiles); - setFilteredProfiles(devProfiles); - } catch (error) { - console.error("Error fetching profiles:", error); - } finally { - setLoading(false); - } - }; - - fetchProfiles(); - }, []); - - useEffect(() => { - let filtered = profiles; - - if (searchTerm) { - filtered = filtered.filter( - (p) => - p.full_name.toLowerCase().includes(searchTerm.toLowerCase()) || - p.bio?.toLowerCase().includes(searchTerm.toLowerCase()) || - p.skills.some((s) => - s.toLowerCase().includes(searchTerm.toLowerCase()) - ) - ); - } - - if (experienceFilter !== "all") { - filtered = filtered.filter((p) => p.experience_level === experienceFilter); - } - - setFilteredProfiles(filtered); - }, [searchTerm, experienceFilter, profiles]); - return ( - -
- {/* Animated backgrounds */} -
-
-
-
-
+
+
+ {/* Back Button */} + -
- {/* Header Section */} -
-
-
-
- Dev-Link -
-

- Developer Profiles -

-

- Connect with {profiles.length} talented Roblox developers -

-
-
- -
- - {/* Search and Filter */} -
-
- - setSearchTerm(e.target.value)} - className="pl-10 bg-cyan-950/30 border-cyan-400/30 text-white placeholder:text-cyan-200/40 focus:border-cyan-400" - /> -
- -
-
-
- - {/* Profiles Grid */} -
-
- {loading ? ( -
-

Loading profiles...

-
- ) : filteredProfiles.length === 0 ? ( -
- -

- No profiles found. Try adjusting your filters. -

-
- ) : ( -
- {filteredProfiles.map((profile) => ( - navigate(`/dev-link/profiles/${profile.id}`)} - > - - {profile.avatar_url && ( - {profile.full_name} - )} - - {profile.full_name} - - - {profile.experience_level} - - - - {profile.bio && ( -

- {profile.bio} -

- )} - - {profile.skills && profile.skills.length > 0 && ( -
-

- Skills -

-
- {profile.skills.slice(0, 3).map((skill) => ( - - {skill} - - ))} - {profile.skills.length > 3 && ( - - +{profile.skills.length - 3} - - )} -
-
- )} - - {profile.looking_for && ( -
- - - {profile.looking_for} - -
- )} - -
- {profile.github_url && ( - e.stopPropagation()} - > - - - )} - {profile.portfolio_url && ( - e.stopPropagation()} - > - - - )} - -
-
-
- ))} -
- )} -
-
-
+ {/* Fullscreen iframe */} +