Skip to content

Commit ba85e10

Browse files
authored
Added content to the Readme
1 parent dc3f6a7 commit ba85e10

File tree

5 files changed

+98
-7
lines changed

5 files changed

+98
-7
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- run: yarn install
4848
- run: yarn build
4949
- run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/tmp/.npmrc
50-
- run: yarn publish --new-version ${CIRCLE_TAG}
50+
- run: yarn publish --new-version ${CIRCLE_TAG} --no-git-tag-version
5151

5252
workflows:
5353
version: 2

README.md

+62-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,65 @@
11
# React Rasta
22
[![release](https://img.shields.io/github/release/ChilliCream/react-rasta.svg)](https://github.com/ChilliCream/react-rasta/releases) [
33
![package](https://img.shields.io/npm/v/react-rasta.svg)](https://www.npmjs.com/package/react-rasta) [![license](https://img.shields.io/github/license/ChilliCream/react-rasta.svg)](https://github.com/ChilliCream/react-rasta/blob/master/LICENSE)
4-
[![build](https://img.shields.io/circleci/project/github/ChilliCream/react-rasta.svg)](https://circleci.com/gh/ChilliCream/react-rasta/tree/master) [![coverage](https://img.shields.io/coveralls/ChilliCream/react-rasta.svg)](https://coveralls.io/github/ChilliCream/react-rasta?branch=master)
4+
[![build](https://img.shields.io/circleci/project/github/ChilliCream/react-rasta.svg)](https://circleci.com/gh/ChilliCream/react-rasta/tree/master) [![coverage](https://img.shields.io/coveralls/ChilliCream/react-rasta.svg)](https://coveralls.io/github/ChilliCream/react-rasta?branch=master)
5+
6+
A grid system for *React* projects to keep the layout structured and responsive.
7+
8+
*React Rasta* is a 12 column grid system and works underneath with the *CSS flexbox* layout. But because it can be difficult to work with *CSS flexbox*, *React Rasta* offers a simple *API* so you don't have to worry about that.
9+
10+
## Getting Started
11+
12+
Here you will find what is needed to get started.
13+
14+
### Install Package
15+
16+
First things first. Install the package `react-rasta` with *yarn* or *npm*.
17+
18+
When using *yarn* it looks like this.
19+
20+
```powershell
21+
yarn add react-rasta
22+
```
23+
24+
And when using *npm* it looks like this.
25+
26+
```powershell
27+
npm install react-rasta
28+
```
29+
30+
### Basic Example
31+
32+
Here is a quick and basic example.
33+
34+
```tsx
35+
//App.tsx
36+
import * as React from 'react';
37+
import { Column, Container, Row } from 'react-rasta';
38+
39+
export default class App extends React.Component {
40+
render() {
41+
return (
42+
<Container>
43+
<Row>
44+
<Column size={3}>
45+
Left
46+
</Column>
47+
<Column size={{ 'xs': 6, 'md': 3 }}>
48+
Middle 1
49+
</Column>
50+
<Column size={{ 'xs': 6, 'md': 3 }}>
51+
Middle 2
52+
</Column>
53+
<Column size={3}>
54+
Right
55+
</Column>
56+
</Row>
57+
</Container>
58+
);
59+
}
60+
}
61+
```
62+
63+
## Documentation
64+
65+
Click [here](https://github.com/ChilliCream/react-rasta-docs) to get to the documentation home of *React Rasta*.

jest.config.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
{
2+
"collectCoverageFrom": [
3+
"src/**/*.{js,jsx,ts,tsx}",
4+
"!src/**/*.story.{js,jsx,ts,tsx}"
5+
],
26
"coverageReporters": [
37
"cobertura",
48
"lcov"
@@ -11,7 +15,7 @@
1115
"json",
1216
"node"
1317
],
14-
"testRegex": ".*?\\.(test|spec)\\.(jsx?|tsx?)$",
18+
"testRegex": ".*?\\.(spec|test)\\.(jsx?|tsx?)$",
1519
"testResultsProcessor": "jest-junit",
1620
"transform": {
1721
"^.+\\.tsx?$": "ts-jest"

src/Utilities.test.ts

+29-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
1-
import { BreakpointValuesMap } from './BreakpointValue';
2-
import { _map } from './Utilities';
1+
import { PropertyValuesMap } from './BreakpointValue';
2+
import { Theme } from './Theme';
3+
import { _getGutterWidth, _map } from './Utilities';
34

45
describe('Utilities', () => {
6+
describe('_getGutterWidth', () => {
7+
it('Should return 15 if the theme is specified but gutterWidth is undefined', () => {
8+
// arrange
9+
const theme: Theme = {};
10+
11+
// act
12+
const output = _getGutterWidth(theme);
13+
14+
// arrange
15+
expect(output).toEqual(15);
16+
});
17+
18+
it('Should return 20 if the theme is specified and gutter width is set to 40', () => {
19+
// arrange
20+
const theme: Theme = { gutterWidth: 40 };
21+
22+
// act
23+
const output = _getGutterWidth(theme);
24+
25+
// arrange
26+
expect(output).toEqual(20);
27+
});
28+
});
29+
530
describe('_map', () => {
6-
it('Should return a valid map', () => {
31+
it('Should map a PropertyValuesMap to BreakpointValuesMap', () => {
732
// arrange
8-
const input: BreakpointValuesMap = {
33+
const input: PropertyValuesMap = {
934
'number': {
1035
'xs': 540,
1136
'md': 670

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"src/**/*.ts*"
2323
],
2424
"exclude": [
25+
"src/**/*.story.*",
2526
"src/**/*.test.*"
2627
]
2728
}

0 commit comments

Comments
 (0)