# @apolitical/frontend-partials

> Frontend Partials for use in non react applications

Latest version **1.0.0** (published 2019-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @apolitical/frontend-partials
pnpm add @apolitical/frontend-partials
yarn add @apolitical/frontend-partials
bun add @apolitical/frontend-partials
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-08-09 |
| First published | 2019-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^10.11.0 |
| Dependencies | 8 |
| Unpacked size | 102.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Daniel Mason |
| Maintainers | floppy.uk, gisleburt, huwd, npm-apolitical-frontend-partials, paddyalton |

## Links

- npm: https://www.npmjs.com/package/@apolitical/frontend-partials
- Repository: https://github.com/apolitical/frontend-partials
- Homepage: https://github.com/apolitical/frontend-partials#readme
- Issues: https://github.com/apolitical/frontend-partials/issues
- npm.io page: https://npm.io/package/@apolitical/frontend-partials

## Dependencies (8)

- [react](https://npm.io/package/react.md) ^16.9.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.9.0
- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.4.4
- [core-decorators](https://npm.io/package/core-decorators.md) ^0.20.0
- [isomorphic-fetch](https://npm.io/package/isomorphic-fetch.md) ^2.2.1
- [react-router-dom](https://npm.io/package/react-router-dom.md) ^4.3.1
- [styled-components](https://npm.io/package/styled-components.md) ^4.3.2
- [@apolitical/styleguide](https://npm.io/package/@apolitical/styleguide.md) ^3.3.0

## Recent versions

- 1.0.0 (latest) — 2019-08-09
- 1.0.0-beta.2 — 2019-08-09
- 1.0.0-beta.1 — 2019-08-08
- 0.7.0 — 2019-08-08
- 0.7.0-beta.1 — 2019-08-07
- 0.6.2 — 2019-01-21
- 0.6.2-fix-ie.0 — 2019-01-21
- 0.6.1 — 2019-01-18
- 0.6.0 — 2019-01-11
- 0.5.3 — 2019-01-10
- 0.5.2 — 2019-01-10
- 0.5.1 — 2019-01-10
- 0.5.0 — 2019-01-10
- 0.5.0-beta.5.0 — 2019-01-10
- 0.4.0-beta.4.0 — 2019-01-10

## README

Frontend Skeleton
=================

[![GitHub release](https://img.shields.io/github/release/apolitical/frontend-partials.svg)](https://github.com/apolitical/frontend-partials/releases)
[![GitHub license](https://img.shields.io/github/license/apolitical/frontend-partials.svg)](https://github.com/apolitical/frontend-partials/blob/master/LICENSE)
[![CircleCI](https://img.shields.io/circleci/project/github/apolitical/frontend-partials/master.svg)](https://circleci.com/gh/apolitical/frontend-partials)

This is a boilerplate for React Redux applications.

Usage
-----

### Dependencies

You will need to import the following dependencies. We recommend doing this at the bottom of the
page.

```html
<script type="text/javascript"
        src="https://unpkg.com/@babel/polyfill@7.2.5/dist/polyfill.min.js"></script>
<script type="text/javascript"
        src="https://unpkg.com/react@16.7.0/umd/react.production.min.js"></script>
<script type="text/javascript"
        src="https://unpkg.com/react-dom@16.7.0/umd/react-dom.production.min.js"></script>
<script type="text/javascript"
        src="https://unpkg.com/react-redux@6.0.0/dist/react-redux.min.js"></script>
<script type="text/javascript"
        src="https://unpkg.com/react-router-dom@4.3.1/umd/react-router-dom.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/redux@4.0.1/dist/redux.min.js"></script>
<script type="text/javascript"
        src="https://unpkg.com/redux-saga@0.16.2/dist/redux-saga.min.js"></script>
<script type="text/javascript"
        src="https://unpkg.com/styled-components@4.1.3/dist/styled-components.min.js"></script>
```

Additionally, there is some code shared between the partials, this should come after the above.

```html
<script type="text/javascript"
        src="https://unpkg.com/@apolitical/frontend-partials@0.6.0/dist/vendors~footer~header.js"></script>
```

Script files for the partials should come after this. The elements they hook into should come before
the script files.

### Header

Include the header.js script, you can use unpkg to get this.

```html
<script type="text/javascript"
        src="https://unpkg.com/@apolitical/frontend-partials@0.6.0/dist/header.js"></script>
```

Where you want to place the header, add an element with a data attribute `partial-app` set to
`header`:

```html
<div data-partial-app="header"></div>
```

By default, the header will not react to someone being logged out. If you wish for something else to
happen (such as a redirect) you can pass in the name of a function in the global scope using the
`header-logged-out` data attribute;

```html
<script>
function goToLogin(e) {
    // console.error(e);
    window.location = '/login';
}
</script>
<div data-partial-app="header" data-header-logged-out="goToLogin"></div>
```


### Footer

Include the footer.js script, you can use unpkg to get this.

```html
<script type="text/javascript"
        src="https://unpkg.com/@apolitical/frontend-partials@0.6.0/dist/footer.js"></script>
```

Where you want to place the header, add an element with a data attribute `partial-app` set to
`footer`:

```html
<div data-partial-app="footer"></div>
```

There are no options for the footer.


Versioning
----------

Use `npm version` to edit the version number. Either:
- `npm version major|minor|patch` for a full release or
- `npm version premajor|preminor|prepatch --preid=meta.data.here` for a pre-release

Contributing
------------

If you want to help, that's brilliant! Have a look at our [Contributing Guide](CONTRIBUTING.md). We also adhere to a
[Code of Conduct](CODE_OF_CONDUCT.md), so please check that out, it includes details on who to contact if you have any
concerns.

---
_Source: https://npm.io/package/@apolitical/frontend-partials · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
