hosted_on v0.1.1
HostedOn
A simple footer component for React displaying where the source is hosted on.
- Status
- Installation
Your choice of yarn add hosted_on or npm install hosted_on. When installing with npm, you
can also use npm install hosted_on --save in order to save to your package.json.
In your index.html, add the following:
<link rel="stylesheet"
crossorigin="anonymous"
href="https://opensource.keycdn.com/fontawesome/4.7.0/font-awesome.min.css"
integrity="sha384-dNpIIXE8U05kAbPhy3G1cz+yZmTzA6CY8Vg/u2L9xRnHjJiAK76m2BIEaSEV+/aU"
>That may not be necessary. That is simply the easiest way to get font awesome. If you downloaded it,
you can use your own.
- Use
Inside a component you define (most likely the main component like App.js), do import HostedOn from 'hosted_on'.
White the component imported, use it like this:
<HostedOn link="https://github.com/my_username/my_repo"/>
It doesn't have to be Github. You can use it with Bitbucket or Gitlab, whatever else is out there.
The component will try to guess the icon based on the link and will send you there if you click.
You can also do this:
<HostedOn link="https://github.com/my_username/my_repo" icon="my_special_icon" />
If the icon exists in font awesome, it will use that instead.