├── .gitignore
├── README.md
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
└── robots.txt
└── src
├── App.css
├── App.js
├── App.test.js
├── common
├── banner
│ ├── banner.js
│ └── icons.js
└── components
│ ├── textField
│ ├── TextField.js
│ └── index.js
│ └── textFormGroup
│ ├── TextFormGroup.js
│ └── index.js
├── components
├── Anchortag.js
├── Button.js
├── PageHeader.js
├── admin
│ ├── ProfilePage.js
│ ├── settings
│ │ ├── PasswordResetForm.js
│ │ ├── RoleForm.js
│ │ ├── RoleList.js
│ │ ├── UserForm.js
│ │ ├── UserList.js
│ │ └── UserView.js
│ └── shop
│ │ ├── ShopForm.js
│ │ ├── ShopList.js
│ │ └── ShopView.js
├── alerts
│ └── Primary.js
├── auth
│ ├── LoginForm.js
│ ├── PasswordResetForm.js
│ ├── PasswordResetVerifyForm.js
│ └── RegistrationForm.js
├── customer
│ ├── EmployeeForm.js
│ ├── EmployeeList.js
│ ├── EmployeeView.js
│ ├── InvoiceForm.js
│ ├── InvoiceList.js
│ ├── PeoductCategoryList.js
│ ├── ProductCategoryForm.js
│ ├── ProductCategoryView.js
│ ├── ProductForm.js
│ ├── ProductList.js
│ ├── ProductView.js
│ ├── ShopEdit.js
│ └── ShopView.js
├── input
│ ├── InputFormGroup.js
│ ├── InputPassword.js
│ ├── InputPasswordGroup.js
│ ├── InputText.js
│ ├── SelectFormGroup.js
│ ├── SelectInput.js
│ ├── TextArea.js
│ └── TextAreaFormGroup.js
├── navigation
│ ├── HeaderNavbar.js
│ └── NavListTag.js
├── profile
│ ├── PasswordReset.js
│ └── Profile.js
└── table
│ ├── SearchDataTable.js
│ ├── SearchTableActionTd.js
│ ├── SearchTableHead.js
│ ├── Table.js
│ ├── TableHead.js
│ ├── TdTag.js
│ └── ThTag.js
├── index.css
├── index.js
├── logo.svg
├── pages
├── AuthPage.js
├── HomePage.js
├── NotFound.js
├── admin
│ ├── RootPage.js
│ ├── settings
│ │ └── SettingsPage.js
│ └── shop
│ │ └── AdminShopPage.js
└── customer
│ ├── Dashboard.js
│ ├── RootPage.js
│ ├── profile
│ └── ProfileBasePage.js
│ └── shop
│ └── CustomerShopePage.js
├── reportWebVitals.js
├── setupTests.js
└── style
├── admin.css
└── auth.css
/.gitignore:
--------------------------------------------------------------------------------
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 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 |
4 | ## Available URLs
5 | * For admin: `http://localhost:3000/admin/`
6 | * For customer: `http://localhost:3000`
7 | * Login: `http://localhost:3000/login`
8 | * Register: `http://localhost:3000/registration`
9 |
10 | ## Available Scripts
11 |
12 | In the project directory, you can run:
13 |
14 | ### `npm start`
15 |
16 | Runs the app in the development mode.\
17 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
18 |
19 | The page will reload if you make edits.\
20 | You will also see any lint errors in the console.
21 |
22 | ### `npm test`
23 |
24 | Launches the test runner in the interactive watch mode.\
25 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
26 |
27 | ### `npm run build`
28 |
29 | Builds the app for production to the `build` folder.\
30 | It correctly bundles React in production mode and optimizes the build for the best performance.
31 |
32 | The build is minified and the filenames include the hashes.\
33 | Your app is ready to be deployed!
34 |
35 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
36 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "inventory-react-ui",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "@reduxjs/toolkit": "^1.6.2",
7 | "@testing-library/jest-dom": "^5.14.1",
8 | "@testing-library/react": "^11.2.7",
9 | "@testing-library/user-event": "^12.8.3",
10 | "bootstrap": "^4.2.0",
11 | "prop-types": "^15.7.2",
12 | "react": "^17.0.2",
13 | "react-dom": "^17.0.2",
14 | "react-redux": "^7.2.6",
15 | "react-router-dom": "^5.3.0",
16 | "react-scripts": "^1.1.5",
17 | "web-vitals": "^1.1.2"
18 | },
19 | "scripts": {
20 | "start": "react-scripts start",
21 | "build": "react-scripts build",
22 | "test": "react-scripts test",
23 | "eject": "react-scripts eject"
24 | },
25 | "eslintConfig": {
26 | "extends": [
27 | "react-app",
28 | "react-app/jest"
29 | ]
30 | },
31 | "browserslist": {
32 | "production": [
33 | ">0.2%",
34 | "not op_mini all"
35 | ],
36 | "development": [
37 | "last 1 chrome version",
38 | "last 1 firefox version",
39 | "last 1 safari version"
40 | ]
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/farhapartex/inventory-react-ui/3cffa32dddb045b1207174faeb127ed4e9d225b1/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
17 |
18 |
27 | Inventory System
28 |
29 |
30 | You need to enable JavaScript to run this app.
31 |
32 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/farhapartex/inventory-react-ui/3cffa32dddb045b1207174faeb127ed4e9d225b1/public/logo192.png
--------------------------------------------------------------------------------
/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/farhapartex/inventory-react-ui/3cffa32dddb045b1207174faeb127ed4e9d225b1/public/logo512.png
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
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 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/src/App.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/farhapartex/inventory-react-ui/3cffa32dddb045b1207174faeb127ed4e9d225b1/src/App.css
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | import './App.css';
2 | import React, {useState} from "react";
3 | import { BrowserRouter as Router, Route, Switch, Redirect } from "react-router-dom"
4 | import HomePage from "./pages/HomePage";
5 | import NotFoundPage from "./pages/NotFound";
6 | import AuthPage from "./pages/AuthPage";
7 | import RootPage from "./pages/admin/RootPage";
8 | import CustomerRootPage from "./pages/customer/RootPage";
9 |
10 |
11 | function App() {
12 | return (
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | {/* Admin Routers */}
25 |
26 |
27 |
28 |
29 |
30 | );
31 | }
32 |
33 | export default App;
34 |
--------------------------------------------------------------------------------
/src/App.test.js:
--------------------------------------------------------------------------------
1 | import { render, screen } from '@testing-library/react';
2 | import App from './App';
3 |
4 | test('renders learn react link', () => {
5 | render( );
6 | const linkElement = screen.getByText(/learn react/i);
7 | expect(linkElement).toBeInTheDocument();
8 | });
9 |
--------------------------------------------------------------------------------
/src/common/banner/banner.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import PropTypes from "prop-types";
3 | import { ErrorSvg, WarringSvg, InfoSvg, SuccessSvg, ExitSvg } from "./icons";
4 |
5 | class Banner extends Component{
6 | static propTypes = {
7 | type: PropTypes.oneOf(["error", "warning", "info", "success"]).isRequired,
8 | onClose: PropTypes.func,
9 | icon: PropTypes.node,
10 | message: PropTypes.string
11 | };
12 |
13 | static defaultProps = {
14 | onClose: () => {},
15 | icon: null,
16 | message: ""
17 | };
18 |
19 | types = {
20 | "error": {icon: , exitButton: , className: "alert alert-danger"},
21 | "warning": {icon: , exitButton: , className: "alert alert-warning"},
22 | "info": {icon: , exitButton: , className: "alert alert-info"},
23 | "success": {icon: , exitButton: , className: "alert alert-success"},
24 | }
25 |
26 |
27 |
28 | render(){
29 | const { type, onClose, icon, message } = this.props;
30 | const banner = this.types[type];
31 |
32 | return (
33 |
34 | {message}
35 |
36 | ×
37 |
38 |
39 | )
40 | }
41 | }
42 |
43 | export default Banner;
--------------------------------------------------------------------------------
/src/common/banner/icons.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import PropTypes from "prop-types";
3 |
4 | export const ErrorSvg = () => {
5 | return (
6 |
7 |
8 |
9 | )
10 | };
11 |
12 | export const WarringSvg = ({ display = 'block', width = 22, height = 23 }) => {
13 | return (
14 |
15 |
16 |
17 | )
18 | };
19 |
20 | export const InfoSvg = () => {
21 | return (
22 |
23 |
24 |
25 | )
26 | }
27 |
28 | export const SuccessSvg = () => {
29 | return (
30 |
31 |
32 |
33 | )
34 | }
35 |
36 | export const ExitSvg = (props) => {
37 | const { color } = props;
38 | return (
39 |
40 |
41 |
42 | )
43 | }
44 |
45 | ExitSvg.propTypes = {
46 | color: PropTypes.string.isRequired
47 | }
48 |
49 |
50 | export default ErrorSvg
51 |
--------------------------------------------------------------------------------
/src/common/components/textField/TextField.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import PropTypes from "prop-types";
3 |
4 |
5 | class TextField extends Component{
6 | static propType = {
7 | inputType: PropTypes.string,
8 | id: PropTypes.string,
9 | className : PropTypes.string,
10 | placeholder: PropTypes.string,
11 | value: PropTypes.string,
12 | onChange: PropTypes.func
13 | }
14 |
15 | static defaultProps = {
16 | inputType: "text",
17 | id: "",
18 | className: "form-control",
19 | placeholder: "",
20 | value: "",
21 | onChange: () => {}
22 | }
23 |
24 |
25 | render(){
26 | const {inputType, id, className, placeholder, value, onChange} = this.props;
27 |
28 | return
29 | }
30 | }
31 |
32 | export default TextField;
--------------------------------------------------------------------------------
/src/common/components/textField/index.js:
--------------------------------------------------------------------------------
1 | import TextField from "./TextField";
2 |
3 | export default TextField;
--------------------------------------------------------------------------------
/src/common/components/textFormGroup/TextFormGroup.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import PropTypes from "prop-types";
3 | import TextField from "../textField";
4 |
5 |
6 | class TextFormGroup extends Component{
7 | static propType = {
8 | inputType: PropTypes.string,
9 | id: PropTypes.string,
10 | inputClassName : PropTypes.string,
11 | placeholder: PropTypes.string,
12 | value: PropTypes.string,
13 | onChange: PropTypes.func,
14 | label: PropTypes.string,
15 | labelClassName: PropTypes.string
16 | }
17 |
18 | static defaultProps = {
19 | inputType: "text",
20 | id: "",
21 | inputClassName: "form-control",
22 | placeholder: "",
23 | value: "",
24 | onChange: () => {},
25 | label: "",
26 | labelClassName: ""
27 | }
28 |
29 | render(){
30 | const {inputType, id, inputClassName, placeholder, value, onChange, label, labelClassName} = this.props;
31 |
32 | return (
33 |
34 | {label && {label} }
35 |
36 |
37 | )
38 | }
39 | }
40 |
41 | export default TextFormGroup;
--------------------------------------------------------------------------------
/src/common/components/textFormGroup/index.js:
--------------------------------------------------------------------------------
1 | import TextFormGroup from "./TextFormGroup";
2 |
3 | export default TextFormGroup;
--------------------------------------------------------------------------------
/src/components/Anchortag.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Link } from "react-router-dom";
3 |
4 |
5 | class AnchorTag extends Component{
6 | constructor(props){
7 | super(props);
8 | }
9 |
10 | render(){
11 | return (
12 | {this.props.itemValue}
13 | )
14 |
15 | }
16 | }
17 |
18 | export default AnchorTag;
--------------------------------------------------------------------------------
/src/components/Button.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 |
3 |
4 | class Button extends Component{
5 | constructor(props){
6 | super(props);
7 | }
8 |
9 |
10 | render(){
11 | return {this.props.text}
12 | }
13 | }
14 |
15 |
16 | Button.defaultProps = {
17 | dataToggle: "",
18 | dataTarget: ""
19 | }
20 |
21 | export default Button;
--------------------------------------------------------------------------------
/src/components/PageHeader.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 |
3 |
4 | class PageHeader extends Component{
5 | constructor(props){
6 | super(props);
7 | }
8 |
9 |
10 | render(){
11 | return (
12 |
13 |
{this.props.headerText}
14 |
15 | )
16 | }
17 | }
18 |
19 | export default PageHeader;
--------------------------------------------------------------------------------
/src/components/admin/ProfilePage.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import "../../style/admin.css";
3 |
4 |
5 | class ProfilePage extends Component{
6 | constructor(props){
7 | super(props);
8 | }
9 |
10 |
11 | render(){
12 | return (
13 |
14 |
15 |
Personal Profile
16 |
17 |
67 |
68 |
69 | )
70 | }
71 | }
72 |
73 | export default ProfilePage;
--------------------------------------------------------------------------------
/src/components/admin/settings/PasswordResetForm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import "../../../style/admin.css";
3 |
4 |
5 | class PasswordResetForm extends Component{
6 | constructor(props){
7 | super(props);
8 | }
9 |
10 |
11 | render(){
12 | return (
13 |
14 |
15 |
Password Reset
16 |
17 |
50 |
51 |
52 | )
53 | }
54 | }
55 |
56 | export default PasswordResetForm;
--------------------------------------------------------------------------------
/src/components/admin/settings/RoleForm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import "../../../style/admin.css";
3 | import AnchorTag from "../../../components/Anchortag";
4 |
5 |
6 | class RoleForm extends Component{
7 | constructor(props){
8 | super(props);
9 | }
10 |
11 |
12 | render(){
13 | return (
14 |
15 |
16 |
17 |
Create Role
18 |
19 |
107 |
108 |
109 | )
110 | }
111 | }
112 |
113 | export default RoleForm;
--------------------------------------------------------------------------------
/src/components/admin/settings/RoleList.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import "../../../style/admin.css";
3 | import AnchorTag from "../../../components/Anchortag";
4 | import Table from "../../../components/table/Table";
5 |
6 |
7 | class RoleList extends Component{
8 | constructor(props){
9 | super(props);
10 | this.columnList = ["ID", "Name", "Permissions", "Assign User", "Status", "Action"];
11 | this.tableData = [
12 | {"id": 1, "role": "Super Admin", "permissions": 105, "users": 10, "status": "Active"},
13 | {"id": 2, "role": "Moderator", "permissions": 25, "users": 60, "status": "Active"},
14 | {"id": 3, "role": "Editor", "permissions": 15, "users": 6, "status": "Active"}
15 | ]
16 | }
17 |
18 |
19 | render(){
20 | return (
21 |
22 |
23 |
24 |
Role Management
25 |
26 |
27 |
28 | )
29 | }
30 | }
31 |
32 | export default RoleList;
--------------------------------------------------------------------------------
/src/components/admin/settings/UserForm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import "../../../style/admin.css";
3 | import AnchorTag from "../../../components/Anchortag";
4 |
5 |
6 | class UserForm extends Component{
7 | constructor(props){
8 | super(props);
9 | }
10 |
11 |
12 | render(){
13 | return (
14 |
15 |
16 |
17 |
Create User
18 |
19 |
64 |
65 |
66 | )
67 | }
68 | }
69 |
70 | export default UserForm;
--------------------------------------------------------------------------------
/src/components/admin/settings/UserList.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import "../../../style/admin.css";
3 | import AnchorTag from "../../../components/Anchortag";
4 | import Table from "../../../components/table/Table";
5 |
6 |
7 | class UserList extends Component{
8 | constructor(props){
9 | super(props);
10 | this.columnList = ["ID", "Name", "Email", "Role", "Status", "Action"];
11 | this.tableData = [
12 | {"id": 1, "name": "Md Nazmul Hasan", "email": "hasan08sust@gmail.com", "role": "Super Admin", "status": "Active"},
13 | {"id": 2, "name": "Farzana Yesmin", "email": "farzana.26@gmail.com", "role": "Admin", "status": "Active"},
14 | {"id": 3, "name": "Irfan Ahmed Nabil", "email": "nabil.irfan91@gmail.com", "role": "Editor", "status": "Active"},
15 | ]
16 | }
17 |
18 |
19 | render(){
20 | return (
21 |
22 |
23 |
24 |
System User
25 |
26 |
27 |
28 | )
29 | }
30 | }
31 |
32 | export default UserList;
--------------------------------------------------------------------------------
/src/components/admin/settings/UserView.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import "../../../style/admin.css";
3 | import AnchorTag from "../../../components/Anchortag";
4 |
5 |
6 | class UserView extends Component{
7 | constructor(props){
8 | super(props);
9 | }
10 |
11 |
12 | render(){
13 | return (
14 |
15 |
16 |
17 |
User Details
18 |
19 |
70 |
71 |
72 | )
73 | }
74 | }
75 |
76 | export default UserView;
--------------------------------------------------------------------------------
/src/components/admin/shop/ShopForm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Link } from "react-router-dom";
3 | import "../../../style/admin.css";
4 | import AnchorTag from "../../../components/Anchortag";
5 |
6 |
7 | class ShopForm extends Component{
8 | constructor(props){
9 | super(props);
10 | }
11 |
12 |
13 | render(){
14 | return (
15 |
16 |
17 |
18 |
Create Shop
19 |
20 |
66 |
67 |
68 | )
69 | }
70 | }
71 |
72 | export default ShopForm;
--------------------------------------------------------------------------------
/src/components/admin/shop/ShopList.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import "../../../style/admin.css";
3 | import AnchorTag from "../../../components/Anchortag";
4 | import Table from "../../../components/table/Table";
5 |
6 |
7 | class ShopList extends Component{
8 | constructor(props){
9 | super(props);
10 | this.columnList = ["ID", "Name", "Owner", "Employee", "Status", "Action"];
11 | this.tableData = [
12 | {"id": 1, "name": "Sixads Cor.", "owner": "hasan08sust@gmail.com", "employee": "50", "status": "Active"},
13 | {"id": 2, "name": "Digital IT", "owner": "farzana.26@gmail.com", "employee": "0", "status": "Active"},
14 | ]
15 | }
16 |
17 |
18 | render(){
19 | return (
20 |
27 | )
28 | }
29 | }
30 |
31 | export default ShopList;
--------------------------------------------------------------------------------
/src/components/admin/shop/ShopView.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import "../../../style/admin.css";
3 | import AnchorTag from "../../../components/Anchortag";
4 |
5 |
6 | class ShopView extends Component{
7 | constructor(props){
8 | super(props);
9 | }
10 |
11 |
12 | render(){
13 | return (
14 |
15 |
16 |
17 |
Shop Details
18 |
19 |
90 |
91 |
92 | )
93 | }
94 | }
95 |
96 | export default ShopView;
--------------------------------------------------------------------------------
/src/components/alerts/Primary.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 |
3 |
4 | class PrimaryAlert extends Component{
5 | constructor(props){
6 | super(props);
7 |
8 | }
9 |
10 | render(){
11 | return (
12 | {this.props.alertMessage}
13 | )
14 | }
15 | }
16 |
17 | export default PrimaryAlert;
--------------------------------------------------------------------------------
/src/components/auth/LoginForm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Link } from "react-router-dom";
3 |
4 |
5 | class LoginForm extends Component{
6 |
7 | render(){
8 | return (
9 |
33 | )
34 | }
35 | }
36 |
37 | export default LoginForm;
--------------------------------------------------------------------------------
/src/components/auth/PasswordResetForm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Link } from "react-router-dom";
3 |
4 |
5 | class PasswordResetForm extends Component{
6 |
7 | render(){
8 | return (
9 |
30 | )
31 | }
32 | }
33 |
34 | export default PasswordResetForm;
--------------------------------------------------------------------------------
/src/components/auth/PasswordResetVerifyForm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Link } from "react-router-dom";
3 |
4 |
5 | class PasswordResetVerifyForm extends Component{
6 |
7 | render(){
8 | return (
9 |
26 | )
27 | }
28 | }
29 |
30 | export default PasswordResetVerifyForm;
--------------------------------------------------------------------------------
/src/components/auth/RegistrationForm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Link } from "react-router-dom";
3 |
4 |
5 | class RegistrationForm extends Component{
6 |
7 | render(){
8 | return (
9 |
42 | )
43 | }
44 | }
45 |
46 | export default RegistrationForm;
--------------------------------------------------------------------------------
/src/components/customer/EmployeeForm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 | import InputFormGroup from "../input/InputFormGroup";
4 | import SelectFormGroup from "../input/SelectFormGroup";
5 |
6 |
7 | class EmployeeForm extends Component{
8 | constructor(props){
9 | super(props);
10 | this.role = [
11 | {
12 | "id": 1,
13 | "name": "Sales"
14 | },
15 | {
16 | "id": 2,
17 | "name": "Editor"
18 | }
19 | ]
20 | }
21 |
22 |
23 | render(){
24 | return (
25 |
26 |
27 |
28 |
Create Employee
29 |
30 |
59 |
60 |
61 | )
62 | }
63 | }
64 |
65 | export default EmployeeForm;
--------------------------------------------------------------------------------
/src/components/customer/EmployeeList.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 | import InputFormGroup from "../../components/input/InputFormGroup";
4 | import SelectFormGroup from "../../components/input/SelectFormGroup";
5 | import Table from "../../components/table/Table";
6 |
7 |
8 | class EmployeeList extends Component{
9 | constructor(props){
10 | super(props);
11 | this.columnList = ["ID", "Name", "Email", "Role", "Status", "Joined At", "Action"];
12 | this.tableData = [
13 | {"id": 1, "name": "Farhan Chowdhury", "email": "farhan.chowdhury@gmail.com", "role": "Sales", "status": "Active", "joined_at": "20th August, 2021"},
14 | {"id": 2, "name": "David Moree", "email": "david.moree.987@gmail.com", "role": "Sales", "status": "Active", "joined_at": "30th August, 2021"},
15 | ]
16 |
17 | this.roleData = [
18 | {"id": 1, "name": "Admin"},
19 | {"id": 2, "name": "Sales"},
20 | {"id": 3, "name": "Editor"}
21 | ]
22 | }
23 |
24 |
25 | render(){
26 | return (
27 |
28 |
29 |
30 |
Employee List
31 |
32 |
33 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
51 |
52 |
53 |
54 | )
55 | }
56 | }
57 |
58 | export default EmployeeList;
--------------------------------------------------------------------------------
/src/components/customer/EmployeeView.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 |
4 |
5 | class EmployeeView extends Component{
6 | constructor(props){
7 | super(props);
8 | this.productDetails = "PERFECT GIFT IDEA: Works on wet, tion and is not a product defect."
9 | }
10 |
11 |
12 | render(){
13 | return (
14 |
15 |
16 |
Employee Details
17 |
18 |
69 |
70 |
71 | )
72 | }
73 | }
74 |
75 | export default EmployeeView;
--------------------------------------------------------------------------------
/src/components/customer/InvoiceForm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 | import Button from "../Button";
4 | import InputFormGroup from "../input/InputFormGroup";
5 | import SelectFormGroup from "../input/SelectFormGroup";
6 | import SearchDataTable from "../table/SearchDataTable";
7 | import Table from "../table/Table";
8 |
9 |
10 | class InvoiceForm extends Component{
11 | constructor(props){
12 | super(props);
13 | this.productCategory = [
14 | {
15 | "id": 1,
16 | "name": "Computer Accessories"
17 | },
18 | {
19 | "id": 2,
20 | "name": "Kitchen & Dining"
21 | },
22 | {
23 | "id": 2,
24 | "name": "Watch & Sunglasses"
25 | }
26 | ]
27 | this.columnList = ["ID", "Name", "Stock", "Price", "Action"];
28 | this.tableData = [
29 | {"id": 1, "name": "USB 2.0 to Sata 7+15 Pin 2.5 Converter ..", "stock": 20, "price": "238.00"},
30 | {"id": 2, "name": "FANTECH VX7 CRYPTO GAMING MOUSE ..", "stock": 20, "price": "980.00"},
31 | {"id": 3, "name": "Cake decoration turntable - 28cm and 3 pieces set ..", "stock": 20, "price": "305.00"},
32 | {"id": 4, "name": "Stylish White Sunglasses ..", "stock": 20, "price": "139.00"},
33 | ]
34 |
35 | this.invoiceColumnList = ["ID", "Name", "Quantity", "Price", "Sub total"];
36 | this.invoiceTableData = [
37 | {"id": 1, "name": "USB 2.0 to Sata 7+15 Pin 2.5 Converter ..", "quantity": 1, "price": "238.00", "subtotal": 2000},
38 | {"id": 2, "name": "FANTECH VX7 CRYPTO GAMING MOUSE ..", "quantity": 2, "price": "980.00", "subtotal": 2000},
39 | {"id": 3, "name": "Cake decoration turntable - 28cm and 3 pieces set ..", "quantity": 1, "price": "305.00", "subtotal": 2000},
40 | {"id": 4, "name": "Stylish White Sunglasses ..", "quantity": 4, "price": "139.00", "subtotal": 2000},
41 | ]
42 | }
43 |
44 |
45 | render(){
46 | return (
47 |
48 |
49 |
50 |
Create Invoice
51 |
52 |
53 |
54 |
55 |
60 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | Total
72 | 25785.00
73 |
74 |
75 |
76 |
77 |
78 | {/* Modal */}
79 |
80 |
81 |
82 |
83 |
Search & Add Product
84 |
85 | ×
86 |
87 |
88 |
89 |
90 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | )
119 | }
120 | }
121 |
122 | export default InvoiceForm;
--------------------------------------------------------------------------------
/src/components/customer/InvoiceList.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 | import Table from "../../components/table/Table";
4 | import InputFormGroup from "../input/InputFormGroup";
5 |
6 |
7 | class InvoiceList extends Component{
8 | constructor(props){
9 | super(props);
10 | this.columnList = ["ID", "Customer", "Invoice ID", "Total", "Paid", "Date", "Action"];
11 | this.tableData = [
12 | {"id": 1, "customer": "Md Nazmul Hasan", "invoice_id": "201256", "total": "238.00", "is_paid": "Yes", "date": "20th July, 2021"},
13 | {"id": 2, "customer": "Farzana Yesmin", "invoice_id": "201256", "total": "980.00", "is_paid": "Yes", "date": "8th July, 2021"},
14 | {"id": 3, "customer": "Amit Shah", "invoice_id": "201256", "total": "305.00", "is_paid": "Yes", "date": "11th May, 2021"},
15 | {"id": 4, "customer": "Md Farhan Kabir", "invoice_id": "201256", "total": "139.00", "is_paid": "No", "date": "1st April, 2021"},
16 | ]
17 | }
18 |
19 |
20 | render(){
21 | return (
22 |
23 |
24 |
25 |
Invoice List
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
42 |
43 |
44 |
45 | )
46 | }
47 | }
48 |
49 | export default InvoiceList;
--------------------------------------------------------------------------------
/src/components/customer/PeoductCategoryList.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 | import Table from "../../components/table/Table";
4 |
5 |
6 | class ProductCategoryList extends Component{
7 | constructor(props){
8 | super(props);
9 | this.columnList = ["ID", "Name", "Total Product", "Action"];
10 | this.tableData = [
11 | {"id": 1, "name": "Electronic Accessories", "total_products": "12"},
12 | {"id": 2, "name": "Clothing", "total_products": "30"},
13 | {"id": 3, "name": "Health & Beauty", "total_products": "30"},
14 | {"id": 4, "name": "Home & Lifestyle", "total_products": "30"}
15 | ]
16 | }
17 |
18 |
19 | render(){
20 | return (
21 |
22 |
23 |
24 |
Product Category List
25 |
26 |
27 |
28 | )
29 | }
30 | }
31 |
32 | export default ProductCategoryList;
--------------------------------------------------------------------------------
/src/components/customer/ProductCategoryForm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 |
4 |
5 | class ProductCategoryForm extends Component{
6 | constructor(props){
7 | super(props);
8 | }
9 |
10 |
11 | render(){
12 | return (
13 |
14 |
15 |
16 |
Create Product Category
17 |
18 |
40 |
41 |
42 | )
43 | }
44 | }
45 |
46 | export default ProductCategoryForm;
--------------------------------------------------------------------------------
/src/components/customer/ProductCategoryView.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 |
4 |
5 | class ProductCategoryView extends Component{
6 | constructor(props){
7 | super(props);
8 | }
9 |
10 |
11 | render(){
12 | return (
13 |
14 |
15 |
Product Category Details
16 |
17 |
50 |
51 |
52 | )
53 | }
54 | }
55 |
56 | export default ProductCategoryView;
--------------------------------------------------------------------------------
/src/components/customer/ProductForm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 | import InputFormGroup from "../input/InputFormGroup";
4 | import TextAreaFormGroup from "../input/TextAreaFormGroup";
5 | import SelectFormGroup from "../input/SelectFormGroup";
6 |
7 |
8 | class ProductForm extends Component{
9 | constructor(props){
10 | super(props);
11 | this.productCategory = [
12 | {
13 | "id": 1,
14 | "name": "Computer Accessories"
15 | },
16 | {
17 | "id": 2,
18 | "name": "Kitchen & Dining"
19 | },
20 | {
21 | "id": 2,
22 | "name": "Watch & Sunglasses"
23 | }
24 | ]
25 | }
26 |
27 |
28 | render(){
29 | return (
30 |
31 |
32 |
33 |
Create Product
34 |
35 |
77 |
78 |
79 | )
80 | }
81 | }
82 |
83 | export default ProductForm;
--------------------------------------------------------------------------------
/src/components/customer/ProductList.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 | import Table from "../../components/table/Table";
4 | import InputFormGroup from "../../components/input/InputFormGroup";
5 | import SelectFormGroup from "../../components/input/SelectFormGroup";
6 |
7 |
8 | class ProductList extends Component{
9 | constructor(props){
10 | super(props);
11 | this.columnList = ["ID", "Name", "Category", "Price", "Stock Amount", "Action"];
12 | this.tableData = [
13 | {"id": 1, "name": "USB 2.0 to Sata 7+15 Pin 2.5 Converter ..", "category": "Computer Accessories", "price": "238.00", "stock": 20},
14 | {"id": 2, "name": "FANTECH VX7 CRYPTO GAMING MOUSE ..", "category": "Computer & Laptop", "price": "980.00", "stock": 34},
15 | {"id": 3, "name": "Cake decoration turntable - 28cm and 3 pieces set ..", "category": "Kitchen & Dining", "price": "305.00", "stock": 14},
16 | {"id": 4, "name": "Stylish White Sunglasses ..", "category": "Watch & Sunglasses", "price": "139.00", "stock": 40},
17 | ]
18 |
19 | this.selectData = [
20 | {"id": 1, "name": "Electronic Accessories"},
21 | {"id": 2, "name": "Health & Beauty"},
22 | {"id": 3, "name": "Home & Lifestyle"}
23 | ]
24 | }
25 |
26 |
27 | render(){
28 | return (
29 |
30 |
31 |
32 |
Product List
33 |
34 |
35 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
52 |
53 |
54 |
55 | )
56 | }
57 | }
58 |
59 | export default ProductList;
--------------------------------------------------------------------------------
/src/components/customer/ProductView.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 |
4 |
5 | class ProductView extends Component{
6 | constructor(props){
7 | super(props);
8 | this.productDetails = "PERFECT GIFT IDEA: Works on wet, dry, Long, short, thick, curly, and straight hair. Perfect gift for Valentines Day, Mother's Day, Thanksgiving, Christmas, Anniversary and Birthday to your girlfriend, wife, mom, sister and friends. NOTE: Paddle brush is designed to have one missing pin on the bottom of the cushion. This is to help with air circulation and is not a product defect."
9 | }
10 |
11 |
12 | render(){
13 | return (
14 |
15 |
16 |
Product Details
17 |
18 |
75 |
76 |
77 | )
78 | }
79 | }
80 |
81 | export default ProductView;
--------------------------------------------------------------------------------
/src/components/customer/ShopEdit.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 | import InputFormGroup from "../input/InputFormGroup";
4 | import PrimaryAlert from "../alerts/Primary";
5 | import TextFormGroup from "../../common/components/textFormGroup";
6 | import Banner from "../../common/banner/banner";
7 |
8 |
9 | class ShopEdit extends Component{
10 | constructor(props){
11 | super(props);
12 | this.state = {
13 | showSuccessMsg: false,
14 | showErrorMsg: true,
15 | shopName: "",
16 | errorMessage: "",
17 | successMessage: ""
18 | }
19 |
20 | }
21 |
22 |
23 |
24 | handleShopUpdate = () => {
25 | this.setState({successMessage: "Shop info updated!"})
26 | this.setState({showSuccessMsg: true})
27 | }
28 |
29 | handleOnChange = (e) => {
30 | this.setState({shopName: e.target.value});
31 | }
32 |
33 | SuccessBanner = () => {
34 | return (
35 | this.setState({showSuccessMsg: false})}/>
36 |
)
37 | }
38 | ErrorBanner = () => {
39 | return (
40 | this.setState({showErrorMsg: false})}/>
41 | );
42 |
43 | }
44 |
45 |
46 | render(){
47 | return (
48 |
49 |
50 |
Shop Details
51 |
52 |
53 |
54 |
55 | { this.state.showSuccessMsg &&
}
56 |
57 |
58 |
Shop Information
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
this.handleShopUpdate()}/>
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | )
76 | }
77 | }
78 |
79 | export default ShopEdit;
--------------------------------------------------------------------------------
/src/components/customer/ShopView.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../../components/Anchortag";
3 | import InputFormGroup from "../input/InputFormGroup";
4 |
5 |
6 | class ShopView extends Component{
7 | constructor(props){
8 | super(props);
9 | }
10 |
11 |
12 | render(){
13 | return (
14 |
15 |
16 |
Shop Details
17 |
18 |
19 |
20 |
21 |
22 |
23 |
Shop Owner Information
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
Shop Information
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | )
69 | }
70 | }
71 |
72 | export default ShopView;
--------------------------------------------------------------------------------
/src/components/input/InputFormGroup.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import InputText from "./InputText";
3 |
4 |
5 | class InputFormGroup extends Component{
6 | constructor(props){
7 | super(props);
8 | }
9 |
10 | renderLabel(){
11 | if(this.props.label == "" || this.props.label == null){
12 | return ""
13 | }
14 | else{
15 | return {this.props.label}
16 | }
17 |
18 | }
19 |
20 | renderInputText(){
21 | if(this.props.isReadOnly == true){
22 | return
23 | }
24 | else{
25 | return
26 | }
27 | }
28 |
29 |
30 | render(){
31 | return (
32 |
33 | {this.renderLabel()}
34 | {this.renderInputText()}
35 |
36 |
37 | )
38 | }
39 | }
40 |
41 | InputFormGroup.defaultProps = {
42 | inputClassName: "form-control",
43 | placeholder: "",
44 | label: "",
45 | value: "",
46 | isReadOnly: false
47 | }
48 |
49 | export default InputFormGroup;
--------------------------------------------------------------------------------
/src/components/input/InputPassword.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 |
3 |
4 | class InputPassword extends Component{
5 | constructor(props){
6 | super(props);
7 | }
8 |
9 |
10 | render(){
11 | return
12 | }
13 | }
14 |
15 | InputPassword.defaultProps = {
16 | placeholder: ""
17 | }
18 |
19 | export default InputPassword;
--------------------------------------------------------------------------------
/src/components/input/InputPasswordGroup.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import InputPassword from "./InputPassword";
3 |
4 |
5 | class InputPasswordGroup extends Component{
6 | constructor(props){
7 | super(props);
8 | }
9 |
10 |
11 | render(){
12 | return (
13 |
14 | {this.props.label}
15 |
16 |
17 | )
18 | }
19 | }
20 |
21 | InputPasswordGroup.defaultProps = {
22 | inputClassName: "form-control",
23 | placeholder: "",
24 | label: ""
25 | }
26 |
27 |
28 | export default InputPasswordGroup;
--------------------------------------------------------------------------------
/src/components/input/InputText.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 |
3 |
4 | class InputText extends Component{
5 | constructor(props){
6 | super(props);
7 | }
8 |
9 |
10 | render(){
11 | return
12 | }
13 | }
14 |
15 | export default InputText;
--------------------------------------------------------------------------------
/src/components/input/SelectFormGroup.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import SelectInput from "./SelectInput";
3 |
4 |
5 | class SelectFormGroup extends Component{
6 | constructor(props){
7 | super(props);
8 | }
9 |
10 | renderLabel(){
11 | if(this.props.label == "" || this.props.label == null){
12 | return ""
13 | }
14 | else{
15 | return {this.props.label}
16 | }
17 |
18 | }
19 |
20 |
21 | render(){
22 | return (
23 |
24 | {this.renderLabel()}
25 |
26 |
27 | )
28 | }
29 | }
30 |
31 | export default SelectFormGroup;
--------------------------------------------------------------------------------
/src/components/input/SelectInput.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 |
3 |
4 | class SelectInput extends Component{
5 | constructor(props){
6 | super(props);
7 | }
8 |
9 |
10 | render(){
11 | return (
12 |
13 | Choose...
14 | {
15 | this.props.selectData.map((data, index) => {
16 | return {data.name}
17 | })
18 | }
19 |
20 |
21 | )
22 | }
23 | }
24 |
25 | SelectInput.defaultValue = {
26 | selectData: []
27 | }
28 |
29 | export default SelectInput;
--------------------------------------------------------------------------------
/src/components/input/TextArea.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 |
3 |
4 | class TextArea extends Component{
5 | constructor(props){
6 | super(props);
7 | }
8 |
9 |
10 | render(){
11 | return
12 | }
13 | }
14 |
15 | TextArea.defaultProps = {
16 | rows: 3,
17 | cols: 10
18 | }
19 |
20 | export default TextArea;
--------------------------------------------------------------------------------
/src/components/input/TextAreaFormGroup.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import TextArea from "./TextArea";
3 |
4 |
5 | class TextAreaFormGroup extends Component{
6 | constructor(props){
7 | super(props);
8 | }
9 |
10 |
11 | render(){
12 | return (
13 |
14 | {this.props.label}
15 |
16 |
17 | )
18 | }
19 | }
20 |
21 | TextAreaFormGroup.defaultProps = {
22 | rows: 3,
23 | cols: 10,
24 | className: "form-control"
25 | }
26 |
27 | export default TextAreaFormGroup;
--------------------------------------------------------------------------------
/src/components/navigation/HeaderNavbar.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Link } from "react-router-dom";
3 | import NavLiTag from "../navigation/NavListTag";
4 |
5 |
6 | class HeaderNavBar extends Component{
7 | constructor(props){
8 | super(props);
9 | this.userRole = "admin";
10 | var navbarText = "";
11 | if(this.userRole == "admin"){
12 | this.navbarText = "Inventory Management (Admin Portal)"
13 | }
14 | else{
15 | this.navbarText = "Inventory Management"
16 | }
17 | }
18 |
19 |
20 | render(){
21 | return (
22 |
23 | {this.navbarText}
24 |
25 |
26 |
27 |
28 |
34 |
35 | )
36 |
37 | }
38 | }
39 |
40 | export default HeaderNavBar;
--------------------------------------------------------------------------------
/src/components/navigation/NavListTag.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Link } from "react-router-dom";
3 |
4 |
5 | class NavLiTag extends Component{
6 | constructor(props){
7 | super(props);
8 | }
9 |
10 | render(){
11 | return (
12 |
13 | {this.props.itemValue}
14 |
15 | )
16 |
17 | }
18 | }
19 |
20 | export default NavLiTag;
--------------------------------------------------------------------------------
/src/components/profile/PasswordReset.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import InputPasswordGroup from "../../components/input/InputPasswordGroup";
3 |
4 | class PasswordResetForm extends Component{
5 | constructor(props){
6 | super(props);
7 | }
8 |
9 |
10 | render(){
11 | return (
12 |
13 |
14 |
Password Reset
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
32 |
41 |
42 |
43 |
44 |
45 |
46 | )
47 | }
48 | }
49 |
50 | export default PasswordResetForm;
--------------------------------------------------------------------------------
/src/components/profile/Profile.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 |
3 |
4 | class Profile extends Component{
5 | constructor(props){
6 | super(props);
7 | }
8 |
9 |
10 | render(){
11 | return (
12 |
13 |
14 |
Personal Profile
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | First Name
23 |
24 |
25 |
26 |
27 |
28 | Last Name
29 |
30 |
31 |
32 |
33 |
34 | Email
35 |
36 |
37 |
38 |
39 |
40 | Role
41 |
42 |
43 |
44 |
45 |
46 | Joined
47 |
48 |
49 |
50 |
51 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | )
64 | }
65 | }
66 |
67 | export default Profile;
--------------------------------------------------------------------------------
/src/components/table/SearchDataTable.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import SearchTableHead from "./SearchTableHead";
3 | import TdTag from "./TdTag";
4 | import SearchActionTd from "../table/SearchTableActionTd";
5 |
6 |
7 | class SearchDataTable extends Component{
8 | constructor(props){
9 | super(props);
10 | }
11 |
12 |
13 | render(){
14 | return (
15 |
16 |
17 |
18 | {
19 | this.props.tableData.map((data, index) => {
20 | return (
21 |
22 | {
23 | Object.keys(data).map((key, index) => {
24 | return
25 | })
26 | }
27 |
28 |
29 | )
30 | })
31 | }
32 |
33 |
34 | )
35 | }
36 | }
37 |
38 | export default SearchDataTable;
--------------------------------------------------------------------------------
/src/components/table/SearchTableActionTd.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 |
3 | class SearchActionTd extends Component{
4 | constructor(props){
5 | super(props);
6 | }
7 |
8 |
9 | render(){
10 | return (
11 |
12 | Add
13 |
14 | )
15 | }
16 | }
17 |
18 | export default SearchActionTd;
--------------------------------------------------------------------------------
/src/components/table/SearchTableHead.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import ThTag from "./ThTag";
3 |
4 |
5 | class SearchTableHead extends Component{
6 | constructor(props){
7 | super(props);
8 | }
9 |
10 |
11 | render(){
12 | return (
13 |
14 |
15 | {
16 | this.props.columnList.map((value, index) => {
17 | return
18 | })
19 | }
20 |
21 |
22 | )
23 | }
24 | }
25 |
26 | export default SearchTableHead;
--------------------------------------------------------------------------------
/src/components/table/Table.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import TableHead from "./TableHead";
3 | import TdTag from "./TdTag"
4 |
5 |
6 | class Table extends Component{
7 | constructor(props){
8 | super(props);
9 | }
10 |
11 | renderAction(data){
12 | if(this.props.allowAction){
13 | return
14 | }
15 | }
16 |
17 |
18 | render(){
19 | return (
20 |
21 |
22 |
23 | {
24 | this.props.tableData.map((data, index) => {
25 | return (
26 |
27 | {
28 | Object.keys(data).map((key, index) => {
29 | return
30 | })
31 | }
32 |
33 | {this.renderAction(data)}
34 |
35 |
36 |
37 | )
38 | })
39 | }
40 |
41 |
42 | )
43 | }
44 | }
45 |
46 | Table.defaultProps = {
47 | allowAction: true
48 | }
49 |
50 | export default Table;
--------------------------------------------------------------------------------
/src/components/table/TableHead.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import ThTag from "./ThTag";
3 |
4 |
5 | class TableHead extends Component{
6 | constructor(props){
7 | super(props);
8 | }
9 |
10 |
11 | render(){
12 | return (
13 |
14 |
15 | {
16 | this.props.columnList.map((value, index) => {
17 | return
18 | })
19 | }
20 |
21 |
22 | )
23 | }
24 | }
25 |
26 | export default TableHead;
--------------------------------------------------------------------------------
/src/components/table/TdTag.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import AnchorTag from "../Anchortag";
3 |
4 | class TdTag extends Component{
5 | constructor(props){
6 | super(props);
7 | console.log(this.props)
8 | }
9 |
10 |
11 | render(){
12 | if(this.props.isLinked=="false"){
13 | return {this.props.value}
14 | }
15 | else{
16 | return (
17 |
18 |
19 |
20 |
21 | )
22 | }
23 | }
24 | }
25 |
26 | export default TdTag;
--------------------------------------------------------------------------------
/src/components/table/ThTag.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 |
3 |
4 | class ThTag extends Component{
5 | constructor(props){
6 | super(props);
7 | }
8 |
9 |
10 | render(){
11 | return (
12 | {this.props.value}
13 | )
14 | }
15 | }
16 |
17 | export default ThTag;
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
15 | .form-group {
16 | margin-bottom: 1rem;
17 | }
18 |
19 | .ml-5{
20 | margin-left: 3 rem !important;
21 | }
22 |
23 | input[readonly]{
24 | background-color:transparent;
25 | border: 0;
26 | font-size: 1em;
27 | }
28 |
29 | .side-navigation a{
30 | font-size: 14px;
31 | color: #212529;
32 | }
33 |
34 | .side-navigation a:hover{
35 | background: #e6e6e6;
36 | }
37 |
38 | .horizontal-line{
39 | background: #d9d9d9;
40 | padding-top: 1.5px;
41 | padding-bottom: 1px;
42 | }
43 |
44 | .search-tb-font td, .search-tb-font th{
45 | font-size: 13px;
46 | }
47 |
48 | .s-add-item{
49 | cursor: pointer;
50 | }
51 |
52 | .sm-tb-font td, .sm-tb-font th{
53 | font-size: 14px;
54 | }
55 |
56 | .dash-summary-cell{
57 | border: 1px solid #e6e6e6;
58 | padding: 8px 10px;
59 | background: #e6e6e6;
60 | }
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import 'bootstrap/dist/css/bootstrap.css';
4 | import './index.css';
5 | import App from './App';
6 | import reportWebVitals from './reportWebVitals';
7 |
8 | ReactDOM.render(
9 |
10 |
11 | ,
12 | document.getElementById('root')
13 | );
14 |
15 | // If you want to start measuring performance in your app, pass a function
16 | // to log results (for example: reportWebVitals(console.log))
17 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
18 | reportWebVitals();
19 |
--------------------------------------------------------------------------------
/src/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/pages/AuthPage.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import "../style/auth.css";
3 | import LoginForm from "../components/auth/LoginForm";
4 | import RegistrationForm from "../components/auth/RegistrationForm";
5 | import PasswordResetVerifyForm from "../components/auth/PasswordResetVerifyForm";
6 | import PasswordResetForm from "../components/auth/PasswordResetForm";
7 |
8 |
9 | class AuthPage extends Component{
10 | constructor(props){
11 | super(props)
12 | this.currentUrl = this.props.location.pathname;
13 | }
14 |
15 | render(){
16 | if(this.props.location.pathname == "/login"){
17 | return
18 | }
19 | else if(this.props.location.pathname == "/registration"){
20 | return
21 | }
22 | else if(this.props.location.pathname == "/password-reset-account-verify"){
23 | return
24 | }
25 | else if(this.props.location.pathname == "/password-reset"){
26 | return
27 | }
28 |
29 | }
30 | }
31 |
32 | export default AuthPage;
--------------------------------------------------------------------------------
/src/pages/HomePage.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import HeaderNavBar from "../components/navigation/HeaderNavbar";
3 |
4 |
5 | class HomePage extends Component{
6 | render(){
7 | return (
8 |
9 |
10 |
11 | )
12 | }
13 | }
14 |
15 | export default HomePage;
--------------------------------------------------------------------------------
/src/pages/NotFound.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 |
3 |
4 | class NotFoundPage extends Component{
5 | render(){
6 | return (
7 |
8 |
Page not found!
9 |
10 | )
11 | }
12 | }
13 |
14 | export default NotFoundPage;
--------------------------------------------------------------------------------
/src/pages/admin/RootPage.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Route, Switch } from "react-router-dom";
3 | import "../../style/admin.css";
4 | import HeaderNavBar from "../../components/navigation/HeaderNavbar";
5 | import AnchorTag from "../../components/Anchortag";
6 | import AdminSettingsPage from "../../pages/admin/settings/SettingsPage";
7 | import AdminShopPage from "../../pages/admin/shop/AdminShopPage";
8 | import ProfilePage from "../../components/admin/ProfilePage";
9 |
10 |
11 | class AdminRootPage extends Component{
12 | constructor(props){
13 | super(props);
14 | this.userRole = "admin";
15 |
16 | let {path, url} = this.props.match;
17 | console.log(this.props);
18 | }
19 |
20 |
21 | render(){
22 | return (
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | )
51 | }
52 | }
53 |
54 | export default AdminRootPage;
--------------------------------------------------------------------------------
/src/pages/admin/settings/SettingsPage.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Route, Switch } from "react-router-dom";
3 | import "../../../style/admin.css";
4 | import RoleList from "../../../components/admin/settings/RoleList";
5 | import RoleForm from "../../../components/admin/settings/RoleForm";
6 | import UserList from "../../../components/admin/settings/UserList";
7 | import UserForm from "../../../components/admin/settings/UserForm";
8 | import UserView from "../../../components/admin/settings/UserView";
9 | import PasswordResetForm from "../../../components/admin/settings/PasswordResetForm";
10 |
11 |
12 | class AdminSettingsPage extends Component{
13 | constructor(props){
14 | super(props);
15 | this.userRole = "admin";
16 | }
17 |
18 |
19 | render(){
20 | return (
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | )
34 | }
35 | }
36 |
37 | export default AdminSettingsPage;
--------------------------------------------------------------------------------
/src/pages/admin/shop/AdminShopPage.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Route, Switch } from "react-router-dom";
3 | import "../../../style/admin.css";
4 | import ShopList from "../../../components/admin/shop/ShopList";
5 | import ShopForm from "../../../components/admin/shop/ShopForm";
6 | import ShopView from "../../../components/admin/shop/ShopView";
7 |
8 |
9 | class AdminShopPage extends Component{
10 | constructor(props){
11 | super(props);
12 | this.userRole = "admin";
13 | }
14 |
15 |
16 | render(){
17 | return (
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | )
27 | }
28 | }
29 |
30 | export default AdminShopPage;
--------------------------------------------------------------------------------
/src/pages/customer/Dashboard.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import PageHeader from "../../components/PageHeader";
3 |
4 | class DashboardPage extends Component{
5 | constructor(props){
6 | super(props);
7 | this.userRole = "owner";
8 | }
9 |
10 |
11 | render(){
12 | return (
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Total Products
21 |
1200
22 |
23 |
24 |
25 |
26 |
Total Invoices
27 |
3400
28 |
29 |
30 |
31 |
32 |
Total Sell Today
33 |
123500
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | )
42 | }
43 | }
44 |
45 | export default DashboardPage;
--------------------------------------------------------------------------------
/src/pages/customer/RootPage.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Route, Switch } from "react-router-dom";
3 | import "../../style/admin.css";
4 | import HeaderNavBar from "../../components/navigation/HeaderNavbar";
5 | import AnchorTag from "../../components/Anchortag";
6 | import DashboardPage from "../../pages/customer/Dashboard";
7 | import CustomerShopPage from "../customer/shop/CustomerShopePage";
8 | import ProfileBasePage from "../customer/profile/ProfileBasePage";
9 |
10 |
11 | class CustomerRootPage extends Component{
12 | constructor(props){
13 | super(props);
14 | this.userRole = "owner";
15 | }
16 |
17 |
18 | render(){
19 | return (
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | )
50 | }
51 | }
52 |
53 | export default CustomerRootPage;
--------------------------------------------------------------------------------
/src/pages/customer/profile/ProfileBasePage.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Route, Switch } from "react-router-dom";
3 | import Profile from "../../../components/profile/Profile";
4 | import PasswordResetForm from "../../../components/profile/PasswordReset";
5 |
6 |
7 | class ProfileBasePage extends Component{
8 | constructor(props){
9 | super(props);
10 | }
11 |
12 |
13 | render(){
14 | return (
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | )
23 | }
24 | }
25 |
26 | export default ProfileBasePage;
--------------------------------------------------------------------------------
/src/pages/customer/shop/CustomerShopePage.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from "react";
2 | import { Route, Switch } from "react-router-dom";
3 | import ShopView from "../../../components/customer/ShopView";
4 | import ShopEdit from "../../../components/customer/ShopEdit";
5 | import ProductCategoryList from "../../../components/customer/PeoductCategoryList";
6 | import ProductCategoryForm from "../../../components/customer/ProductCategoryForm";
7 | import ProductCategoryView from "../../../components/customer/ProductCategoryView";
8 | import ProductList from "../../../components/customer/ProductList";
9 | import ProductForm from "../../../components/customer/ProductForm";
10 | import ProductView from "../../../components/customer/ProductView";
11 | import EmployeeList from "../../../components/customer/EmployeeList";
12 | import EmployeeForm from "../../../components/customer/EmployeeForm";
13 | import EmployeeView from "../../../components/customer/EmployeeView";
14 | import InvoiceList from "../../../components/customer/InvoiceList";
15 | import InvoiceForm from "../../../components/customer/InvoiceForm";
16 |
17 |
18 | class CustomerShopPage extends Component{
19 | constructor(props){
20 | super(props);
21 | }
22 |
23 |
24 | render(){
25 | return (
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | )
45 | }
46 | }
47 |
48 | export default CustomerShopPage;
--------------------------------------------------------------------------------
/src/reportWebVitals.js:
--------------------------------------------------------------------------------
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
7 | getLCP(onPerfEntry);
8 | getTTFB(onPerfEntry);
9 | });
10 | }
11 | };
12 |
13 | export default reportWebVitals;
14 |
--------------------------------------------------------------------------------
/src/setupTests.js:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/src/style/admin.css:
--------------------------------------------------------------------------------
1 | .admin-page{
2 | width: 80%;
3 | }
4 |
5 | .admin-content{
6 | width: 90%;
7 | }
8 |
9 | .float-right {
10 | float: right!important;
11 | }
--------------------------------------------------------------------------------
/src/style/auth.css:
--------------------------------------------------------------------------------
1 | .auth{
2 | width: 400px;
3 | }
4 |
5 | .auth form{
6 | margin-top: 150px;
7 | }
--------------------------------------------------------------------------------