diff --git a/.eslintrc.json b/.eslintrc.json index aef398db9..0d028e959 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -13,13 +13,9 @@ }, "plugins": ["react", "prettier"], "rules": { - "prettier/prettier": [ - "error", - { - "endOfLine": "auto" - } - ], + "prettier/prettier": 0, "default-param-last": "off", + "react/prop-types": "off", "react/react-in-jsx-scope": "off", "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], "react/jsx-props-no-spreading": [ diff --git a/.prettierrc.json b/.prettierrc.json index 40fa8e5f6..a73e1cee9 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -2,7 +2,7 @@ "printWidth": 100, "trailingComma": "es5", "tabWidth": 2, - "semi": true, + "semi": false, "singleQuote": false, "endOfLine": "auto" } diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..ad92582bd --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.formatOnSave": true +} diff --git a/README.md b/README.md index 491b5e226..9cf9acde5 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This free MUI & React Dashboard is coming with prebuilt design blocks, so the de switching from our pages to the real website is very easy to be done. Special thanks go to: -- [Nepcha Analytics](https://nepcha.com?ref=readme) for the analytics tool. Nepcha is already integrated with Material Dashboard React. You can use it to gain insights into your sources of traffic. +- [Nepcha tics](https://nepcha.com?ref=readme) for the analytics tool. Nepcha is already integrated with Material Dashboard React. You can use it to gain insights into your sources of traffic. **Documentation built by Developers** diff --git a/dcasn b/dcasn new file mode 100644 index 000000000..012bce130 --- /dev/null +++ b/dcasn @@ -0,0 +1,3 @@ + doston +* doston1 + main diff --git a/est b/est new file mode 100644 index 000000000..66f6f5f30 --- /dev/null +++ b/est @@ -0,0 +1 @@ +Token = "tokenType": "Bearer", \ No newline at end of file diff --git a/jsconfig.json b/jsconfig.json index 85a4c9774..3ece5c5e0 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "jsx": "react", "baseUrl": "src", "paths": { "*": ["public/src/*"] diff --git a/package.json b/package.json index 8e2cd45b5..e32f72744 100644 --- a/package.json +++ b/package.json @@ -17,32 +17,44 @@ "npm": ">=6" }, "dependencies": { + "@date-io/moment": "^1.3.13", + "@draft-js-plugins/image": "^4.1.3", "@emotion/cache": "11.7.1", - "@emotion/react": "11.7.1", - "@emotion/styled": "11.6.0", + "@emotion/react": "^11.11.1", + "@emotion/styled": "^11.11.0", + "@material-ui/core": "^4.12.3", + "@material-ui/pickers": "^3.3.10", "@mui/icons-material": "5.4.1", - "@mui/material": "5.4.1", + "@mui/material": "^5.13.5", "@mui/styled-engine": "5.4.1", "@testing-library/jest-dom": "5.16.2", "@testing-library/react": "12.1.2", "@testing-library/user-event": "13.5.0", + "@uiw/react-md-editor": "^3.23.3", + "axios": "^1.4.0", "chart.js": "3.4.1", "chroma-js": "2.4.2", + "draft-js": "^0.11.7", + "install": "^0.13.0", + "lotin-kirill": "^0.1.3", + "npm": "^9.6.7", "prop-types": "15.8.1", "react": "17.0.2", "react-chartjs-2": "3.0.4", "react-dom": "17.0.2", "react-github-btn": "1.2.1", + "react-icons": "^4.9.0", "react-router-dom": "6.2.1", "react-scripts": "5.0.0", "react-table": "7.7.0", + "react-toastify": "^9.1.3", "stylis": "4.0.13", "stylis-plugin-rtl": "2.1.1", "web-vitals": "2.1.4", "yup": "0.32.11" }, "scripts": { - "start": "react-scripts start", + "start": "set PORT=3001 && react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", diff --git a/public/back.jpg b/public/back.jpg new file mode 100644 index 000000000..ab64566cf Binary files /dev/null and b/public/back.jpg differ diff --git a/public/back_sidebar.jpg b/public/back_sidebar.jpg new file mode 100644 index 000000000..a9399be35 Binary files /dev/null and b/public/back_sidebar.jpg differ diff --git a/public/index.html b/public/index.html index 7ac903b40..c77393eaa 100644 --- a/public/index.html +++ b/public/index.html @@ -22,7 +22,7 @@ - Material Dashboard 2 React + Tahlil24 } {getRoutes(routes)} + } /> } /> diff --git a/src/components/MDTypography/index.js b/src/components/MDTypography/index.js index 4149a3b73..0480dd5ce 100644 --- a/src/components/MDTypography/index.js +++ b/src/components/MDTypography/index.js @@ -76,6 +76,8 @@ MDTypography.propTypes = { "dark", "text", "white", + "lime", + "blue", ]), fontWeight: PropTypes.oneOf([false, "light", "regular", "medium", "bold"]), textTransform: PropTypes.oneOf(["none", "capitalize", "uppercase", "lowercase"]), diff --git a/src/examples/Breadcrumbs/index.js b/src/examples/Breadcrumbs/index.js index 46d684da0..e078faf28 100644 --- a/src/examples/Breadcrumbs/index.js +++ b/src/examples/Breadcrumbs/index.js @@ -1,18 +1,3 @@ -/** -========================================================= -* Material Dashboard 2 React - v2.1.0 -========================================================= - -* Product Page: https://www.creative-tim.com/product/material-dashboard-react -* Copyright 2022 Creative Tim (https://www.creative-tim.com) - -Coded by www.creative-tim.com - - ========================================================= - -* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -*/ - // react-router-dom components import { Link } from "react-router-dom"; diff --git a/src/examples/Navbars/DefaultNavbar/index.js b/src/examples/Navbars/DefaultNavbar/index.js index 494cacea6..a1f366bcf 100644 --- a/src/examples/Navbars/DefaultNavbar/index.js +++ b/src/examples/Navbars/DefaultNavbar/index.js @@ -127,6 +127,7 @@ function DefaultNavbar({ transparent, light, action }) { name="sign in" route="/authentication/sign-in" light={light} + Dashboard="sign-in" /> {action && diff --git a/src/examples/Sidenav/index.js b/src/examples/Sidenav/index.js index f0d41d2b7..35b72ba02 100644 --- a/src/examples/Sidenav/index.js +++ b/src/examples/Sidenav/index.js @@ -1,18 +1,3 @@ -/** -========================================================= -* Material Dashboard 2 React - v2.1.0 -========================================================= - -* Product Page: https://www.creative-tim.com/product/material-dashboard-react -* Copyright 2022 Creative Tim (https://www.creative-tim.com) - -Coded by www.creative-tim.com - - ========================================================= - -* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -*/ - import { useEffect } from "react"; // react-router-dom components @@ -30,7 +15,7 @@ import Icon from "@mui/material/Icon"; // Material Dashboard 2 React components import MDBox from "components/MDBox"; import MDTypography from "components/MDTypography"; -import MDButton from "components/MDButton"; +// import MDButton from "components/MDButton"; // Material Dashboard 2 React example components import SidenavCollapse from "examples/Sidenav/SidenavCollapse"; @@ -49,7 +34,7 @@ import { function Sidenav({ color, brand, brandName, routes, ...rest }) { const [controller, dispatch] = useMaterialUIController(); - const { miniSidenav, transparentSidenav, whiteSidenav, darkMode, sidenavColor } = controller; + const { miniSidenav, transparentSidenav, whiteSidenav, darkMode} = controller; const location = useLocation(); const collapseName = location.pathname.replace("/", ""); @@ -78,7 +63,6 @@ function Sidenav({ color, brand, brandName, routes, ...rest }) { // Call the handleMiniSidenav function to set the state with the initial value. handleMiniSidenav(); - // Remove event listener on cleanup return () => window.removeEventListener("resize", handleMiniSidenav); }, [dispatch, location]); @@ -179,7 +163,7 @@ function Sidenav({ color, brand, brandName, routes, ...rest }) { } /> {renderRoutes} - + {/* upgrade to pro - + */} ); } diff --git a/src/examples/Tables/DataTable/DataTableHeadCell.js b/src/examples/Tables/DataTable/DataTableHeadCell.js index d15457fff..84e0f3b8a 100644 --- a/src/examples/Tables/DataTable/DataTableHeadCell.js +++ b/src/examples/Tables/DataTable/DataTableHeadCell.js @@ -43,10 +43,10 @@ function DataTableHeadCell({ width, children, sorted, align, ...rest }) { {...rest} position="relative" textAlign={align} - color={darkMode ? "white" : "secondary"} + color={darkMode ? "red" : "dark"} opacity={0.7} sx={({ typography: { size, fontWeightBold } }) => ({ - fontSize: size.xxs, + fontSize: size.xxa, fontWeight: fontWeightBold, textTransform: "uppercase", cursor: sorted && "pointer", diff --git a/src/layouts/analysis24/FileUpload/FUStyles.js b/src/layouts/analysis24/FileUpload/FUStyles.js new file mode 100644 index 000000000..f1712909e --- /dev/null +++ b/src/layouts/analysis24/FileUpload/FUStyles.js @@ -0,0 +1,55 @@ +import styled from "@emotion/styled" + +const FUStyles = styled.div` + width: 100%; + form { + position: relative; + + .loading { + position: absolute; + top: -10px; + left: -10px; + padding-left: 15px; + height: 100%; + width: 110%; + background: rgba(255, 255, 255, 0.25); + box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37); + backdrop-filter: blur(4px); + border: 1px solid rgba(255, 255, 255, 0.18); + /* loading */ + .lds-ripple { + display: inline-block; + position: relative; + width: 80px; + height: 80px; + } + .lds-ripple div { + position: absolute; + border: 4px solid #3f51b5; + opacity: 1; + border-radius: 50%; + animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite; + } + .lds-ripple div:nth-child(2) { + animation-delay: -0.5s; + } + @keyframes lds-ripple { + 0% { + top: 36px; + left: 36px; + width: 0; + height: 0; + opacity: 1; + } + 100% { + top: 0px; + left: 0px; + width: 72px; + height: 72px; + opacity: 0; + } + } + } + } +` +export default FUStyles diff --git a/src/layouts/analysis24/FileUpload/index.js b/src/layouts/analysis24/FileUpload/index.js new file mode 100644 index 000000000..bba34f189 --- /dev/null +++ b/src/layouts/analysis24/FileUpload/index.js @@ -0,0 +1,134 @@ +import { Button } from "@material-ui/core" +import React, { useEffect, useState } from "react" +import axios from "axios" +import { MdAddAPhoto } from "react-icons/md" +import { AiOutlineCloudUpload } from "react-icons/ai" +import FUStyles from "./FUStyles" + +function FileUpload({ callback, clearBool }) { + const [fileImage, setFileImage] = useState("") + const [fileName, setFilename] = useState(null) + const [load, setLoad] = useState(false) + const [viewBool, setViewBool] = useState(false) + const [isUploaded, setIsUploaded] = useState(false) + const [nameImage, setNameImage] = useState("") + + const getImage = (e) => { + console.log("getImage", e.target.files[0], e.target.files[0].nameImage) + setFileImage(e.target.files[0]) + const objectUrl = URL.createObjectURL(e.target.files[0]) + setNameImage(e.target.files[0].nameImage) + setFilename(objectUrl) + setViewBool(true) + } + + useEffect(() => { + if (clearBool) { + setFileImage("") + setFilename(null) + setViewBool(false) + setIsUploaded(false) + } + }, [clearBool]) + + const setImage = async (body) => { + const url = `http://165.232.85.45:1988/koinot/attachment/uploadPhotoFileList/NEWS?requestMethod=POST` + const config = { + headers: { + "Content-type": "multipart/form-data", + Authorization: + "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIzIiwiaWF0IjoxNjg2MDcyNjYwLCJleHAiOjE2ODc4MDA2NjB9.m8116Hfe7CamK9cHHAdhpv9ZRvi9Kg-CxTabAjtydfXVLamgr6sArqzOEscN7swspNjOzlw62XgOhPy3aB-lAw", + }, + } + try { + const res = axios.post(url, body, config) + setFilename(res.data.object[0].link) + callback(res) + console.log("resresresres", res) + setLoad(false) + setIsUploaded(true) + return res + } catch (error) { + setLoad(false) + console.error(error) + return { error: true } + } + } + + const onSubmit = async (e) => { + e.preventDefault() + const formData1 = new FormData() + formData1.append("file", fileImage, nameImage) + console.log("formData1", formData1) + setImage(formData1) + setLoad(true) + } + + return ( + +
+
+
+ +