Skip to content

Commit

Permalink
Merge pull request #955 from Code4GovTech/feature/c4gt
Browse files Browse the repository at this point in the history
Feature/c4gt
  • Loading branch information
amit-s19 authored Jun 7, 2024
2 parents 571377a + 6179c05 commit 04048d5
Show file tree
Hide file tree
Showing 14 changed files with 977 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ npm-shrinkwrap.json

# Misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
26 changes: 23 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require('dotenv').config()
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const year = new Date().getFullYear();
Expand All @@ -14,10 +15,10 @@ module.exports = {
projectName: "c4gt",
themeConfig: {
navbar: {
title: "Home",
// title: "DMP",
logo: {
alt: "Home",
src: "img/logo.png",
alt: "DMP",
src: "img/C4GT_Logo_Text.png",
},
items: [
{
Expand Down Expand Up @@ -220,6 +221,21 @@ module.exports = {
},

],
},
{
label: "2024",
position: "left",
to: "/docs/2024/",
items: [
{
label: "VedantKhairnar",
to: "/docs/2024/org?id=VedantKhairnar",
},
{
label: "AbhimanyuSamagra",
to: "/docs/2024/org?id=AbhimanyuSamagra",
},
]
}
],
},
Expand Down Expand Up @@ -285,4 +301,8 @@ module.exports = {
},
],
],
customFields: {
API_BASE_URL: process.env.API_BASE_URL, // Assuming you have REACT_APP_API_URL set in your environment
API_AUTH_KEY: process.env.API_AUTH_KEY,
},
};
23 changes: 19 additions & 4 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"dotenv": "^16.4.5"
}
}
69 changes: 69 additions & 0 deletions src/components/C4GT2024Page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React from "react";

function C4GT2024Page() {
return (
<div
className="container padding-top--md padding-bottom--lg"
style={{ minHeight: "60vh" }}
>
<div className="row">
<div className="col width">
<div>
<article>
<nav
className="theme-doc-breadcrumbs"
style={{ marginBottom: ".4rem" }}
aria-label="breadcrumbs"
>
<ul className="breadcrumbs">
<li className="breadcrumbs__item">
<a className="breadcrumbs__link breadcrumbs-items" href="/">
🏠
</a>
</li>
<li className="breadcrumbs__item breadcrumbs__item--active">
<a
className="breadcrumbs__link breadcrumbs-items"
href="/docs/2024/"
style={{ cursor: "pointer" }}
>
C4GT'24
</a>
</li>
</ul>
</nav>
<div className="theme-doc-markdown markdown">
<header>
<h1>C4GT'24</h1>
</header>
<p>
C4GT Mentoring Program has been conceptualized as a summer
coding program to create a close-knit community that can build
and contribute to global digital public goods.
</p>
<ul>
<li>
An opportunity for college students and working
professionals in India to experience the GovTech space
</li>
<li>Organized annually over 2 months (July-August)</li>
<li>
There will be a set of diverse and engaging GovTech problem
statements every year for the participants to work on
</li>
<li>
Shortlisted contributors will receive mentorship from
leading practitioners in GovTech ecosystem
</li>
</ul>
<p>Thanks for being part of the community. 💚</p>
</div>
</article>
</div>
</div>
</div>
</div>
);
}

export default C4GT2024Page;
138 changes: 138 additions & 0 deletions src/components/ProjectDescription.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import React, { useEffect, useState } from "react";
import { useHistory } from "react-router-dom";
import useParseMarkdown from "../hooks/useParseMarkdown";

function ProjectDescription({
currentIssue,
currentIssueData,
setCurrentTab,
setSelectedProject,
setIssueNumber,
error,
setError
}) {
const history = useHistory();
const {API_AUTH_KEY,API_BASE_URL} = useParseMarkdown();
const [description, setDescription] = useState(null);
const [mobile, setMobile] = useState(false);

useEffect(() => {
setError(()=>null);
fetch(`${API_BASE_URL}/issues/${currentIssue}`, {
method: "GET",
headers: {
"X-Secret-Key": API_AUTH_KEY,
},
})
.then((response) => {
if (!response.ok) {
throw new Error(`Error! status: ${response.status}`);
}
return response.json();
})
.then((data) => {
setDescription(() => data);
})
.catch((error) => {
setError(error);
});
}, [currentIssue]);

useEffect(() => {
const handleResize = () => {
if (window.innerWidth < 997) {
setMobile(true);
} else {
setMobile(false);
}
};
handleResize();

window.addEventListener("resize", handleResize);

return () => {
window.removeEventListener("resize", handleResize);
};
}, []);
return (
<>
{!error && (
<div
className="container padding-top--md padding-bottom--lg"
style={{ minHeight: "60vh" }}
>
<div className="row">
<div className="col width">
<div>
<article>
<nav
className="theme-doc-breadcrumbs"
style={{ marginBottom: ".4rem" }}
aria-label="breadcrumbs"
>
<ul className="breadcrumbs">
<li className="breadcrumbs__item">
<a
className="breadcrumbs__link breadcrumbs-items"
href="/"
>
🏠
</a>
</li>
<li className="breadcrumbs__item breadcrumbs__item--active">
<a
className="breadcrumbs__link breadcrumbs-items"
href={`/docs/2024/org?id=${description?.name}`}
style={{ cursor: "pointer" }}
>
{description?.name}
</a>
</li>
</ul>
</nav>
<div className="theme-doc-markdown markdown">
<header>
<h1>{description?.name}</h1>
</header>
<p>{description?.description}</p>
{mobile && (
<>
<h3>
Following are the list of Issues associated with the
organization
</h3>
{currentIssueData?.length != 0 && (
<ul>
{currentIssueData?.map((d, i) => {
return (
<li key={i}>
<a
onClick={() => {
const newUrl = `/docs/2024/org?id=${currentIssue}&issue=${d.name}`;
history.push(newUrl);
setCurrentTab(() => "subDescription");
setSelectedProject(() => d.name);
setIssueNumber(() => d.issue_number);
}}
>
{d.name}
</a>
</li>
);
})}
</ul>
)}
</>
)}
</div>
</article>
</div>
</div>
</div>
</div>
)}
</>
);
}

export default ProjectDescription;
Loading

0 comments on commit 04048d5

Please sign in to comment.