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..4ab5c9770 100644 --- a/README.md +++ b/README.md @@ -1,219 +1,20 @@ -# [Material Dashboard 2 React](http://demos.creative-tim.com/material-dashboard-react/#/dashboard?ref=readme-mdr) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&logo=twitter)](https://twitter.com/intent/tweet?url=https://www.creative-tim.com/product/material-dashboard-react&text=Check%20Material%20Dashboard%202%20react%20made%20by%20@CreativeTim%20#webdesign%20#dashboard%20#materialdesign%20#react%20https://www.creative-tim.com/product/material-dashboard-react) +# Tahlil24 Dashboard -![version](https://img.shields.io/badge/version-2.1.0-blue.svg) [![GitHub issues open](https://img.shields.io/github/issues/creativetimofficial/material-dashboard-react.svg)](https://github.com/creativetimofficial/material-dashboard-react/issues?q=is%3Aopen+is%3Aissue) [![GitHub issues closed](https://img.shields.io/github/issues-closed-raw/creativetimofficial/material-dashboard-react.svg)](https://github.com/creativetimofficial/material-dashboard-react/issues?q=is%3Aissue+is%3Aclosed) +Tahlil24 news website admin panel (dashboard) — a platform developed for managing news. This project is built using **React.js** and allows users to create, edit, and delete news articles. -![Image](https://s3.amazonaws.com/creativetim_bucket/products/71/original/material-dashboard-react.jpg?1638950990) +## Technologies and Libraries +This project utilizes the following technologies and libraries: -Material Dashboard 2 React is our newest free MUI Admin Template based on React. If you’re a developer looking to create an admin dashboard that is developer-friendly, rich with features, and highly customisable, here is your match. Our innovative MUI & React dashboard comes with a beautiful design inspired by Google's Material Design and it will help you create stunning websites & web apps to delight your clients. +- **React.js** – Core library for building the UI +- **Axios** – For making HTTP requests +- **Chart.js** – For displaying statistical data in charts +- **Chroma-js** – For color manipulation and management +- **Draft-js** – Rich text editor for content management +- **lotin-kirill** – For converting text between Latin and Cyrillic scripts -**Fully Coded Elements** -Material Dashboard 2 React is built with over 70 frontend individual elements, like buttons, inputs, navbars, nav tabs, cards, or alerts, giving you the freedom of choosing and combining. All components can take variations in color, which you can easily modify using MUI styled() API and sx prop. You will save a lot of time going from prototyping to full-functional code because all elements are implemented. +## Features +- Create and edit news articles +- Delete news articles +- Display statistical data in chart format +- Fully responsive for mobile and tablet devices -This free MUI & React Dashboard is coming with prebuilt design blocks, so the development process is seamless, -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. - -**Documentation built by Developers** - -Each element is well presented in very complex documentation. - -You can read more about the [documentation here](https://www.creative-tim.com/learning-lab/react/overview/material-dashboard/). - -**Example Pages** - -If you want to get inspiration or just show something directly to your clients, you can jump-start your development with our pre-built example pages. You will be able to quickly set up the basic structure for your web project. - -View [example pages here](https://demos.creative-tim.com/material-dashboard-react/#/dashboard). - -**HELPFUL LINKS** - -- View [Github Repository](https://github.com/creativetimofficial/material-dashboard-react) -- Check [FAQ Page](https://www.creative-tim.com/faq) - -#### Special thanks - -During the development of this dashboard, we have used many existing resources from awesome developers. We want to thank them for providing their tools open source: - -- [MUI](https://mui.com/) - The React UI library for faster and easier web development. -- [React ChartJS 2](http://reactchartjs.github.io/react-chartjs-2/#/) - Simple yet flexible React charting for designers & developers. -- [ChromaJS](https://gka.github.io/chroma.js/) - A small-ish zero-dependency JavaScript library for all kinds of color conversions and color scales. - -Let us know your thoughts below. And good luck with development! - -## Table of Contents - -- [Versions](#versions) -- [Demo](#demo) -- [Quick Start](#quick-start) -- [Documentation](#documentation) -- [File Structure](#file-structure) -- [Browser Support](#browser-support) -- [Resources](#resources) -- [Reporting Issues](#reporting-issues) -- [Technical Support or Questions](#technical-support-or-questions) -- [Licensing](#licensing) -- [Useful Links](#useful-links) - -## Versions - -[](https://www.creative-tim.com/product/material-dashboard-react?ref=readme-mdr) - -| React | -| ----- | - -| [![Material Dashboard React](https://s3.amazonaws.com/creativetim_bucket/products/71/thumb/material-dashboard-react.jpg?1638950990)](http://demos.creative-tim.com/material-dashboard-react/#/dashboard?ref=readme-mdr) - -## Demo - -- [Dashboard](http://demos.creative-tim.com/material-dashboard-react/#/dashboard?ref=readme-sudr) -- [Profile](https://demos.creative-tim.com/material-dashboard-react/#/profile?ref=readme-sudr) -- [RTL](https://demos.creative-tim.com/material-dashboard-react/#/rtl?ref=readme-sudr) -- [Sign In](https://demos.creative-tim.com/material-dashboard-react/#/authentication/sign-in?ref=readme-sudr) -- [Sign Up](https://demos.creative-tim.com/material-dashboard-react/#/authentication/sign-up?ref=readme-sudr) - -[View More](https://demos.creative-tim.com/material-dashboard-react/#/dashboard?ref=readme-mdr). - -## Quick start - -Quick start options: - -- Download from [Creative Tim](https://www.creative-tim.com/product/material-dashboard-react?ref=readme-mdr). - -## Terminal Commands - -1. Download and Install NodeJs LTS version from [NodeJs Official Page](https://nodejs.org/en/download/). -2. Navigate to the root ./ directory of the product and run `yarn install` or `npm install` to install our local dependencies. - -## Documentation - -The documentation for the Material Dashboard is hosted at our [website](https://www.creative-tim.com/learning-lab/react/overview/material-dashboard/?ref=readme-mdr). - -### What's included - -Within the download you'll find the following directories and files: - -``` -material-dashboard-react - ├── public - │   ├── apple-icon.png - │   ├── favicon.png - │   ├── index.html - │   ├── manifest.json - │   └── robots.txt - ├── src - │   ├── assets - │ │   ├── images - │ │   └── theme - │ │  ├── base - │ │  ├── components - │ │  ├── functions - │ │  ├── index.js - │ │ └── theme-rtl.js - │ │   └── theme-dark - │ │  ├── base - │ │  ├── components - │ │  ├── functions - │ │  ├── index.js - │ │ └── theme-rtl.js - │   ├── components - │ │   ├── MDAlert - │ │   ├── MDAvatar - │ │   ├── MDBadge - │ │   ├── MDBox - │ │   ├── MDButton - │ │   ├── MDInput - │ │   ├── MDPagination - │ │   ├── MDProgress - │ │   ├── MDSnackbar - │ │   └── MDTypography - │   ├── context - │   ├── examples - │ │   ├── Breadcrumbs - │ │   ├── Cards - │ │   ├── Charts - │ │   ├── Configurator - │ │   ├── Footer - │ │   ├── Items - │ │   ├── LayoutContainers - │ │   ├── Lists - │ │   ├── Navbars - │ │   ├── Sidenav - │ │   ├── Tables - │ │   └── Timeline - │   ├── layouts - │ │   ├── authentication - │ │   ├── billing - │ │   ├── dashboard - │ │   ├── notifications - │ │   ├── profile - │ │   ├── rtl - │ │   └── tables - │   ├── App.js - │   ├── index.js - │   └── routes.js - ├── .eslintrc.json - ├── .prettierrc.json - ├── CHANGELOG.md - ├── ISSUE_TEMPLATE.md - ├── jsconfig.json - ├── LICENSE.md - ├── package.json - └── README.md -``` - -## Browser Support - -At present, we officially aim to support the last two versions of the following browsers: - - - -## Resources - -- [Live Preview](https://demos.creative-tim.com/material-dashboard-react/#/dashboard?ref=readme-mdr) -- [Download Page](https://www.creative-tim.com/product/material-dashboard-react?ref=readme-mdr) -- Documentation is [here](https://www.creative-tim.com/learning-lab/react/overview/material-dashboard/?ref=readme-mdr) -- [License Agreement](https://www.creative-tim.com/license?ref=readme-mdr) -- [Support](https://www.creative-tim.com/contact-us?ref=readme-mdr) -- Issues: [Github Issues Page](https://github.com/creativetimofficial/material-dashboard-react/issues) -- [Nepcha Analytics](https://nepcha.com?ref=readme) - Analytics tool for your website - -## Reporting Issues - -We use GitHub Issues as the official bug tracker for the Material Dashboard React. Here are some advices for our users that want to report an issue: - -1. Make sure that you are using the latest version of the Material Dashboard React. Check the CHANGELOG from your dashboard on our [website](https://www.creative-tim.com/product/material-dashboard-react?ref=readme-mdr). -2. Providing us reproducible steps for the issue will shorten the time it takes for it to be fixed. -3. Some issues may be browser specific, so specifying in what browser you encountered the issue might help. - -## Technical Support or Questions - -If you have questions or need help integrating the product please [contact us](https://www.creative-tim.com/contact-us?ref=readme-mdr) instead of opening an issue. - -## Licensing - -- Copyright 2021 [Creative Tim](https://www.creative-tim.com?ref=readme-mdr) -- Creative Tim [license](https://www.creative-tim.com/license?ref=readme-mdr) - -## Useful Links - -- [More products](https://www.creative-tim.com/templates?ref=readme-mdr) from Creative Tim - -- [Tutorials](https://www.youtube.com/channel/UCVyTG4sCw-rOvB9oHkzZD1w) - -- [Freebies](https://www.creative-tim.com/bootstrap-themes/free?ref=readme-mdr) from Creative Tim - -- [Affiliate Program](https://www.creative-tim.com/affiliates/new?ref=readme-mdr) (earn money) - -##### Social Media - -Twitter: - -Facebook: - -Dribbble: - -Google+: - -Instagram: 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 ( + +
+
+
+ +