Github Activity React component
npm install react-github-activityInspired by this repository I wanted to develop a github activity component that was much simpler to setup in a react project.
npm install --save react-github-activity
Insert an octicons.css file in your html file to load the icons.
``html`
Enhance your personal website with react-github-activity component that:
- Provides visitors with quick access to your github profile
- Displays your public activity on GitHub
`js`
userName={string} // Provide User Name as displayed on Guthub
avatarUrl={string} // Provide the avatar url of your github profile
profileUrl={string} // optional: provide a url to your profile. default -> https://github.com/${userName}
events={array[object]} // provide array of events using the users '/events' endpoint of github api
/>
`js
import GitHubFeed from 'react-github-activity'
class Example extends React.Component {
render() {
const fullName = 'Piotr Romanowski'
const userName = 'piotrromanowski'
const avatarUrl = ''
const events = [/ data result from https://api.github.com/users/${userName}/events /];
return (
userName={userName} // Provide User Name as displayed on Guthub
avatarUrl={avatarUrl} // Provide the avatar url of your github profile
events={events} // provide array of events using the users '/events' endpoint of github api
/>
);
}
}
``
MIT