diff --git a/LocalMind-Frontend/src/app/pages/Contributors.tsx b/LocalMind-Frontend/src/app/pages/Contributors.tsx new file mode 100644 index 0000000..c6cd16f --- /dev/null +++ b/LocalMind-Frontend/src/app/pages/Contributors.tsx @@ -0,0 +1,218 @@ +import React, { useMemo, useState } from "react"; +import { CONTRIBUTORS, type Contributor } from "../../data/contributors"; +import s from "./contributors.module.css"; + +const REPO_ISSUE_NEW_URL = "https://github.com/NexGenStudioDev/LocalMind/issues/new"; + +function enc(x: string) { + return encodeURIComponent(x); +} + +function buildNewIssueUrl(c: Contributor) { + const title = `Add contributor: ${c.name}`; + + const body = `Hi maintainers, +Please add me to the Contributors page. + +Name: ${c.name} +Email: ${c.email} +GitHub: ${c.github} +LinkedIn: ${c.linkedin} +Bio: ${c.bio} +Area of contribution (optional): ${c.area ?? ""} +Tags (optional): ${(c.tags ?? []).join(", ")} + +Notes: +- Beginners are welcome. +- No contribution is too small. +`; + + return `${REPO_ISSUE_NEW_URL}?title=${enc(title)}&body=${enc(body)}`; +} + +export default function ContributorsPage() { + const [name, setName] = useState(""); + const [email, setEmail] = useState(""); + const [github, setGithub] = useState(""); + const [linkedin, setLinkedin] = useState(""); + const [bio, setBio] = useState(""); + const [area, setArea] = useState(""); + const [tags, setTags] = useState(""); + + const list = CONTRIBUTORS; + + const issueUrl = useMemo(() => { + const c: Contributor = { + name: name.trim(), + email: email.trim(), + github: github.trim(), + linkedin: linkedin.trim(), + bio: bio.trim(), + area: area.trim() || undefined, + tags: tags + .split(",") + .map((t) => t.trim()) + .filter(Boolean), + }; + + return c.name && c.email && c.github && c.linkedin && c.bio + ? buildNewIssueUrl(c) + : ""; + }, [name, email, github, linkedin, bio, area, tags]); + + return ( +
+
+

Contributors

+

+ This project grows because people like you show up and help. Beginners + are welcome, and no contribution is too small. +

+
+ +
+

People who contributed

+ +
+ {list.map((c) => ( + + ))} +
+
+ +
+

How to become a contributor

+ +
+ +
+

Add your details

+ +

+ Fill the fields below and click “Create request”. It will open a + GitHub issue with your details prefilled. +

+ +
+ + + + + + + + +