This repository has been archived by the owner on May 28, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 55
Adiciona página junte-se com renderização de arquivo MarkDown #86
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
03ebf58
Adiciona página junte-se com renderização de arquivo MarkDown
lucasmedeiros d6395a9
Merge branch 'master' into master
lucasmedeiros f009c77
Adiciona link para 'choose a license'
lucasmedeiros e942829
Merge branch 'master' of https://github.com/lucasmedeiros/IssueAi
lucasmedeiros 3166b73
Altera descrição de como adicionar o projeto ao IssueAi
lucasmedeiros 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
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
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 |
---|---|---|
|
@@ -46,7 +46,7 @@ | |
*/ | ||
|
||
.nav-option { | ||
margin: 0; | ||
margin: 10px; | ||
width: fit-content; | ||
} | ||
|
||
|
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,9 @@ | ||
.markdown a { | ||
color: #0366d6; | ||
} | ||
|
||
.markdown code { | ||
background-color: rgba(27, 31, 35, 0.05); | ||
border-radius: 20%; | ||
padding: 0.2em 0.4em; | ||
} |
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,14 @@ | ||
import React from 'react'; | ||
import ReactMarkdown from 'react-markdown'; | ||
import PropTypes from 'prop-types'; | ||
import './MarkDownRenderer.css'; | ||
|
||
const MarkDownRenderer = ({ markDownText }) => ( | ||
<ReactMarkdown source={markDownText} className="markdown" /> | ||
); | ||
|
||
MarkDownRenderer.propTypes = { | ||
markDownText: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default MarkDownRenderer; |
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,23 @@ | ||
# Junte-se a nós! | ||
|
||
Um dos objetivos principais do OpenDevUFCG é ajudar os projetos open source feitos e apoiados por estudantes de Ciência da Computação da UFCG a atrair contribuições. | ||
|
||
### Tem um projeto open source e deseja impulsioná-lo? | ||
|
||
O **IssueAi** tem o intuito de ser um espaço que promove a ajuda e colaboração de alunos para alunos através da exposição dos seus respectivos projetos para a comunidade da UFCG, fazendo crescer o espírito open source dentro do nosso ambiente acadêmico. | ||
|
||
Para ajudar ainda mais a atingir tal objetivo, orientamos que todo projeto tenha: | ||
|
||
- Um bom README. É importante tentar fazer as pessoas não terem medo da primeira contribuição que é a mais importante de todas, por isso seja claro, simples e amigável, é a chave para atrair contribuições. | ||
|
||
- Uma [licença](https://choosealicense.com/) Open Source. | ||
|
||
- Código de conduta. É preciso garantir um ambiente acolhedor e respeitável para todos. | ||
|
||
- Guia de contribuição. Uma boa documentação dos passos a serem seguidores para o uso do projeto tem que ser prioridade. Tente ser claro e direto, use o auxílio de outras documentações como hyperlinks. | ||
|
||
Para se aprofundar ainda mais no assunto, recomenda-se a leitura do [open source guide](https://opensource.guide/starting-a-project/). | ||
|
||
### Para adicionar um projeto | ||
|
||
Os dados dos repositórios usados para mostrar são recuperados a partir dos arquivos contidos no diretório `data/`. Para adicionar seu repositório aos nossos projetos apoiados, abra uma Pull Request com os dados do seu repositório em `data/repositories.js`, você pode acessá-lo [clicando aqui](https://github.com/OpenDevUFCG/IssueAi/blob/master/data/repositories.js). |
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,26 @@ | ||||||
import React, { useState, useEffect } from 'react'; | ||||||
import MarkDownRenderer from '../commons/renderer/MarkDownRenderer'; | ||||||
import joinUsFile from './JoinUs.md'; | ||||||
|
||||||
const JoinUsPage = () => { | ||||||
const [markDownText, setMarkDownText] = useState(''); | ||||||
|
||||||
useEffect(() => { | ||||||
async function fetchFileAndSetState() { | ||||||
const response = await fetch(joinUsFile); | ||||||
const text = await response.text(); | ||||||
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. this await is really necessary? because, in my understanding response will have a value when arrive at this line
Suggested change
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. Fetch returns a |
||||||
setMarkDownText(text); | ||||||
} | ||||||
|
||||||
fetchFileAndSetState(); | ||||||
}, []); | ||||||
|
||||||
return ( | ||||||
<section> | ||||||
<MarkDownRenderer markDownText={markDownText} /> | ||||||
<br /> | ||||||
</section> | ||||||
); | ||||||
}; | ||||||
|
||||||
export default JoinUsPage; |
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
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.
Why you put in a state? The markdown is static, so we don't need a state here, imo.
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.
By using a state, the page will render while the MarkDown text is being obtained by
fetch
, and also I can pass its value as props forMarkDownRenderer
component.