Skip to content

Commit d735b70

Browse files
authored
Merge pull request #21 from microcmsio/feature/support_typescript
feature added support TypeScript
2 parents 3e981ec + bb1385a commit d735b70

File tree

11 files changed

+4315
-2922
lines changed

11 files changed

+4315
-2922
lines changed

.babelrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_size = 2
8+
indent_style = space
9+
trim_trailing_whitespace = true

.github/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v1
14+
with:
15+
node-version: '12.x'
16+
registry-url: 'https://registry.npmjs.org'
17+
- name: release on npm
18+
run: |
19+
npm ci
20+
npm run build
21+
- run: npm publish
22+
env:
23+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
# useModal
22

3-
[![Build Status](https://travis-ci.org/shibe97/react-hooks-use-modal.svg?branch=master)](https://travis-ci.org/shibe97/react-hooks-use-modal)
4-
53
This is a react hook which can open the modal easily.
64

75
## Usage
86

97
```javascript
108
import React, { useState, useCallback } from 'react';
119
import { render } from 'react-dom';
12-
import useModal from 'react-hooks-use-modal';
10+
import { useModal } from 'react-hooks-use-modal';
1311

1412
const App = () => {
1513
const [Modal, open, close, isOpen] = useModal('root', {
16-
preventScroll: true
14+
preventScroll: true,
1715
});
1816
return (
1917
<div>
@@ -73,7 +71,13 @@ $ npm install
7371
### Build src
7472
7573
```
76-
$ npm run build:src
74+
$ npm run build
75+
```
76+
77+
### Watch src
78+
79+
```
80+
$ npm run watch
7781
```
7882
7983
### Build examples

examples/src/index.js renamed to examples/src/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import React from 'react';
22
import { render } from 'react-dom';
3-
import useModal from '../../dist';
3+
import { useModal } from '../../dist';
44

5-
const modalStyle = {
5+
const modalStyle: React.CSSProperties = {
66
backgroundColor: '#fff',
77
padding: '60px 100px',
8-
borderRadius: '10px'
8+
borderRadius: '10px',
99
};
1010

1111
const App = () => {
1212
const [Modal, open, close, isOpen] = useModal('root', {
13-
preventScroll: true
13+
preventScroll: true,
1414
});
1515
return (
1616
<div>

0 commit comments

Comments
 (0)