Skip to content

Commit

Permalink
fix npm publish issues and 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bofeiw committed Dec 4, 2020
1 parent 25f3413 commit 2df155e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ yarn add minimum-window-size
```javascript
import React from 'react'

import MinimumWindowSize from "minimum-window-size";
import Index from "minimum-window-size";

const App = () => {
return <MinimumWindowSize width={1200} height={768}>
return <Index width={1200} height={768}>
<YourComponent/>
</MinimumWindowSize>
</Index>
}

export default App
```
Simply import the library and wrap your components. MinimumWindowSize should be the out-most component. `width` and `height` attributes describes the breakpoints at where your component should display. You can omit one or both of the attribute and by default they are set to 0.
Simply import the library and wrap your components. Index should be the out-most component. `width` and `height` attributes describes the breakpoints at where your component should display. You can omit one or both of the attribute and by default they are set to 0.

# Run example locally
```shell script
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/MinimumWindowSize.js → index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// list of dependencies in package.json
import React, {useEffect, useRef, useState} from 'react';

import './MinimumWindowSize.css';
import './index.css';

function MinimumWindowSize({width, height, ...props}) {
function Index({width, height, ...props}) {
const [shouldHide, setShouldHide] = useState(true);
const requiredBox = useRef(null);
const currentBox = useRef(null);
Expand Down Expand Up @@ -60,4 +60,4 @@ function MinimumWindowSize({width, height, ...props}) {
);
}

export default MinimumWindowSize;
export default Index;
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minimum-window-size",
"version": "1.1.0",
"version": "1.1.1",
"description": "Minimum Window Size library is a React library that prevents users with small window size from using your React app and visually hints users to adjust window size.",
"keywords": [
"minimum",
Expand All @@ -16,7 +16,11 @@
"files": [
"src/*",
"README.md",
"package.json"
"package.json",
".babelrc",
".npmignore",
"index.js",
"index.css"
],
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ const path = require('path');

module.exports = {
mode: 'production',
entry: './src/MinimumWindowSize.js',
entry: './index.js',
output: {
path: path.resolve('lib'),
filename: 'MinimumWindowSize.js',
filename: 'index.js',
libraryTarget: 'commonjs2',
},
module: {
rules: [
{
test: /\.js?$/,
include: [
path.resolve(__dirname, "./src")
path.resolve(__dirname)
],
loader: 'babel-loader',
},
{
test: /\.css$/,
include: [
path.resolve(__dirname, "./src")
path.resolve(__dirname)
],
use: [
'style-loader',
Expand Down

0 comments on commit 2df155e

Please sign in to comment.