Skip to content

Commit 7522b7f

Browse files
anishfyiftonato
authored andcommitted
feat: add hyperlinks in Ways to Contribute home section (#302)
1 parent efab163 commit 7522b7f

File tree

4 files changed

+33
-6
lines changed

4 files changed

+33
-6
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"@testing-library/jest-dom": "^4.2.4",
99
"@testing-library/user-event": "^7.1.2",
1010
"dayjs": "^1.9.3",
11+
"html-react-parser": "^1.4.0",
1112
"react": "^16.13.1",
1213
"react-dom": "^16.13.1",
1314
"react-native-hyperlink": "0.0.19",

src/Components/Home/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import SectionSubheader from './../SectionSubheader';
55
import { getHome } from './../../content/home';
66
import { Box, Content, Description } from './styles';
77
import ContributionSection from './contribution/ContributionSection';
8+
import HTMLReactParser from 'html-react-parser';
89

910
function Home() {
1011
const content = getHome();
@@ -13,7 +14,9 @@ function Home() {
1314
<Content key={index}>
1415
<SectionSubheader title={section.title} />
1516
{section.content.map((content, indx) => {
16-
return <Description key={indx}>{content.par}</Description>;
17+
return (
18+
<Description key={indx}>{HTMLReactParser(content.par)}</Description>
19+
);
1720
})}
1821
</Content>
1922
);

src/content/home.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ const home = {
2424
},
2525
content: [
2626
{
27-
par: 'You can start contributing to our various open source projects by- \n\n1) Creating issues on Github regarding the project \n2) Debugging the issues \n3) Creating pull requests, testing pull requests \n4) Create mockups for new applications or redesign the current features \n5) Research about UI/UX improvements and accessibility features. \n6) Create app walk through with documents or videos, UI testing once the PR is submitted for the UI issue',
27+
par:
28+
'You can start contributing to our various open source projects by- \n\n1) <a href = "https://github.com/anitab-org/anitab-org.github.io/issues" target="_blank">Creating issues on Github</a> regarding the project \n2) Debugging the issues \n3) Creating pull requests, testing pull requests \n4) Create mockups for new applications or redesign the current features \n5) Research about UI/UX improvements and accessibility features. \n6) Create app walk through with documents or videos, UI testing once the PR is submitted for the UI issue',
2829
},
2930
{
30-
par: "Each active repository has a stream to direct questions. \nIssues labeled as 'First Timers Only' are meant for contributors who have not contributed to the project yet. Please choose other issues to contribute to, if you have already contributed to these type of issues. \nMake sure to follow the Commit Message Style Guide when submitting PRs which will require review by at least one maintainer to be merged to the main code.",
31+
par:
32+
'Each active repository has a stream to direct questions. \nIssues labeled as <a href = "https://github.com/anitab-org/anitab-org.github.io/issues?q=is%3Aopen+is%3Aissue+label%3A%22First+Timers+Only%22" target="_blank">First Timers Only</a> are meant for contributors who have not contributed to the project yet. Please choose other issues to contribute to, if you have already contributed to these type of issues. \nMake sure to follow the <a href = "https://github.com/anitab-org/mentorship-android/wiki/Commit-Message-Style-Guide" target="_blank">Commit Message Style Guide</a> when submitting PRs which will require review by at least one maintainer to be merged to the main code.',
3133
},
3234
],
3335
},

src/test/__snapshots__/Home.test.js.snap

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,14 @@ If you are subject to or witness unacceptable behavior, or have any other concer
132132
>
133133
You can start contributing to our various open source projects by-
134134
135-
1) Creating issues on Github regarding the project
135+
1)
136+
<a
137+
href="https://github.com/anitab-org/anitab-org.github.io/issues"
138+
target="_blank"
139+
>
140+
Creating issues on Github
141+
</a>
142+
regarding the project
136143
2) Debugging the issues
137144
3) Creating pull requests, testing pull requests
138145
4) Create mockups for new applications or redesign the current features
@@ -145,8 +152,22 @@ If you are subject to or witness unacceptable behavior, or have any other concer
145152
style="font-size: 18px; font-weight: 200; text-align: left;"
146153
>
147154
Each active repository has a stream to direct questions.
148-
Issues labeled as 'First Timers Only' are meant for contributors who have not contributed to the project yet. Please choose other issues to contribute to, if you have already contributed to these type of issues.
149-
Make sure to follow the Commit Message Style Guide when submitting PRs which will require review by at least one maintainer to be merged to the main code.
155+
Issues labeled as
156+
<a
157+
href="https://github.com/anitab-org/anitab-org.github.io/issues?q=is%3Aopen+is%3Aissue+label%3A%22First+Timers+Only%22"
158+
target="_blank"
159+
>
160+
First Timers Only
161+
</a>
162+
are meant for contributors who have not contributed to the project yet. Please choose other issues to contribute to, if you have already contributed to these type of issues.
163+
Make sure to follow the
164+
<a
165+
href="https://github.com/anitab-org/mentorship-android/wiki/Commit-Message-Style-Guide"
166+
target="_blank"
167+
>
168+
Commit Message Style Guide
169+
</a>
170+
when submitting PRs which will require review by at least one maintainer to be merged to the main code.
150171
</div>
151172
</div>
152173
</div>

0 commit comments

Comments
 (0)