My first npm project. I noticed there aren't any builds like this so I decided I'll create one myself. This component builds up a calendar from the commits you made to github.
- First you need to get your Github Access Token. If you don't know how to do that here is how:
- Create
.env
file at the root of your project folder (make sure you have .env included in .gitignore), and paste the given personal access token:
REACT_APP_GITHUB_ACCESS_TOKEN="your access token goes here"
This is needed to get access to github's api. You might encounter issues like your app will be getting a 401 error. In this case you need to reset the token in your github profile and change it in your .env file accordingly.
Start by installing react-github-contributions-component
npm install react-github-contributions-component
Import it...
import {GithubContribution} from 'react-github-contributions-component'
...and use it in one of your components.
<GithubContribution userName="<yourusername>" theme="<option>" />
import {GithubContribution} from 'react-github-contributions-component';
function App() {
return (
<div className="App">
<GithubContribution userName="jakapresecnik" theme="dark" />
</div>
);
}
Select one of these options for different theme: `"light", "dark", "purpleDark", "jokerLight", "jokerDark"
If you want it to have a different direction use attribute vertical
in component. You don't need to pass any value in as it tests if it is true or false.
Like I said I just started building it, and it is still a bit rough, so expect to get updated. But for the future as a whole, this project will probably become depreciated, as I am from Slovenia and there are no Front end developer roles here, as well as having a class system that doesn't allow me to have a decant job only some shitty jobs where you die as soon as your shift is over .