Skip to content

Commit a9988da

Browse files
DenkSchuldtGH Pages Bot
and
GH Pages Bot
authored
Adding examples and a new landing (#8)
* Adding examples and a new landing * Update * Package json update * Examples package.json update * Examples package.json update * Updates * Readme update Co-authored-by: GH Pages Bot <hello@ghbot.com>
1 parent b516fc6 commit a9988da

24 files changed

+1222
-41
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66
The date format used is DD/MM/YYYY.
77

88

9+
## [1.0.3] - 04/04/2021
10+
### Fixed
11+
* Removing overriding styles from body
12+
13+
## [1.0.2] - 29/03/2021
914
## [1.0.1] - 29/03/2021
1015
### Fixed
1116
* Accessibility: Close with keyboard (Esc), and showing button outlines.

README.md

+33-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# @denkschuldt/react-dialog
33

4-
> A dialog implementation for react.
4+
> A simple to use and customizable react dialog implementation.
55
66
## Installation
77
```bash
@@ -14,10 +14,8 @@ $ npm install --save @denkschuldt/react-dialog
1414

1515
## Basic usage
1616

17-
See full DEMO at [@DenkSchuldt/react-dialog](https://dennyschuldt.com/react-dialog)
18-
1917
<img
20-
src="./@DenkSchuldt react-dialog.gif"
18+
src="./demo.gif"
2119
alt="Preview"/>
2220

2321
```javascript
@@ -37,22 +35,25 @@ const App = () => {
3735
{
3836
isVisible &&
3937
<Dialog
40-
title='This is the dialog title'
38+
title='Dialog'
39+
onCancelClick={() => {}}
40+
onConfirmClick={() => {}}
4141
onCloseClick={() => setIsVisible(false)}>
4242
<span>
43-
This is the dialog body.
43+
This is the body
4444
</span>
4545
</Dialog>
4646
}
4747
</div>
4848
);
4949
}
5050

51-
ReactDOM.render(<App/>, document.body);
51+
ReactDOM.render(<App/>, document.getElementById('root'));
5252

5353
```
54+
See more examples at [@DenkSchuldt/react-dialog](https://denkschuldt.github.io/react-dialog)
5455

55-
## Properties
56+
## Props
5657

5758
| Name | Type | Required | Description | Default |
5859
|-------------------|----------|--------------------|-------------------------------------------------------|---------|
@@ -74,6 +75,30 @@ ReactDOM.render(<App/>, document.body);
7475
| confirmDisabled | Boolean | | Positive button disabled prop | false |
7576

7677

78+
## Styling
79+
Use the className prop to override dialogs classes:
80+
```scss
81+
.your-css-class {
82+
.dnk-dialog-content {
83+
/* The dialog card */
84+
.dnk-dialog-close {
85+
/* The close button */
86+
}
87+
.dnk-dialog-body {
88+
.dnk-dialog-body-buttons {
89+
/* The buttons div container */
90+
button {
91+
/* cancel button */
92+
&.dnk-btn-primary {
93+
/* confirm button */
94+
}
95+
}
96+
}
97+
}
98+
}
99+
}
100+
```
101+
77102
## Contributing
78103
* Fork the project
79104
* Make changes and include tests
Loading

examples/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
yarn.lock
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*

examples/README.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Getting Started with Create React App
2+
3+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4+
5+
## Available Scripts
6+
7+
In the project directory, you can run:
8+
9+
### `yarn start`
10+
11+
Runs the app in the development mode.\
12+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13+
14+
The page will reload if you make edits.\
15+
You will also see any lint errors in the console.
16+
17+
### `yarn test`
18+
19+
Launches the test runner in the interactive watch mode.\
20+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21+
22+
### `yarn build`
23+
24+
Builds the app for production to the `build` folder.\
25+
It correctly bundles React in production mode and optimizes the build for the best performance.
26+
27+
The build is minified and the filenames include the hashes.\
28+
Your app is ready to be deployed!
29+
30+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31+
32+
### `yarn eject`
33+
34+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35+
36+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37+
38+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39+
40+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41+
42+
## Learn More
43+
44+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45+
46+
To learn React, check out the [React documentation](https://reactjs.org/).
47+
48+
### Code Splitting
49+
50+
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51+
52+
### Analyzing the Bundle Size
53+
54+
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55+
56+
### Making a Progressive Web App
57+
58+
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59+
60+
### Advanced Configuration
61+
62+
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63+
64+
### Deployment
65+
66+
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67+
68+
### `yarn build` fails to minify
69+
70+
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

examples/package.json

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "Examples",
3+
"version": "1.0.0",
4+
"private": false,
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/DenkSchuldt/react-dialog.git"
8+
},
9+
"authors": [
10+
"Denny K. Schuldt (https://github.com/DenkSchuldt)"
11+
],
12+
"license": "MIT",
13+
"bugs": {
14+
"url": "https://github.com/DenkSchuldt/react-dialog/issues"
15+
},
16+
"homepage": "https://denkschuldt.github.io/react-dialog",
17+
"dependencies": {
18+
"@testing-library/jest-dom": "^5.11.4",
19+
"@testing-library/react": "^11.1.0",
20+
"@testing-library/user-event": "^12.1.10",
21+
"react": "^17.0.2",
22+
"react-code-blocks": "0.0.8",
23+
"react-dom": "^17.0.2",
24+
"react-scripts": "4.0.3",
25+
"web-vitals": "^1.0.1"
26+
},
27+
"scripts": {
28+
"start": "react-scripts start",
29+
"build": "react-scripts build",
30+
"test": "react-scripts test",
31+
"eject": "react-scripts eject",
32+
"predeploy": "npm run build",
33+
"deploy": "gh-pages -d build"
34+
},
35+
"eslintConfig": {
36+
"extends": [
37+
"react-app",
38+
"react-app/jest"
39+
]
40+
},
41+
"browserslist": {
42+
"production": [
43+
">0.2%",
44+
"not dead",
45+
"not op_mini all"
46+
],
47+
"development": [
48+
"last 1 chrome version",
49+
"last 1 firefox version",
50+
"last 1 safari version"
51+
]
52+
},
53+
"devDependencies": {
54+
"gh-pages": "^3.1.0"
55+
}
56+
}

0 commit comments

Comments
 (0)