Univjobs UI Components
Usage Notes
To re-use these components throughout the app, simply install with
npm install univjobs-ui-components
Then, we can use any component, such as our Header like this:
import { Header } from 'univjobs-ui-components'
// Globally import the built css
import "univjobs-ui-components/build/index.css"
const App = () => (
<Header
siteTitle={data.site.siteMetadata.title}
appUrl={config.appUrl}
linkComponent={Link}
/>
)
One other thing must also be done. We also need to make sure that we copy over any assets that are being used in the UI components. The Header
component is a good example of this.
Therefore, there must be a public static
folder.
Copy over all assets from univjobs-ui-components/build/static
to the root directory relative to the React bundle.
With Gatsby
This is a breeze. Just copy the contents of univjobs-ui-components/static
to static
.
Assets will be resolved like:
static/media/login.127fc1fd.svg => /static
With a Client React App
TODO