@@ -18,46 +18,38 @@ function toCardData(trelloCard, defaultCover) {
1818}
1919
2020function ContributorPrograms ( { data } ) {
21- const trelloCards = data . allTrelloCard . nodes ;
22-
2321 const defaultCover = data . projectCover ;
24- const availableProjects = trelloCards
25- . filter ( ( node ) => node . list_id === "5c3aab0bd640fe19e4069de5" )
26- . map ( ( node ) => toCardData ( node , defaultCover ) ) ;
27- const ongoingProjects = trelloCards
28- . filter ( ( node ) => node . list_id === "60ddd7cf64da4b3ee8c5a2e9" )
29- . map ( ( node ) => toCardData ( node , defaultCover ) ) ;
30-
22+ const availableProjects = data . availableProjects . nodes . map ( ( node ) =>
23+ toCardData ( node , defaultCover )
24+ ) ;
3125 const defaultAvatar = data . profilePlaceholder ;
32- const mentorList = trelloCards
33- . filter ( ( node ) => node . list_id === "5eb715b48caa18614425c25e" )
34- . map ( ( node ) => {
35- const {
36- name,
37- labels,
38- custom_fields : customFields ,
39- childMarkdownRemark,
40- childCardMedia,
41- } = node ;
42- const { html } = childMarkdownRemark ;
43- const avatar = childCardMedia ? childCardMedia . localFile : defaultAvatar ;
26+ const mentorList = data . mentors . nodes . map ( ( node ) => {
27+ const {
28+ name,
29+ labels,
30+ custom_fields : customFields ,
31+ childMarkdownRemark,
32+ childCardMedia,
33+ } = node ;
34+ const { html } = childMarkdownRemark ;
35+ const avatar = childCardMedia ? childCardMedia . localFile : defaultAvatar ;
4436
45- const tags = labels . map ( ( l ) => l . name ) ;
46- const githubProfile = customFields . find (
47- ( field ) => field . idCustomField === "5eb71b3551de3a59ce8d9bd8"
48- ) ?. value . text ;
49- const timeZone = customFields . find (
50- ( field ) => field . idCustomField === "5eb71b53f52d88487f550e83"
51- ) ?. value . text ;
52- const countryCode = customFields
53- . find ( ( field ) => field . idCustomField === "5eb71b7081a67c3b58ea67ed" )
54- ?. value . text . toLowerCase ( ) ;
37+ const tags = labels . map ( ( l ) => l . name ) ;
38+ const githubProfile = customFields . find (
39+ ( field ) => field . idCustomField === "5eb71b3551de3a59ce8d9bd8"
40+ ) ?. value . text ;
41+ const timeZone = customFields . find (
42+ ( field ) => field . idCustomField === "5eb71b53f52d88487f550e83"
43+ ) ?. value . text ;
44+ const countryCode = customFields
45+ . find ( ( field ) => field . idCustomField === "5eb71b7081a67c3b58ea67ed" )
46+ ?. value . text . toLowerCase ( ) ;
5547
56- return { name, avatar, tags, html, githubProfile, timeZone, countryCode } ;
57- } ) ;
48+ return { name, avatar, tags, html, githubProfile, timeZone, countryCode } ;
49+ } ) ;
5850
5951 return (
60- < Layout title = "Contributor Programs & Projects " >
52+ < Layout title = "Contributor Programs" >
6153 < Section tag = "h3" title = "GSoC & TSoC" >
6254 < Row className = "justify-content-center align-items-start" >
6355 < Col md = "5" className = "text-justify student-programs-content" >
@@ -94,13 +86,8 @@ function ContributorPrograms({ data }) {
9486 </ Col >
9587 </ Row >
9688 </ Section >
97- { ongoingProjects . length !== 0 ? (
98- < Section tag = "h3" title = "Ongoing Projects" >
99- < PostListing postList = { ongoingProjects } />
100- </ Section >
101- ) : null }
10289 { availableProjects . length !== 0 ? (
103- < Section tag = "h3" title = "Available Projects " >
90+ < Section tag = "h3" title = "Available Topics " >
10491 < PostListing postList = { availableProjects } />
10592 </ Section >
10693 ) : null }
@@ -130,7 +117,26 @@ export default ContributorPrograms;
130117
131118export const pageQuery = graphql `
132119 query projectQuery {
133- allTrelloCard(sort: { index: ASC }) {
120+ availableProjects: allTrelloCard(
121+ filter: { list_id: { eq: "5c3aab0bd640fe19e4069de5" } }
122+ sort: { index: ASC }
123+ ) {
124+ nodes {
125+ id
126+ list_id
127+ name
128+ labels {
129+ name
130+ }
131+ childMarkdownRemark {
132+ excerpt
133+ }
134+ }
135+ }
136+ mentors: allTrelloCard(
137+ filter: { list_id: { eq: "5eb715b48caa18614425c25e" } }
138+ sort: { index: ASC }
139+ ) {
134140 nodes {
135141 id
136142 list_id
@@ -180,8 +186,6 @@ export const pageQuery = graphql`
180186
181187export function Head ( { data } ) {
182188 return (
183- < SEO
184- title = { `Contributor Programs & Projects | ${ data . site . siteMetadata . title } ` }
185- />
189+ < SEO title = { `Contributor Programs | ${ data . site . siteMetadata . title } ` } />
186190 ) ;
187191}
0 commit comments