forked from Hacker0x01/react-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added interactive examples (Hacker0x01#1864)
* feat: added interactive examples * feat: more examples * feat: more examples and enhanced direct links by slugify * feat: some components * feat: migrated components to useState * feat: rework using create-react-app * fix: cleanup * feat: cleanup * fix: lgtm issues
- Loading branch information
1 parent
29ce63f
commit 18def4c
Showing
154 changed files
with
13,527 additions
and
4,536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SKIP_PREFLIGHT_CHECK=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const path = require("path"); | ||
const ModuleScopePlugin = require("react-dev-utils/ModuleScopePlugin"); | ||
|
||
module.exports = function override(config, env) { | ||
//do stuff with the webpack config... | ||
config.module.rules.push({ | ||
test: /\.js/, | ||
include: path.resolve(__dirname, "src/examples"), | ||
use: "raw-loader" | ||
}); | ||
config.resolve.plugins = config.resolve.plugins.filter( | ||
plugin => !(plugin instanceof ModuleScopePlugin) | ||
); | ||
// Enable it, so that our custom .eslintrc for the examples will work | ||
for (let i = 0; i < config.module.rules.length; i++) { | ||
if (Array.isArray(config.module.rules[i].use)) { | ||
for (let j = 0; j < config.module.rules[i].use.length; j++) { | ||
if (config.module.rules[i].use[j].loader.includes("eslint-loader")) { | ||
config.module.rules[i].use[j].options.useEslintrc = true; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
return config; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "react-datepicker-docs", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"react": "^16.9.0", | ||
"react-app-rewired": "^2.1.3", | ||
"react-datepicker": "file:..", | ||
"react-dom": "^16.9.0", | ||
"react-scripts": "3.1.1" | ||
}, | ||
"scripts": { | ||
"start": "react-app-rewired start", | ||
"build": "react-app-rewired build", | ||
"test": "react-app-rewired test", | ||
"eject": "react-scripts eject" | ||
}, | ||
"eslintConfig": { | ||
"extends": "react-app" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
}, | ||
"devDependencies": { | ||
"node-sass": "^4.12.0", | ||
"raw-loader": "^3.1.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta name="description" content="A simple and reusable datepicker component for React."> | ||
<meta name="keywords" content="React, HTML, CSS, JavaScript, JSX, date, datepicker"> | ||
<title>React.js Datepicker crafted by HackerOne</title> | ||
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet"> | ||
</head> | ||
|
||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# https://www.robotstxt.org/robotstxt.html | ||
User-agent: * |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import React, { useState } from "react"; | ||
import ExampleComponents from "../Examples"; | ||
import ribbon from "./ribbon.png"; | ||
import logo from "./logo.png"; | ||
import DatePicker from "react-datepicker"; | ||
|
||
const Root = () => { | ||
const [startDate, setStartDate] = useState(new Date()); | ||
return ( | ||
<div> | ||
<div className="hero"> | ||
<div className="hero__content"> | ||
<h1 className="hero__title">ReactJS Datepicker</h1> | ||
<div className="hero__crafted-by"> | ||
<a href="https://hackerone.com" className="hero__crafted-by-link"> | ||
Crafted by{" "} | ||
<img | ||
src={logo} | ||
ungiu | ||
className="hero__image" | ||
alt="HackerOne" | ||
title="HackerOne" | ||
/> | ||
</a> | ||
</div> | ||
<div className="hero__example"> | ||
<DatePicker | ||
autoFocus | ||
selected={startDate} | ||
onChange={date => setStartDate(date)} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="wrapper"> | ||
<h1>ReactJS Datepicker</h1> | ||
<p className="badges"> | ||
<a href="https://npmjs.org/package/react-datepicker"> | ||
<img | ||
src="https://badge.fury.io/js/react-datepicker.svg" | ||
alt="NPM package version badge" | ||
className="badge" | ||
/> | ||
</a> | ||
<a href="https://travis-ci.org/Hacker0x01/react-datepicker"> | ||
<img | ||
src="https://travis-ci.org/Hacker0x01/react-datepicker.svg?branch=master" | ||
alt="Travis CI status badge" | ||
className="badge" | ||
/> | ||
</a> | ||
<a href="https://david-dm.org/Hacker0x01/react-datepicker"> | ||
<img | ||
src="https://david-dm.org/Hacker0x01/react-datepicker.svg" | ||
alt="Dependency status badge" | ||
className="badge" | ||
/> | ||
</a> | ||
<a href={"https://npmjs.org/package/react-datepicker"}> | ||
<img | ||
src="https://img.shields.io/npm/dm/react-datepicker.svg" | ||
alt="Download count badge" | ||
className="badge" | ||
/> | ||
</a> | ||
</p> | ||
<p>A simple and reusable datepicker component for React.</p> | ||
|
||
<h2>Installation</h2> | ||
<p>The package can be installed via NPM:</p> | ||
<p> | ||
<code>npm install react-datepicker --save</code> | ||
</p> | ||
<p>Or by using Yarn:</p> | ||
<p> | ||
<code>yarn add react-datepicker</code> | ||
</p> | ||
</div> | ||
<div className="wrapper"> | ||
<ExampleComponents /> | ||
</div> | ||
|
||
<a href="https://github.com/Hacker0x01/react-datepicker/"> | ||
<img className="github-ribbon" src={ribbon} alt="Fork me on GitHub" /> | ||
</a> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Root; |
File renamed without changes
File renamed without changes
Oops, something went wrong.