-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: developed contribution section in project page #173
Open
Bucky25
wants to merge
13
commits into
anitab-org:develop
Choose a base branch
from
Bucky25:contribution-_heat_map
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
88b86e9
made cards and developed event section (anitab-org#123)
Bucky25 fafb091
develop contribution section in project page #80
Bucky25 1c7ef02
develop contribution section in project page
Bucky25 ea584eb
develop contribution section in project page #80
Bucky25 760ce7b
tweaked styles and cosole errors
Bucky25 ae68497
removed gramatical errors
Bucky25 0f8f20d
removed class component and added functional component
Bucky25 2096684
moved data to content , renamed props and added scrollview
Bucky25 650b8a8
added data to content and added scrollview
Bucky25 31151ea
Merge branch 'develop' into contribution-_heat_map
annabauza 9600127
Minor tweaks
Bucky25 92b93a3
Minor tweaks
Bucky25 508de9e
removed conflicting files
Bucky25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import { StyleSheet, View} from 'react-native'; | ||
|
||
|
||
const ContributionBox = ({ commitCount }) => { | ||
var hue = 0; | ||
switch (true) { | ||
|
||
case (commitCount < 2): | ||
hue = .4; | ||
break; | ||
case (commitCount >=2 && commitCount < 4): | ||
hue = .6; | ||
break; | ||
case (commitCount >=4 && commitCount < 8): | ||
hue = .7; | ||
break; | ||
case (commitCount >=8 && commitCount < 12): | ||
hue = .9; | ||
break; | ||
case (commitCount >=12 ): | ||
hue = 1; | ||
break; | ||
default : | ||
hue = 0; | ||
break; | ||
} | ||
var colorCode = 'rgba(0, 113, 188,' + hue + ')'; | ||
return ( | ||
<View style={[style.box, {backgroundColor: colorCode}]}/> | ||
); | ||
}; | ||
|
||
const style = StyleSheet.create({ | ||
box: { | ||
width: 20, | ||
height: 20, | ||
margin: 2.5, | ||
} | ||
}); | ||
|
||
export default ContributionBox; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import React ,{useState} from 'react'; | ||
import { View, Text, StyleSheet } from 'react-native'; | ||
import ContributionBox from './Box'; | ||
|
||
function ContributionRow ({...props}) { | ||
let [data ,setData] = useState(null); | ||
React.useEffect( () => { | ||
const endpoint = props.detail.link; | ||
const headers = { | ||
"Authorization" : process.env.ACCESS_TOKEN | ||
} | ||
fetch(endpoint, { | ||
"method" :"GET", | ||
"headers" : headers | ||
}) | ||
.then((resp) => resp.json()) | ||
.then((obj) => { | ||
setData( obj) ; | ||
}); | ||
}, []) | ||
let Contributionrow = []; | ||
const reponame = props.detail.name; | ||
const take = () =>{ | ||
Contributionrow.push(<Text key={0} style={styles.desc}>{reponame}</Text>); | ||
let week = 0; | ||
let days =0; | ||
while (true) { | ||
for (let i=6;i>=0;i--) | ||
{ | ||
Contributionrow.push( | ||
<ContributionBox key={days+1} commitCount={data[51-week].days[i]} /> | ||
); | ||
days++; | ||
if(days>=30)break; | ||
annabauza marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
week++; | ||
if(days>=30)break; | ||
} | ||
return null; | ||
} | ||
|
||
return ( | ||
|
||
<View> | ||
{data === null ? | ||
<Text style={styles.desc}>loading...</Text> | ||
: | ||
<View style={{ | ||
flexDirection: 'row', | ||
flexWrap: 'wrap', | ||
}} | ||
> | ||
{take()} | ||
{Contributionrow} | ||
</View> | ||
} | ||
</View> | ||
|
||
); | ||
//} | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
desc: { | ||
color: '#0071BC', | ||
fontSize: 16, | ||
fontWeight: '400', | ||
width: 190, | ||
margin:4, | ||
}, | ||
box: { | ||
flexDirection: 'row', | ||
flexWrap: 'wrap', | ||
marginTop: 8, | ||
} | ||
}) | ||
|
||
export default ContributionRow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react'; | ||
import { View, StyleSheet, Text, ScrollView } from 'react-native'; | ||
import SectionHeader from './../../SectionHeader'; | ||
import ContributionRow from './ContributionRow'; | ||
import ContributionBox from './Box'; | ||
import { getrepoData } from './../../../content/projects_content'; | ||
|
||
|
||
function Contribution () { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use arrow function here for consistency as it's being used everywhere else. |
||
const repoData = getrepoData(); | ||
return ( | ||
<View > | ||
<SectionHeader title={'Last 30 Days Contribution'} /> | ||
<ScrollView horizontal={true}> | ||
<View style={{margin: 32}}> | ||
{repoData.data.map((repo,index) => ( | ||
<ContributionRow detail={repo} key={index} /> | ||
)) | ||
} | ||
<View style={styles.description}> | ||
<Text style={styles.text}>Less</Text> | ||
<ContributionBox commitCount={1} /> | ||
<ContributionBox commitCount={3} /> | ||
<ContributionBox commitCount={6} /> | ||
<ContributionBox commitCount={10} /> | ||
<ContributionBox commitCount={13} /> | ||
<Text style={styles.text}>More</Text> | ||
</View> | ||
</View> | ||
</ScrollView> | ||
</View> | ||
); | ||
|
||
} | ||
|
||
const styles = StyleSheet.create({ | ||
description: { | ||
flexDirection: 'row', | ||
flexWrap: 'wrap', | ||
alignSelf: 'flex-end', | ||
|
||
}, | ||
text: { | ||
color: '#0071BC', | ||
fontSize: 12, | ||
fontWeight: '400', | ||
padding: 4, | ||
}, | ||
}); | ||
|
||
export default Contribution; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
const events_highlight = { | ||
sections: [ | ||
{ | ||
title: 'Our Events and Highlights', | ||
content: [ | ||
{ | ||
par: 'AnitaB.org Open Source Events convenes members from all backgrounds and levels of expertise throughout the year to bridge the diversity gap in Open Source development.' | ||
}, | ||
{ | ||
par: 'Our events aim to give members insights from industry experts and female-identifying leaders on a variety of topics promoting Open Source, and covering stages of Open Source development right from Introduction to Quality Assurance.' | ||
} | ||
] | ||
}, | ||
{ | ||
events: [ | ||
{ | ||
title: 'Why I contribute to Open source?', | ||
date: 'July 4, 2020', | ||
location: 'Virtual', | ||
timings: '1am (UTC)', | ||
description: [ | ||
{ | ||
par: 'Heard about Open Source, not sure what’s in it for you? Need a boost to begin?' | ||
}, | ||
{ | ||
par: 'This event will give you an understanding of the motivation behind individuals who contribute to open source' | ||
}, | ||
{ | ||
par: 'Open Source contributors with varying experiences will be there to share their journey, and answer your questions!' | ||
} | ||
], | ||
highlights:{ | ||
source: require('./../assets/events_and_highlights/1.png'), | ||
}, | ||
know_more: | ||
{ | ||
par: 'Feel free to contact AnitaB.org Open Source on Zulip if you need any further information about this event.', | ||
link: 'https://anitab-org.zulipchat.com', | ||
} | ||
}, | ||
{ | ||
title: 'Engaging Open Source community in Quality Assurance', | ||
date: 'August 9, 2020', | ||
location: 'Virtual', | ||
timings: '9am (EST)', | ||
description: [ | ||
{ | ||
par: 'Wondered how Quality Assurance (QA) for software is performed in companies or what are the roles and responsibilities of an QA engineer?' | ||
}, | ||
{ | ||
par: 'This talk will help members grasp concepts of traditional QA methods such as formalized testing, writing and tracking bugs which are equally relevant for Open Source development.' | ||
}, | ||
{ | ||
par: 'We will explore the contrasting nature of software quality assurance under the Open Source model and traditional software development models. Consequently, their translation in practical advantages.' | ||
}, | ||
{ | ||
par: 'It will draw attention to pragmatic quality assurance practices in upstream Open Source projects like Fedora.' | ||
}, | ||
{ | ||
par: 'This will certainly give members a head-start by laying out some of the best practices and common challenges faced while quality testing Open Source products.' | ||
} | ||
], | ||
highlights:{ | ||
source: require('./../assets/events_and_highlights/2.png'), | ||
}, | ||
know_more: { | ||
par: 'Feel free to contact AnitaB.org Open Source on Zulip if you need any further information about this event.', | ||
link: 'https://anitab-org.zulipchat.com', | ||
} | ||
}, | ||
{ | ||
title: 'Hopper India 2020', | ||
date: 'August 6 — August 7,2020', | ||
location: 'Virtual', | ||
timings: '9:30am - 4pm (IST)', | ||
description: [ | ||
{ | ||
par: 'Our vibrant community of women in technology from Chennai, Delhi, Hyderabad, and Pune is coming together to present this two-day virtual event modeled after the popular Grace Hopper Celebration India (GHCI) conference for women in technology.' | ||
}, | ||
{ | ||
par: 'This immersive event brings together women technologists at all levels from industry, academia, research and startups to build connections, learn, and advance their careers.' | ||
}, | ||
{ | ||
par: 'Attend inspiring keynotes and sessions led by charismatic women carrying a zeal to learn, grow and lead.' | ||
}, | ||
{ | ||
par: 'Don’t miss out on the opportunity to network with peers, and gain important resources to help you succeed in and further your career.' | ||
}, | ||
{ | ||
par: 'Our Career Fair, hosting tech giants, research labs, and financial-tech companies, offers immense job opportunities to both students and professionals.' | ||
} | ||
], | ||
highlights:{ | ||
source: require('./../assets/events_and_highlights/3.png'), | ||
}, | ||
know_more: { | ||
par: 'Visit our official Grace Hopper Celebration India website for details about registration, eligibility, scholarships, conference sessions and FAQs.', | ||
link: 'https://ghcindia.anitab.org/', | ||
} | ||
}, | ||
{ | ||
title: 'Grace Hopper Celebration 2020', | ||
date: 'September 29 — October 3,2020', | ||
location: 'Virtual', | ||
timings: '11am - 3pm (PT)', | ||
description: [ | ||
{ | ||
par: 'AnitaB.org’s flagship event Grace Hopper Celebration brings the research and career interests of women in computing to the forefront.' | ||
}, | ||
{ | ||
par: 'Grace Hopper Celebration (GHC), world’s largest gathering of women technologists, commemorates, celebrates, fosters and encourages the magnificent women in technology who dared to shed their inhibitions, and recognized the genius in them.' | ||
}, | ||
{ | ||
par: 'Attend inspiring keynotes and sessions, network with peers, and gain important resources to help you succeed in and further your career.' | ||
}, | ||
{ | ||
par: 'The celebration consists of a combination of technical sessions, poster sessions, career fairs, award ceremonies and more.' | ||
} | ||
], | ||
highlights:{ | ||
source: require('./../assets/events_and_highlights/4.png'), | ||
}, | ||
know_more:{ | ||
par: 'Visit our official Grace Hopper Celebration website for details about registration, eligibility, scholarships, conference sessions and FAQs.', | ||
link: 'https://ghc.anitab.org', | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}; | ||
|
||
export const getevents_highlights = () => { | ||
return events_highlight; | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is dodgy i think simple if else would do here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done @annabauza please check it