Skip to content

Commit f0da950

Browse files
committed
fix demo docs
1 parent 0e16e32 commit f0da950

File tree

9 files changed

+383
-27
lines changed

9 files changed

+383
-27
lines changed

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
demo
1+
docs
22
node_modules
33
.eslintrc.js
44
.gitignore

docs/dist/main.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/index.html

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/* cyrillic-ext */
2+
@font-face {
3+
font-family: 'Open Sans';
4+
font-style: normal;
5+
font-weight: 400;
6+
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFWJ0bf8pkAp6a.woff2) format('woff2');
7+
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
8+
}
9+
/* cyrillic */
10+
@font-face {
11+
font-family: 'Open Sans';
12+
font-style: normal;
13+
font-weight: 400;
14+
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFUZ0bf8pkAp6a.woff2) format('woff2');
15+
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
16+
}
17+
/* greek-ext */
18+
@font-face {
19+
font-family: 'Open Sans';
20+
font-style: normal;
21+
font-weight: 400;
22+
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFWZ0bf8pkAp6a.woff2) format('woff2');
23+
unicode-range: U+1F00-1FFF;
24+
}
25+
/* greek */
26+
@font-face {
27+
font-family: 'Open Sans';
28+
font-style: normal;
29+
font-weight: 400;
30+
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFVp0bf8pkAp6a.woff2) format('woff2');
31+
unicode-range: U+0370-03FF;
32+
}
33+
/* vietnamese */
34+
@font-face {
35+
font-family: 'Open Sans';
36+
font-style: normal;
37+
font-weight: 400;
38+
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFWp0bf8pkAp6a.woff2) format('woff2');
39+
unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB;
40+
}
41+
/* latin-ext */
42+
@font-face {
43+
font-family: 'Open Sans';
44+
font-style: normal;
45+
font-weight: 400;
46+
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFW50bf8pkAp6a.woff2) format('woff2');
47+
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
48+
}
49+
/* latin */
50+
@font-face {
51+
font-family: 'Open Sans';
52+
font-style: normal;
53+
font-weight: 400;
54+
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2) format('woff2');
55+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
56+
}
57+
/* cyrillic-ext */
58+
@font-face {
59+
font-family: 'PT Sans';
60+
font-style: normal;
61+
font-weight: 400;
62+
src: local('PT Sans'), local('PTSans-Regular'), url(https://fonts.gstatic.com/s/ptsans/v9/jizaRExUiTo99u79D0-ExcOPIDUg-g.woff2) format('woff2');
63+
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
64+
}
65+
/* cyrillic */
66+
@font-face {
67+
font-family: 'PT Sans';
68+
font-style: normal;
69+
font-weight: 400;
70+
src: local('PT Sans'), local('PTSans-Regular'), url(https://fonts.gstatic.com/s/ptsans/v9/jizaRExUiTo99u79D0aExcOPIDUg-g.woff2) format('woff2');
71+
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
72+
}
73+
/* latin-ext */
74+
@font-face {
75+
font-family: 'PT Sans';
76+
font-style: normal;
77+
font-weight: 400;
78+
src: local('PT Sans'), local('PTSans-Regular'), url(https://fonts.gstatic.com/s/ptsans/v9/jizaRExUiTo99u79D0yExcOPIDUg-g.woff2) format('woff2');
79+
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
80+
}
81+
/* latin */
82+
@font-face {
83+
font-family: 'PT Sans';
84+
font-style: normal;
85+
font-weight: 400;
86+
src: local('PT Sans'), local('PTSans-Regular'), url(https://fonts.gstatic.com/s/ptsans/v9/jizaRExUiTo99u79D0KExcOPIDU.woff2) format('woff2');
87+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
88+
}
89+
/* cyrillic-ext */
90+
@font-face {
91+
font-family: 'PT Sans';
92+
font-style: normal;
93+
font-weight: 700;
94+
src: local('PT Sans Bold'), local('PTSans-Bold'), url(https://fonts.gstatic.com/s/ptsans/v9/jizfRExUiTo99u79B_mh0OOtLR8a8zILig.woff2) format('woff2');
95+
unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
96+
}
97+
/* cyrillic */
98+
@font-face {
99+
font-family: 'PT Sans';
100+
font-style: normal;
101+
font-weight: 700;
102+
src: local('PT Sans Bold'), local('PTSans-Bold'), url(https://fonts.gstatic.com/s/ptsans/v9/jizfRExUiTo99u79B_mh0OqtLR8a8zILig.woff2) format('woff2');
103+
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
104+
}
105+
/* latin-ext */
106+
@font-face {
107+
font-family: 'PT Sans';
108+
font-style: normal;
109+
font-weight: 700;
110+
src: local('PT Sans Bold'), local('PTSans-Bold'), url(https://fonts.gstatic.com/s/ptsans/v9/jizfRExUiTo99u79B_mh0OCtLR8a8zILig.woff2) format('woff2');
111+
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
112+
}
113+
/* latin */
114+
@font-face {
115+
font-family: 'PT Sans';
116+
font-style: normal;
117+
font-weight: 700;
118+
src: local('PT Sans Bold'), local('PTSans-Bold'), url(https://fonts.gstatic.com/s/ptsans/v9/jizfRExUiTo99u79B_mh0O6tLR8a8zI.woff2) format('woff2');
119+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
120+
}

docs/src/components/Layout/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import styles from './layout.css';
3+
import './fonts.css';
34

45
const Layout = props => {
56
return (

docs/src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,6 @@ class DemoPage extends Component {
137137
}
138138
}
139139

140-
ReactDOM.render(<DemoPage />, document.querySelector("#root"));
140+
const root = document.createElement('div')
141+
document.body.appendChild(root);
142+
ReactDOM.render(<DemoPage />, root);

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"license": "MIT",
2626
"dependencies": {
2727
"autonumeric": "^4.2.7",
28+
"html-webpack-plugin": "^3.0.7",
2829
"prop-types": "^15.6.1"
2930
},
3031
"devDependencies": {
@@ -53,9 +54,10 @@
5354
"build": "yarn build-library && yarn build-demo",
5455
"build-library": "NODE_ENV=production babel ./src --out-dir ./dist",
5556
"build-demo": "webpack -p",
56-
"clear": "rm -rf dist demo/dist",
57-
"dev": "webpack-dev-server --hot",
57+
"clear": "rm -rf dist docs/dist",
58+
"prebuild": "yarn clear",
59+
"dev": "webpack-dev-server --hot --mode 'development'",
5860
"lint": "eslint 'src/**/*.js'",
59-
"prettier": "prettier src/*.js demo/src/*.js --write"
61+
"prettier": "prettier src/*.js docs/src/*.js --write"
6062
}
6163
}

webpack.config.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
const path = require("path");
2+
const HtmlWebpackPlugin = require('html-webpack-plugin')
23

34
module.exports = {
4-
entry: path.resolve("./demo/src/index.js"),
5+
entry: path.resolve("./docs/src/index.js"),
56
output: {
6-
path: path.resolve("./demo/dist"),
7+
path: path.resolve("./docs/dist"),
78
filename: "[name].js"
89
},
910
module: {
@@ -16,7 +17,7 @@ module.exports = {
1617
{
1718
test: /\.css$/,
1819
use: ["style-loader", "css-loader?modules"],
19-
include: path.resolve("./demo")
20+
include: path.resolve("./docs")
2021
},
2122
{
2223
test: /\.css$/,
@@ -31,7 +32,10 @@ module.exports = {
3132
},
3233
devServer: {
3334
publicPath: "/",
34-
contentBase: path.join(__dirname, "demo"),
35+
contentBase: path.join(__dirname, "docs"),
3536
hot: true
36-
}
37+
},
38+
plugins: [new HtmlWebpackPlugin({
39+
title: 'react-date-range',
40+
})],
3741
};

0 commit comments

Comments
 (0)