Skip to content

Commit

Permalink
#111 setup and format
Browse files Browse the repository at this point in the history
  • Loading branch information
fdhhhdjd committed Nov 16, 2022
1 parent a1fc8fe commit be3fff3
Show file tree
Hide file tree
Showing 117 changed files with 1,601 additions and 2,199 deletions.
66 changes: 33 additions & 33 deletions frontend/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{
"extends": ["react-app", "prettier"],
"plugins": ["react", "eslint-plugin-prettier", "prettier"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"js": true,
"modules": true
}
},
"rules": {
"prettier/prettier": [
"warn",
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 120,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
]
}
"extends": ["react-app", "react-app/jest", "prettier"],
"plugins": ["react", "eslint-plugin-prettier", "prettier"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"js": true,
"modules": true
}
},
"rules": {
"prettier/prettier": [
"warn",
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 120,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
]
}
}
4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
"start": "react-scripts start",
"build": "set \"GENERATE_SOURCEMAP=false\" && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"lint": "eslint --ext js,jsx src/",
"lint:fix": "eslint --fix --ext js,jsx src/"
},
"eslintConfig": {
"extends": [
Expand Down
17 changes: 7 additions & 10 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import React, { Suspense } from "react";
import { Route, Routes } from "react-router-dom";
import { ToastContainer } from "react-toastify";
import "./App.css";
import RoutesDataUser from "./v1/router/index";
import {
Loading_Pages_Users,
ScrollTop,
} from "./v1/user_ui/imports/General_Global_Import";
import { Header, NotFound } from "./v1/user_ui/imports/Page_Layout_Main_Import";
import React, { Suspense } from 'react';
import { Route, Routes } from 'react-router-dom';
import { ToastContainer } from 'react-toastify';
import './App.css';
import RoutesDataUser from './v1/router/index';
import { Loading_Pages_Users, ScrollTop } from './v1/user_ui/imports/General_Global_Import';
import { Header, NotFound } from './v1/user_ui/imports/Page_Layout_Main_Import';
function App() {
return (
<React.Fragment>
Expand Down
49 changes: 22 additions & 27 deletions frontend/src/index.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
import React from "react";
import ReactDOM from "react-dom";
import "react-phone-number-input/style.css";
import { Provider } from "react-redux";
import { BrowserRouter as Router } from "react-router-dom";
import "react-toastify/dist/ReactToastify.css";
import "react-lazy-load-image-component/src/effects/blur.css";
import "react-lazy-load-image-component/src/effects/opacity.css";
import App from "./App";
import "./index.css";
import reportWebVitals from "./reportWebVitals";
import { DataProviderAdmin } from "./v1/admin_ui/contexts/GlobalStateAdmin";
import store from "./v1/redux/store";
import "./v1/styles/responsive.css";
import { DataProviderUser } from "./v1/user_ui/contexts/GlobalStateUser";
import React from 'react';
import ReactDOM from 'react-dom';
import 'react-lazy-load-image-component/src/effects/blur.css';
import 'react-lazy-load-image-component/src/effects/opacity.css';
import 'react-phone-number-input/style.css';
import { Provider } from 'react-redux';
import { BrowserRouter as Router } from 'react-router-dom';
import 'react-toastify/dist/ReactToastify.css';
import App from './App';
import './index.css';
import reportWebVitals from './reportWebVitals';
import store from './v1/redux/store';
import './v1/styles/responsive.css';
import { DataProviderUser } from './v1/user_ui/contexts/GlobalStateUser';

ReactDOM.render(
<React.StrictMode>
<Provider store={store}>
<DataProviderAdmin>
<DataProviderUser>
<Router>
<App />
</Router>
</DataProviderUser>
</DataProviderAdmin>
</Provider>
</React.StrictMode>,
document.getElementById("root")
<Provider store={store}>
<DataProviderUser>
<Router>
<App />
</Router>
</DataProviderUser>
</Provider>,
document.getElementById('root'),
);

reportWebVitals();
4 changes: 2 additions & 2 deletions frontend/src/reportWebVitals.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const reportWebVitals = onPerfEntry => {
const reportWebVitals = (onPerfEntry) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
});
}
};

Expand Down
14 changes: 0 additions & 14 deletions frontend/src/v1/admin_ui/contexts/GlobalStateAdmin.js

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/v1/configs/Apis/Carousel_Api/Api_Carousel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const API_CAROUSEL = {
//* GET ALL CAROUSEL
GET_ALL_CAROUSEL: "/api/carousel",
GET_ALL_CAROUSEL: '/api/carousel',
};
export default API_CAROUSEL;
10 changes: 5 additions & 5 deletions frontend/src/v1/configs/Apis/Cart_Api/Api_Cart.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const API_CART = {
//* ADD CART
API_ADD_CART: "/api/product/add/cart",
API_ADD_CART: '/api/product/add/cart',

//* INCREMENT CART
API_INCREMENT_CART: "/api/product/increment/cart",
API_INCREMENT_CART: '/api/product/increment/cart',

//* DECREMENT CART
API_DECREMENT_CART: "/api/product/decrement/cart",
API_DECREMENT_CART: '/api/product/decrement/cart',

//* DELETE CART
API_DELETE_CART: "/api/product/del/cart",
API_DELETE_CART: '/api/product/del/cart',

//* Detail CART USER
API_DETAIL_USER_CART: "/api/product/get/cart",
API_DETAIL_USER_CART: '/api/product/get/cart',
};
export default API_CART;
8 changes: 4 additions & 4 deletions frontend/src/v1/configs/Apis/Comment_Api/Api_Comment.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
const API_COMMENT = {
//* CREATE COMMENT
API_CREATE_COMMENT: "/api/review/create",
API_CREATE_COMMENT: '/api/review/create',

//* UPDATE COMMENT
API_UPDATE_COMMENT: "/api/review",
API_UPDATE_COMMENT: '/api/review',

//* DELETE COMMENT
API_DELETE_COMMENT: "/api/review",
API_DELETE_COMMENT: '/api/review',

//* Detail Customer Comment
API_DETAIL_CUSTOMER_COMMENT: "/api/user/info",
API_DETAIL_CUSTOMER_COMMENT: '/api/user/info',
};
export default API_COMMENT;
4 changes: 2 additions & 2 deletions frontend/src/v1/configs/Apis/Feedback_Api/Api_Feedback.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const API_FEED_BACK = {
//* Seen Feedback
API_SEND_FEED_BACK: "/api/feedback/send",
//* Seen Feedback
API_SEND_FEED_BACK: '/api/feedback/send',
};
export default API_FEED_BACK;
12 changes: 6 additions & 6 deletions frontend/src/v1/configs/Apis/Order_Api/Api_Order.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const API_ORDER = {
//* GET HISTORY ORDER
API_GET_HISTORY: "/api/order/history",
//* GET HISTORY ORDER
API_GET_HISTORY: '/api/order/history',

//* DETAIL HISTORY ORDER
API_DETAIL_ORDER: "/api/order",
//* DETAIL HISTORY ORDER
API_DETAIL_ORDER: '/api/order',

//* DELETE FLAG ORDER
API_DEL_ORDER_FLAG: "api/order/delete",
//* DELETE FLAG ORDER
API_DEL_ORDER_FLAG: 'api/order/delete',
};
export default API_ORDER;
12 changes: 6 additions & 6 deletions frontend/src/v1/configs/Apis/Payment_Api/Api_Payment.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
const API_PAYMENT = {
//* TOTAL PAYMENT
API_TOTAL_PAYMENT: "/api/payment/total",
API_TOTAL_PAYMENT: '/api/payment/total',

//* CHECK STOCK PRODUCT
API_CHECK_STOCK_PRODUCT: "/api/payment/check/stock",
API_CHECK_STOCK_PRODUCT: '/api/payment/check/stock',

// * TRANSACTION PAYPAL
API_TRANSACTION_PAYMENT: "/api/payment/paypal",
API_TRANSACTION_PAYMENT: '/api/payment/paypal',

// * TRANSACTION TRIPE
API_TRANSACTION_PAYMENT_STRIPE: "/api/payment/stripe",
API_TRANSACTION_PAYMENT_STRIPE: '/api/payment/stripe',

//* TRANSACTION_PAYMENT_STRIPE_SUCCESS

API_TRANSACTION_PAYMENT_STRIPE_SUCCESS: "/api/payment/stripe/success",
API_TRANSACTION_PAYMENT_STRIPE_SUCCESS: '/api/payment/stripe/success',

//* CHECK TOTAL PAYMENT
API_TOTAL_PAYMENT: "/api/payment/total"
API_TOTAL_PAYMENT: '/api/payment/total',
};
export default API_PAYMENT;
4 changes: 2 additions & 2 deletions frontend/src/v1/configs/Apis/Products_Api/Api_Product.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const API_PRODUCT = {
//* GET ALL PRODUCT
GET_ALL_PRODUCT: "/api/product",
GET_ALL_PRODUCT: '/api/product',

//* GET DETAIL PRODUCT
GET_DETAIL_PRODUCT: "/api/product/detail",
GET_DETAIL_PRODUCT: '/api/product/detail',
};
export default API_PRODUCT;
4 changes: 2 additions & 2 deletions frontend/src/v1/configs/Apis/Upload_Api/Api_Upload.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const API_UPLOAD = {
//* UPLOAD
UPLOAD_IMAGE_CLOUD: "/api/upload",
UPLOAD_IMAGE_CLOUD: '/api/upload',

//* DESTROY
DESTROY_IMAGE_CLOUD: "/api/destroy",
DESTROY_IMAGE_CLOUD: '/api/destroy',
};
export default API_UPLOAD;
24 changes: 12 additions & 12 deletions frontend/src/v1/configs/Apis/User_Api/Api_Users.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
const API_USERS = {
//* Login
LOGIN_EMAIL_PHONE: "/api/user/login",
LOGIN_EMAIL_PHONE: '/api/user/login',

LOGIN_PHONE_OTP: "/api/user/login/mobile",
LOGIN_PHONE_OTP: '/api/user/login/mobile',

LOGIN_GOOGLE: "/api/user/login/google",
LOGIN_GOOGLE: '/api/user/login/google',

LOGIN_FACEBOOK: "/api/user/login/facebook",
LOGIN_FACEBOOK: '/api/user/login/facebook',

//* Register
REGISTER_USERS: "/api/user/register",
REGISTER_USERS: '/api/user/register',

//* Forget Password
FORGET_PASSWORD_USERS: "/api/user/forget",
FORGET_PASSWORD_USERS: '/api/user/forget',

//* Update Profile
UPDATE_PROFILE_USERS: "/api/user/update/profile",
UPDATE_PROFILE_USERS: '/api/user/update/profile',

//* Update Profile
CHANGE_PASSWORD_USERS: "/api/user/change/password",
CHANGE_PASSWORD_USERS: '/api/user/change/password',

//* Reset Password
RESET_PASSWORD_USERS: "/api/user/password/reset",
RESET_PASSWORD_USERS: '/api/user/password/reset',

//* New Accept Token
NEW_ACCESS_TOKEN: "/api/user/new/accessToken",
NEW_ACCESS_TOKEN: '/api/user/new/accessToken',

//* Logout
LOGOUT_USERS: "/api/user/logout",
LOGOUT_USERS: '/api/user/logout',

//* Profile
GET_PROFILE_USER: "/api/user/profile",
GET_PROFILE_USER: '/api/user/profile',
};
export default API_USERS;
4 changes: 2 additions & 2 deletions frontend/src/v1/configs/Apis/Voucher_Api/Api_Voucher.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const API_VOUCHER = {
//* ADD VOUCHER
API_ADD_VOUCHER: "/api/user/voucher",
API_ADD_VOUCHER: '/api/user/voucher',

//* DEL VOUCHER
API_DEL_VOUCHER: "/api/user/voucher/del",
API_DEL_VOUCHER: '/api/user/voucher/del',
};
export default API_VOUCHER;
6 changes: 3 additions & 3 deletions frontend/src/v1/configs/Firebase/Firebase.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";
import CONFIGS from "../../configs/config";
import { initializeApp } from 'firebase/app';
import { getAuth } from 'firebase/auth';
import CONFIGS from '../../configs/config';
const firebaseConfig = {
apiKey: CONFIGS.REACT_APP_API_KEY,
authDomain: CONFIGS.REACT_APP_AUTH_DOMAIN,
Expand Down
Loading

0 comments on commit be3fff3

Please sign in to comment.