Skip to content

Commit fad6b29

Browse files
project setup
0 parents  commit fad6b29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+11213
-0
lines changed

.editorconfig

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

.eslintrc

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"extends": [
3+
"airbnb",
4+
"prettier",
5+
"prettier/react"
6+
],
7+
"plugins": [
8+
"prettier"
9+
],
10+
"parser": "babel-eslint",
11+
"parserOptions": {
12+
"ecmaVersion": 2016,
13+
"sourceType": "module",
14+
"ecmaFeatures": {
15+
"jsx": true
16+
}
17+
},
18+
"env": {
19+
"es6": true,
20+
"browser": true,
21+
"node": true
22+
},
23+
"rules": {
24+
"no-shadow": 0,
25+
"jsx-a11y/interactive-supports-focus": 0,
26+
"no-param-reassign": 0,
27+
"no-plusplus": 0,
28+
"no-underscore-dangle": 0,
29+
"react/prop-types": 0,
30+
"react/forbid-prop-types": 0,
31+
"react/jsx-filename-extension": [
32+
1,
33+
{
34+
"extensions": [
35+
".js",
36+
".jsx"
37+
]
38+
}
39+
]
40+
}
41+
}

.gitignore

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

.prettierrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
tabWidth: 4,
3+
singleQuote: true,
4+
trailingComma: 'all',
5+
};

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.formatOnSave": true
3+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 What the JavaScript
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2+
3+
### `npm run build` fails to minify
4+
5+
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
6+
7+
## Available Scripts
8+
9+
In the project directory, you can run:
10+
11+
### `npm start`
12+
13+
Runs the app in the development mode.<br>
14+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
15+
16+
The page will reload if you make edits.<br>
17+
You will also see any lint errors in the console.
18+
19+
### `npm test`
20+
21+
Launches the test runner in the interactive watch mode.<br>
22+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
23+
24+
### `npm run build`
25+
26+
Builds the app for production to the `build` folder.<br>
27+
It correctly bundles React in production mode and optimizes the build for the best performance.
28+
29+
The build is minified and the filenames include the hashes.<br>
30+
Your app is ready to be deployed!
31+
32+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
33+
34+
### `npm run eject`
35+
36+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
37+
38+
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.
39+
40+
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.
41+
42+
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.
43+
44+
## Learn More
45+
46+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
47+
48+
To learn React, check out the [React documentation](https://reactjs.org/).
49+
50+
### Code Splitting
51+
52+
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
53+
54+
### Analyzing the Bundle Size
55+
56+
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
57+
58+
### Making a Progressive Web App
59+
60+
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
61+
62+
### Advanced Configuration
63+
64+
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
65+
66+
### Deployment
67+
68+
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
69+
70+
### `npm run build` fails to minify
71+
72+
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
73+
74+

package.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "shareit",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"antd": "^3.20.1",
7+
"axios": "^0.19.0",
8+
"classnames": "^2.2.6",
9+
"lodash": "^4.17.11",
10+
"lodash.clonedeep": "^4.5.0",
11+
"react": "^16.4.2",
12+
"react-dom": "^16.4.2",
13+
"react-icons": "^3.7.0",
14+
"react-redux": "^5.0.7",
15+
"react-router-dom": "^5.0.1",
16+
"react-scripts": "1.1.4",
17+
"redux": "^4.0.0",
18+
"redux-saga": "^0.16.0"
19+
},
20+
"homepage": "https://x.com",
21+
"scripts": {
22+
"start": "react-scripts start",
23+
"build": "react-scripts build",
24+
"test": "react-scripts test --env=jsdom",
25+
"predeploy": "npm run build",
26+
"deploy": "gh-pages -d build",
27+
"eject": "react-scripts eject",
28+
"lint": "eslint src"
29+
},
30+
"devDependencies": {
31+
"eslint": "^6.0.1",
32+
"eslint-config-airbnb": "15.0.1",
33+
"eslint-config-prettier": "^6.0.0",
34+
"eslint-plugin-import": "^2.18.0",
35+
"eslint-plugin-jsx-a11y": "5.1.1",
36+
"eslint-plugin-prettier": "^3.1.0",
37+
"eslint-plugin-react": "^7.14.2",
38+
"gh-pages": "^1.2.0",
39+
"prettier": "^1.18.2"
40+
}
41+
}

public/favicon.ico

3.78 KB
Binary file not shown.

public/index.html

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<meta name="theme-color" content="#000000">
8+
<!--
9+
manifest.json provides metadata used when your web app is added to the
10+
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
11+
-->
12+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
13+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
14+
<!--
15+
Notice the use of %PUBLIC_URL% in the tags above.
16+
It will be replaced with the URL of the `public` folder during the build.
17+
Only files inside the `public` folder can be referenced from the HTML.
18+
19+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
20+
work correctly both with client-side routing and a non-root public URL.
21+
Learn how to configure a non-root public URL by running `npm run build`.
22+
-->
23+
24+
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Pacifico" rel="stylesheet">
25+
<title>Share It</title>
26+
</head>
27+
28+
<body>
29+
<noscript>
30+
You need to enable JavaScript to run this app.
31+
</noscript>
32+
<div id="root"></div>
33+
<!--
34+
This HTML file is a template.
35+
If you open it directly in the browser, you will see an empty page.
36+
37+
You can add webfonts, meta tags, or analytics to this file.
38+
The build step will place the bundled scripts into the <body> tag.
39+
40+
To begin the development, run `npm start` or `yarn start`.
41+
To create a production bundle, use `npm run build` or `yarn build`.
42+
-->
43+
</body>
44+
45+
</html>

public/manifest.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
}
10+
],
11+
"start_url": "./index.html",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}

src/App.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React, { Fragment } from 'react';
2+
import { Provider } from 'react-redux';
3+
import { Switch, Route } from 'react-router-dom';
4+
5+
import Header from './components/Header';
6+
import Dashboard from './components/pages/Dashboard';
7+
import LoginPage from './components/pages/login';
8+
import AboutPage from './components/pages/About'
9+
import menu from './mock/menu'
10+
import Auth from './auth';
11+
12+
import configureStore from './store';
13+
14+
const store = configureStore();
15+
16+
function App() {
17+
return (
18+
<Provider store={store}>
19+
<Fragment>
20+
<Header menus={menu} logo={'MYLogo'}/>
21+
<Switch>
22+
<Route path="/dashboard" exact component={Auth(Dashboard,true)}/>
23+
<Route path="/login" exact component={LoginPage}/>
24+
<Route path="/about" exact component={AboutPage}/>
25+
</Switch>
26+
</Fragment>
27+
</Provider>
28+
);
29+
}
30+
31+
export default App;

src/actions/user_actions.js

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { USER } from '../constants';
2+
3+
4+
export const auth = request => ({
5+
type: USER.AUTH,
6+
payload: request
7+
});
8+
9+
export const updateUser = data => ({
10+
type: USER.UPDATEUSER,
11+
payload: data
12+
});
13+
14+
export const loginErr = err => ({
15+
type: USER.UPDATERR,
16+
payload: err
17+
});
18+
19+
export const startLoading = () => ({
20+
type: USER.PAGELOADING,
21+
});
22+
23+
export const startvalidating = () => ({
24+
type: USER.PAGEVALIDATING,
25+
});
26+
27+
export const noGrant = () => ({
28+
type: USER.NOGRANTED,
29+
});
30+
31+
export const callAuth = () => ({
32+
type: USER.SAGA_AUTH,
33+
});
34+
35+
export const submitForm = (val) =>({
36+
type: USER.SAGA_LOGIN,
37+
val,
38+
})

0 commit comments

Comments
 (0)