Skip to content

Commit 820940d

Browse files
committed
final pre-work
1 parent 5afd9d1 commit 820940d

File tree

8 files changed

+122
-15
lines changed

8 files changed

+122
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ typings/
4444
# Optional npm cache directory
4545
.npm
4646
.vs
47+
.netlify
4748

4849
# Optional eslint cache
4950
.eslintcache

README.md

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,46 @@
1-
- prepare Readme
2-
- disable style
3-
- run tests & update snapshots
4-
- build package
5-
- deploy package
6-
- build static site
7-
- website deploy script
8-
91
# React Multi Fields Input component
102

113
React Multi Fields Input component comes with zero styles to allow you style it in accordance to your style guidelines.
124

5+
Example:
6+
137
![react-multi-fields-input component](/assets/rmfi-example.png)
148

15-
Props that MultiFieldsInput component accepts:
9+
```js
10+
const inputs = [
11+
{
12+
type: 'number',
13+
maxLength: 2,
14+
placeholder: '00'
15+
},
16+
{
17+
type: 'number',
18+
maxLength: 2,
19+
placeholder: '00'
20+
},
21+
{
22+
type: 'number',
23+
maxLength: 2,
24+
placeholder: '00'
25+
}
26+
];
27+
28+
<MultiFieldsInput
29+
label="Sort Code"
30+
name="codeSort"
31+
inputs={inputs}
32+
value="202020"
33+
isValid={false}
34+
onBlur={() => {}}
35+
onChange={() => {}}
36+
/>;
37+
```
38+
39+
See more live examples on the [website](https://react-multi-fields-input.netlify.com/).
40+
41+
## Props
42+
43+
MultiFieldsInput component accepts the following props:
1644

1745
```js static
1846
{
@@ -38,8 +66,23 @@ Props that MultiFieldsInput component accepts:
3866
}
3967
```
4068

41-
The values that are being returned `onBlur` and `onChange` (i.e. `Target` interface):
69+
The object that is being returned `onBlur` and `onChange`:
4270

4371
```js static
4472
{ name: '', value: ''}
4573
```
74+
75+
## Develop
76+
77+
``
78+
yarn
79+
yarn start
80+
```
81+
82+
Optional: To enable styles in styleguidist, uncomment `.scss` styles import on line 5 in `src/components/index.tsx`.
83+
84+
When done
85+
86+
```
87+
yarn build
88+
```

dist/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"test:watch": "jest --watch",
1414
"sg:serve": "styleguidist server",
1515
"sg:build": "styleguidist build",
16+
"deploy": "netlify deploy",
17+
"deploy:prod": "netlify deploy --prod",
1618
"start": "npm-run-all --parallel dev sg:serve test:watch"
1719
},
1820
"jest": {

src/components/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Props that MultiFieldsInput component accepts:
2626
}
2727
```
2828

29-
The values that are being returned `onBlur` and `onChange` (i.e. `Target` interface):
29+
The object that is being returned `onBlur` and `onChange`:
3030

3131
```js static
3232
{ name: '', value: ''}

src/components/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import * as React from 'react';
22
import { Component } from 'react';
33
import * as classNames from 'classnames';
44
import { Props, Target, DefaultProps } from './interfaces';
5-
6-
import './index.scss';
5+
// import './index.scss';
76

87
class MultiFieldsInput extends Component<Props> {
98
constructor(props: Props) {

styleguide/build/bundle.3ad2d2ba.js

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

styleguide/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>React Multi Fields Input</title></head><body><div id="rsg-root"></div><script src="build/bundle.3ad2d2ba.js"></script></body></html>

0 commit comments

Comments
 (0)