diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ae5d06f..6c52f830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## [2.1.0] 2023-11-14 +- Upgrade to Material Tailwind `v2` + +## [2.0.1] 2023-03-29 + +- Add nepcha scripts + ## [2.0.0] 2022-11-02 - Update the entire structure diff --git a/LICENSE b/LICENSE index a0a24253..917de35a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Creative Tim +Copyright (c) 2023 Creative Tim Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 464a1505..ad782a5c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # [Material Tailwind Dashboard React](http://demos.creative-tim.com/material-tailwind-dashboard-react/#/?ref=readme-mtdr) [![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-tailwind-dashboard-react&text=Check%20Material%20Tailwind%20Dashboard%20React%20made%20by%20@CreativeTim%20#webdesign%20#kit%20#materialdesign%20#react%20#materialtailwind%20#tailwindcss%20https://www.creative-tim.com/product/material-tailwind-dashboard-react) -![version](https://img.shields.io/badge/version-2.0.0-blue.svg) [![GitHub issues open](https://img.shields.io/github/issues/creativetimofficial/material-tailwind-dashboard-react.svg)](https://github.com/creativetimofficial/material-tailwind-dashboard-react/issues?q=is%3Aopen+is%3Aissue) [![GitHub issues closed](https://img.shields.io/github/issues-closed-raw/creativetimofficial/material-tailwind-dashboard-react.svg)](https://github.com/creativetimofficial/material-tailwind-dashboard-react/issues?q=is%3Aissue+is%3Aclosed) +![version](https://img.shields.io/badge/version-2.1.0-blue.svg) [![GitHub issues open](https://img.shields.io/github/issues/creativetimofficial/material-tailwind-dashboard-react.svg)](https://github.com/creativetimofficial/material-tailwind-dashboard-react/issues?q=is%3Aopen+is%3Aissue) [![GitHub issues closed](https://img.shields.io/github/issues-closed-raw/creativetimofficial/material-tailwind-dashboard-react.svg)](https://github.com/creativetimofficial/material-tailwind-dashboard-react/issues?q=is%3Aissue+is%3Aclosed) -![Image](https://s3.amazonaws.com/creativetim_bucket/products/488/original/material-tailwind-react-dashboard.jpg) +![Image](https://s3.amazonaws.com/creativetim_bucket/products/488/original/material-tailwind-dashboard-react.jpg) +![Image](https://res.cloudinary.com/db7v5ycxn/image/upload/v1702666156/github-readme-images/xkwcnx11lebs74s8bjh7.png) +![Image](https://res.cloudinary.com/db7v5ycxn/image/upload/v1702666155/github-readme-images/lq2cg0nusyllgkwvmxnx.png) -Material Tailwind Dashboard React is our newest free Material Tailwind Admin Template based on Tailwind CSS and 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 Material Tailwind, Tailwind CSS & 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. +Material Tailwind Dashboard React is our newest free Material Tailwind Admin Template based on Tailwind CSS and React. If you’re a developer looking to create an admin dashboard that is developer-friendly, rich with features, highly customisable, and also supports **multilingual and bidirectional styling**, here is your match. Our innovative Material Tailwind, Tailwind CSS & 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. **Fully Coded Elements** @@ -38,6 +40,7 @@ During the development of this dashboard, we have used many existing resources f - [Material Tailwind](https://material-tailwind.com/) - Material Tailwind is an easy to use components library for Tailwind CSS and Material Design. - [Hero Icons](https://heroicons.com/) - Beautiful hand-crafted SVG icons. - [Apex Charts](https://apexcharts.com/) - Modern & Interactive open-source Charts. +- [Nepcha Analytics](https://nepcha.com?ref=readme) for the analytics tool. Nepcha is already integrated with Material Tailwind Dashboard React. You can use it to gain insights into your sources of traffic. Let us know your thoughts below. And good luck with development! @@ -62,7 +65,7 @@ Let us know your thoughts below. And good luck with development! | React | | ----- | -| [![Material Tailwind Dashboard React](https://s3.amazonaws.com/creativetim_bucket/products/488/thumb/material-tailwind-react-dashboard.jpg)](http://demos.creative-tim.com/material-tailwind-dashboard-react/#/?ref=readme-mtdr) +| [![Material Tailwind Dashboard React](https://s3.amazonaws.com/creativetim_bucket/products/488/thumb/material-tailwind-dashboard-react.jpg)](http://demos.creative-tim.com/material-tailwind-dashboard-react/#/?ref=readme-mtdr) ## Demo @@ -137,6 +140,7 @@ At present, we officially aim to support the last two versions of the following - [License Agreement](https://www.creative-tim.com/license?ref=readme-mtdr) - [Support](https://www.creative-tim.com/contact-us?ref=readme-mtdr) - Issues: [Github Issues Page](https://github.com/creativetimofficial/material-tailwind-dashboard-react/issues) +- [Nepcha Analytics](https://nepcha.com?ref=readme) - Analytics tool for your website ## Reporting Issues @@ -152,7 +156,7 @@ If you have questions or need help integrating the product please [contact us](h ## Licensing -- Copyright 2022 [Creative Tim](https://www.creative-tim.com?ref=readme-mtdr) +- Copyright 2023 [Creative Tim](https://www.creative-tim.com?ref=readme-mtdr) - Creative Tim [license](https://www.creative-tim.com/license?ref=readme-mtdr) ## Useful Links diff --git a/index.html b/index.html index f50e768b..844e5941 100644 --- a/index.html +++ b/index.html @@ -1,9 +1,9 @@ + +
diff --git a/package.json b/package.json index b7455d71..27c306ab 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "material-tailwind-dashboard-react", "private": true, - "version": "2.0.0", + "version": "2.1.0", "type": "module", "scripts": { "dev": "vite", @@ -9,24 +9,25 @@ "preview": "vite preview" }, "dependencies": { - "@heroicons/react": "2.0.12", - "@material-tailwind/react": "1.2.4", - "apexcharts": "3.35.5", + "@heroicons/react": "2.0.18", + "@material-tailwind/react": "2.1.4", + "apexcharts": "3.44.0", "prop-types": "15.8.1", "react": "18.2.0", - "react-apexcharts": "1.4.0", + "react-apexcharts": "1.4.1", "react-dom": "18.2.0", - "react-router-dom": "6.4.2" + "react-router-dom": "6.17.0" }, "devDependencies": { - "@types/react": "18.0.17", - "@types/react-dom": "18.0.6", - "@vitejs/plugin-react": "2.1.0", - "autoprefixer": "10.4.12", - "postcss": "8.4.17", - "prettier": "2.7.1", - "prettier-plugin-tailwindcss": "0.1.13", - "tailwindcss": "3.1.8", - "vite": "3.1.0" + "@types/react": "18.2.31", + "@types/react-dom": "18.2.14", + "@vitejs/plugin-react": "4.1.0", + "autoprefixer": "10.4.16", + "postcss": "8.4.31", + "prettier": "3.0.3", + "prettier-plugin-tailwindcss": "0.5.6", + "tailwindcss": "3.3.4", + "tailwindcss-rtl": "^0.9.0", + "vite": "4.5.0" } -} \ No newline at end of file +} diff --git a/public/img/background-image.png b/public/img/background-image.png new file mode 100644 index 00000000..358c89af Binary files /dev/null and b/public/img/background-image.png differ diff --git a/public/img/pattern.png b/public/img/pattern.png new file mode 100644 index 00000000..2b34e46f Binary files /dev/null and b/public/img/pattern.png differ diff --git a/public/img/twitter-logo.svg b/public/img/twitter-logo.svg new file mode 100644 index 00000000..ded743c9 --- /dev/null +++ b/public/img/twitter-logo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/configs/charts-config.js b/src/configs/charts-config.js index 92a6ca4f..7c2676dd 100644 --- a/src/configs/charts-config.js +++ b/src/configs/charts-config.js @@ -19,7 +19,7 @@ export const chartsConfig = { }, labels: { style: { - colors: "#fff", + colors: "#37474f", fontSize: "13px", fontFamily: "inherit", fontWeight: 300, @@ -29,7 +29,7 @@ export const chartsConfig = { yaxis: { labels: { style: { - colors: "#fff", + colors: "#37474f", fontSize: "13px", fontFamily: "inherit", fontWeight: 300, @@ -38,7 +38,7 @@ export const chartsConfig = { }, grid: { show: true, - borderColor: "#ffffff40", + borderColor: "#dddddd", strokeDashArray: 5, xaxis: { lines: { diff --git a/src/context/index.jsx b/src/context/MaterialTailwindControllerProvider.jsx similarity index 97% rename from src/context/index.jsx rename to src/context/MaterialTailwindControllerProvider.jsx index 832566d7..bc265f97 100644 --- a/src/context/index.jsx +++ b/src/context/MaterialTailwindControllerProvider.jsx @@ -33,8 +33,8 @@ export function reducer(state, action) { export function MaterialTailwindControllerProvider({ children }) { const initialState = { openSidenav: false, - sidenavColor: "blue", - sidenavType: "dark", + sidenavColor: "red", + sidenavType: "white", transparentNavbar: true, fixedNavbar: false, openConfigurator: false, diff --git a/src/context/index.js b/src/context/index.js new file mode 100644 index 00000000..2d1dd88e --- /dev/null +++ b/src/context/index.js @@ -0,0 +1,2 @@ +export * from "@/context/MaterialTailwindControllerProvider"; +export * from "@/context/themeLanguageProvider"; diff --git a/src/context/themeLanguageProvider.jsx b/src/context/themeLanguageProvider.jsx new file mode 100644 index 00000000..f66a29b9 --- /dev/null +++ b/src/context/themeLanguageProvider.jsx @@ -0,0 +1,54 @@ +import React from 'react'; +import PropTypes from "prop-types"; +import languages from "@/data"; + +// context for the language preference +export const LanguageContext = React.createContext(); + +// a provider for the language preference context +export function LanguageProvider({ children }) { + const defaultLanguage = localStorage.getItem("lang") || "eng"; + const [language, setLanguage] = React.useState(defaultLanguage); + const [languageData, setLanguageData] = React.useState(languages[defaultLanguage].languageData); + const [documentDirection, setDocumentDirection] = React.useState(languages[defaultLanguage].direction); + + // Update the document direction based on the language + React.useEffect(() => { + document.documentElement.dir = documentDirection; + }, [documentDirection]); + + // Function to change the language + const changeLanguage = React.useCallback((newLanguage) => { + localStorage.setItem('lang', newLanguage); + localStorage.setItem('dir', languages[newLanguage].direction); + + // Set language data and direction + setLanguage(newLanguage); + setDocumentDirection(languages[newLanguage].direction); + setLanguageData(languages[newLanguage].languageData); + },[]); + + return ( + + {children} + + ); +} + +// Custom hook to use the language context +export function useLanguage() { + const context = React.useContext(LanguageContext); + + if (!context) { + throw new Error( + "useLanguage must be used within a LanguageProvider" + ); + } + + const { languageData, language, documentDirection, changeLanguage } = context; + return {languageData, language, documentDirection, changeLanguage}; +} + +LanguageProvider.propTypes = { + children: PropTypes.node.isRequired, +}; diff --git a/src/data/authors-table-data.js b/src/data/english/authors-table-data.js similarity index 100% rename from src/data/authors-table-data.js rename to src/data/english/authors-table-data.js diff --git a/src/data/conversations-data.js b/src/data/english/conversations-data.js similarity index 100% rename from src/data/conversations-data.js rename to src/data/english/conversations-data.js diff --git a/src/data/english/index.js b/src/data/english/index.js new file mode 100644 index 00000000..2336742d --- /dev/null +++ b/src/data/english/index.js @@ -0,0 +1,9 @@ +export * from "@/data/english/statistics-cards-data"; +export * from "@/data/english/statistics-charts-data"; +export * from "@/data/english/projects-table-data"; +export * from "@/data/english/orders-overview-data"; +export * from "@/data/english/platform-settings-data"; +export * from "@/data/english/conversations-data"; +export * from "@/data/english/projects-data"; +export * from "@/data/english/authors-table-data"; +export * from "@/data/english/layout-data"; diff --git a/src/data/english/layout-data.js b/src/data/english/layout-data.js new file mode 100644 index 00000000..7fd54735 --- /dev/null +++ b/src/data/english/layout-data.js @@ -0,0 +1,86 @@ +import { ChatBubbleLeftEllipsisIcon, Cog6ToothIcon, HomeIcon } from "@heroicons/react/24/solid"; + +export const layoutData = { + homePage: { + dashboradConfiguratorTitle: "Dashboard Configurator", + dashboradConfiguratorSubtitle: "See our dashboard options.", + dashboradConfiguratorSelectLanguage: "Select Language", + dashboradSidenavColorsTitle: "Sidenav Colors", + dashboradSidenavTypesTitle: "Sidenav Types", + dashboradSidenavTypesSubtitle: "Choose between 3 different sidenav types.", + dashboradSidenavNavbarType: "Navbar Fixed", + projectsHeader: "Projects", + projectsSubHeader: "30 done this month.", + projectsMenuItems: ["Action", "Another action", "something else here"], + projectsTableHeaders: ["companies", "members", "budget", "completion"], + ordersOverviewHeader: "Orders Overview", + ordersOverviewSubHeader: "This month 24%", + }, + profilePage: { + profileName: "Ricahrd Davis", + profileSkill: "CEO / Co-Founder", + tabs:[ + { + value: "app", + icon: HomeIcon, + label: "App", + className: "-mt-1 me-2 inline-block h-5 w-5" + }, + { + value: "message", + icon: ChatBubbleLeftEllipsisIcon, + label: "Message", + className: "-mt-0.5 me-2 inline-block h-5 w-5" + }, + { + value: "settings", + icon: Cog6ToothIcon, + label: "Settings", + className: "-mt-1 me-2 inline-block h-5 w-5" + }, + ], + platformSettings: { + title: "Platform Settings", + action: "Reply", + }, + profileInfoCard: { + title: "Profile Information", + description: "Hi, I'm Alec Thompson, Decisions: If you can't decide, the answer is no. If two equally difficult paths, choose the one more painful in the short term (pain avoidance is creating an illusion of equality).", + details: { + "first name": "Alec M. Thompson", + mobile: "(44) 123 1234 123", + email: "alecthompson@mail.com", + location: "USA", + }, + social: { + facebook: "fa-brands fa-facebook text-blue-700", + twitter: "fa-brands fa-twitter text-blue-400", + instagram: "fa-brands fa-instagram text-purple-500", + }, + action: "Edit Profile", + }, + projects: { + title: "Projects", + subtitle: "Architects design houses", + action: "View Project", + } + }, + "tablesPage": { + authorsTable: { + title: "Authors Table", + tableHeaders: ["Author", "Function", "Status", "Employed", ""], + action: "Edit", + }, + projectsTable: { + title: "Projects Table", + tableHeaders: ["Companies", "Members", "Budget", "Completion", ""], + } + }, + "alertsPage": { + notifications: { + alertsTitle: "Alerts", + alertsDescription: "A simple {color} alert with an {link}. Give it a click if you like.", + alertsIconTitle: "Alerts with Icon", + } + } +} \ No newline at end of file diff --git a/src/data/orders-overview-data.js b/src/data/english/orders-overview-data.js similarity index 81% rename from src/data/orders-overview-data.js rename to src/data/english/orders-overview-data.js index b927916b..d1ba49d9 100644 --- a/src/data/orders-overview-data.js +++ b/src/data/english/orders-overview-data.js @@ -10,37 +10,37 @@ import { export const ordersOverviewData = [ { icon: BellIcon, - color: "text-green-500", + color: "text-blue-gray-300", title: "$2400, Design changes", description: "22 DEC 7:20 PM", }, { icon: PlusCircleIcon, - color: "text-red-500", + color: "text-blue-gray-300", title: "New order #1832412", description: "21 DEC 11 PM", }, { icon: ShoppingCartIcon, - color: "text-blue-500", + color: "text-blue-gray-300", title: "Server payments for April", description: "21 DEC 9:34 PM", }, { icon: CreditCardIcon, - color: "text-orange-500", + color: "text-blue-gray-300", title: "New card added for order #4395133", description: "20 DEC 2:20 AM", }, { icon: LockOpenIcon, - color: "text-pink-500", + color: "text-blue-gray-300", title: "Unlock packages for development", description: "18 DEC 4:54 AM", }, { icon: BanknotesIcon, - color: "text-blue-gray-900", + color: "text-blue-gray-300", title: "New order #9583120", description: "17 DEC", }, diff --git a/src/data/platform-settings-data.js b/src/data/english/platform-settings-data.js similarity index 100% rename from src/data/platform-settings-data.js rename to src/data/english/platform-settings-data.js diff --git a/src/data/projects-data.js b/src/data/english/projects-data.js similarity index 100% rename from src/data/projects-data.js rename to src/data/english/projects-data.js diff --git a/src/data/projects-table-data.js b/src/data/english/projects-table-data.js similarity index 100% rename from src/data/projects-table-data.js rename to src/data/english/projects-table-data.js diff --git a/src/data/statistics-cards-data.js b/src/data/english/statistics-cards-data.js similarity index 88% rename from src/data/statistics-cards-data.js rename to src/data/english/statistics-cards-data.js index a2496d4b..d470e708 100644 --- a/src/data/statistics-cards-data.js +++ b/src/data/english/statistics-cards-data.js @@ -1,13 +1,13 @@ import { BanknotesIcon, UserPlusIcon, - UserIcon, + UsersIcon, ChartBarIcon, } from "@heroicons/react/24/solid"; export const statisticsCardsData = [ { - color: "blue", + color: "gray", icon: BanknotesIcon, title: "Today's Money", value: "$53k", @@ -18,8 +18,8 @@ export const statisticsCardsData = [ }, }, { - color: "pink", - icon: UserIcon, + color: "gray", + icon: UsersIcon, title: "Today's Users", value: "2,300", footer: { @@ -29,7 +29,7 @@ export const statisticsCardsData = [ }, }, { - color: "green", + color: "gray", icon: UserPlusIcon, title: "New Clients", value: "3,462", @@ -40,7 +40,7 @@ export const statisticsCardsData = [ }, }, { - color: "orange", + color: "gray", icon: ChartBarIcon, title: "Sales", value: "$103,430", diff --git a/src/data/statistics-charts-data.js b/src/data/english/statistics-charts-data.js similarity index 70% rename from src/data/statistics-charts-data.js rename to src/data/english/statistics-charts-data.js index 1d734db5..15a36464 100644 --- a/src/data/statistics-charts-data.js +++ b/src/data/english/statistics-charts-data.js @@ -11,7 +11,7 @@ const websiteViewsChart = { ], options: { ...chartsConfig, - colors: "#fff", + colors: "#388e3c", plotOptions: { bar: { columnWidth: "16%", @@ -36,7 +36,7 @@ const dailySalesChart = { ], options: { ...chartsConfig, - colors: ["#fff"], + colors: ["#0288d1"], stroke: { lineCap: "round", }, @@ -60,8 +60,42 @@ const dailySalesChart = { }, }; +const completedTaskChart = { + type: "line", + height: 220, + series: [ + { + name: "Sales", + data: [50, 40, 300, 320, 500, 350, 200, 230, 500], + }, + ], + options: { + ...chartsConfig, + colors: ["#388e3c"], + stroke: { + lineCap: "round", + }, + markers: { + size: 5, + }, + xaxis: { + ...chartsConfig.xaxis, + categories: [ + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", + ], + }, + }, +}; const completedTasksChart = { - ...dailySalesChart, + ...completedTaskChart, series: [ { name: "Tasks", @@ -72,21 +106,21 @@ const completedTasksChart = { export const statisticsChartsData = [ { - color: "blue", + color: "white", title: "Website View", description: "Last Campaign Performance", footer: "campaign sent 2 days ago", chart: websiteViewsChart, }, { - color: "pink", + color: "white", title: "Daily Sales", description: "15% increase in today sales", footer: "updated 4 min ago", chart: dailySalesChart, }, { - color: "green", + color: "white", title: "Completed Tasks", description: "Last Campaign Performance", footer: "just updated", diff --git a/src/data/index.js b/src/data/index.js index 7ca52a08..59e86615 100644 --- a/src/data/index.js +++ b/src/data/index.js @@ -1,8 +1,16 @@ -export * from "@/data/statistics-cards-data"; -export * from "@/data/statistics-charts-data"; -export * from "@/data/projects-table-data"; -export * from "@/data/orders-overview-data"; -export * from "@/data/platform-settings-data"; -export * from "@/data/conversations-data"; -export * from "@/data/projects-data"; -export * from "@/data/authors-table-data"; +import langs from "./languages"; + +const languages = { + eng: { + lang: "eng", + languageData: langs["eng"], + direction: "ltr" + }, + fa: { + lang: "fa", + languageData: langs["fa"], + direction: "rtl" + } +}; + +export default languages; diff --git a/src/data/languages.js b/src/data/languages.js new file mode 100644 index 00000000..fa0681c1 --- /dev/null +++ b/src/data/languages.js @@ -0,0 +1,50 @@ +import { + authorsTableData as enAuthorsTableData, + conversationsData as enConversationsData, + layoutData as enLayoutData, + ordersOverviewData as enOrdersOverviewData, + platformSettingsData as enPlatformSettingsData, + projectsData as enProjectsData, + projectsTableData as enProjectsTableData, + statisticsCardsData as enStatisticsCardsData, + statisticsChartsData as enStatisticsChartsData +} from "./english"; + +import { + authorsTableData as faAuthorsTableData, + conversationsData as faConversationsData, + layoutData as faLayoutData, + ordersOverviewData as faOrdersOverviewData, + platformSettingsData as faPlatformSettingsData, + projectsData as faProjectsData, + projectsTableData as faProjectsTableData, + statisticsCardsData as faStatisticsCardsData, + statisticsChartsData as faStatisticsChartsData +} from "./persian"; + +const languages = { + "eng": { + authorsTableData: enAuthorsTableData, + conversationsData: enConversationsData, + layoutData: enLayoutData, + ordersOverviewData: enOrdersOverviewData, + platformSettingsData: enPlatformSettingsData, + projectsData: enProjectsData, + projectsTableData: enProjectsTableData, + statisticsCardsData: enStatisticsCardsData, + statisticsChartsData: enStatisticsChartsData + }, + "fa": { + authorsTableData: faAuthorsTableData, + conversationsData: faConversationsData, + layoutData: faLayoutData, + ordersOverviewData: faOrdersOverviewData, + platformSettingsData: faPlatformSettingsData, + projectsData: faProjectsData, + projectsTableData: faProjectsTableData, + statisticsCardsData: faStatisticsCardsData, + statisticsChartsData: faStatisticsChartsData + } +} + +export default languages; \ No newline at end of file diff --git a/src/data/persian/authors-table-data.js b/src/data/persian/authors-table-data.js new file mode 100644 index 00000000..66cd85ae --- /dev/null +++ b/src/data/persian/authors-table-data.js @@ -0,0 +1,52 @@ +export const authorsTableData = [ + { + img: "/img/team-2.jpeg", + name: "جان میکاییل", + email: "john@creative-tim.com", + job: ["مدیر", "سازمان"], + online: true, + date: "1402/01/01", + }, + { + img: "/img/team-1.jpeg", + name: "الکس لیراس", + email: "alexa@creative-tim.com", + job: ["برنامه‌نویس", "توسعه‌دهنده"], + online: false, + date: "1402/01/01", + }, + { + img: "/img/team-4.jpeg", + name: "لارنت پریِر", + email: "laurent@creative-tim.com", + job: ["مدیرارجایی", "پروژه‌ها"], + online: true, + date: "1401/01/01", + }, + { + img: "/img/team-3.jpeg", + name: "میکاییل لوی", + email: "michael@creative-tim.com", + job: ["برنامه‌پرداز", "توسعه‌دهنده"], + online: true, + date: "1403/01/02", + }, + { + img: "/img/bruce-mars.jpeg", + name: "بروس مارس", + email: "bruce@creative-tim.com", + job: ["مدیر", "مدیراجرایی"], + online: false, + date: "1401/02/03", + }, + { + img: "/img/team-2.jpeg", + name: "الکساندر", + email: "alexander@creative-tim.com", + job: ["برنامه‌نویس", "توسعه‌دهنده"], + online: false, + date: "1402/09/20", + }, +]; + +export default authorsTableData; diff --git a/src/data/persian/conversations-data.js b/src/data/persian/conversations-data.js new file mode 100644 index 00000000..e7797f35 --- /dev/null +++ b/src/data/persian/conversations-data.js @@ -0,0 +1,29 @@ +export const conversationsData = [ + { + img: "/img/team-1.jpeg", + name: "صوفی بی.", + message: "سلام! من نیاز به اطلاعات بیشتر دارم...", + }, + { + img: "/img/team-2.jpeg", + name: "الکساندر", + message: "کار فوق العاده ای، آیا می توانید...", + }, + { + img: "/img/team-3.jpeg", + name: "ایوانا", + message: "درباره فایل ها می توانم...", + }, + { + img: "/img/team-4.jpeg", + name: "پیترسون", + message: "عصر خوبی داشته باشید...", + }, + { + img: "/img/bruce-mars.jpeg", + name: "بروس مارس", + message: "سلام! من نیاز به اطلاعات بیشتر دارم...", + }, +]; + +export default conversationsData; diff --git a/src/data/persian/index.js b/src/data/persian/index.js new file mode 100644 index 00000000..815e42a3 --- /dev/null +++ b/src/data/persian/index.js @@ -0,0 +1,9 @@ +export * from "@/data/persian/statistics-cards-data"; +export * from "@/data/persian/statistics-charts-data"; +export * from "@/data/persian/projects-table-data"; +export * from "@/data/persian/orders-overview-data"; +export * from "@/data/persian/platform-settings-data"; +export * from "@/data/persian/conversations-data"; +export * from "@/data/persian/projects-data"; +export * from "@/data/persian/authors-table-data"; +export * from "@/data/persian/layout-data"; diff --git a/src/data/persian/layout-data.js b/src/data/persian/layout-data.js new file mode 100644 index 00000000..60c34f90 --- /dev/null +++ b/src/data/persian/layout-data.js @@ -0,0 +1,86 @@ +import { ChatBubbleLeftEllipsisIcon, Cog6ToothIcon, HomeIcon } from "@heroicons/react/24/solid"; + +export const layoutData = { + homePage: { + dashboradConfiguratorTitle: "تنظیمات داشبورد", + dashboradConfiguratorSubtitle: "گزینه‌های داشبورد ما را ببینید.", + dashboradConfiguratorSelectLanguage: "انتخاب زبان", + dashboradSidenavColorsTitle: "رنگ‌های نوارکناری", + dashboradSidenavTypesTitle: "انواع نوارکناری", + dashboradSidenavTypesSubtitle: "یکی از سه نوع نوارکناری را انتخاب کنید.", + dashboradSidenavNavbarType: "هدر ثابت", + projectsHeader: "پروژه‌ها", + projectsSubHeader: "این ماه 30 پروژه انجام شده است.", + projectsMenuItems: ["اقدام", "اقدامی دیگر", "یک اقدام دیگر"], + projectsTableHeaders: ["شرکتها", "اعضا", "بودجه", "تکمیل"], + ordersOverviewHeader: "نگاهی بر سفارش‌ها", + ordersOverviewSubHeader: "این ماه 24 درصد", + }, + profilePage: { + profileName: "ریچارد داویس", + profileSkill: "سئو / هم‌بنیان‌گذار", + tabs:[ + { + value: "app", + icon: HomeIcon, + label: "اپ", + className: "-mt-1 me-2 inline-block h-5 w-5" + }, + { + value: "message", + icon: ChatBubbleLeftEllipsisIcon, + label: "پیام", + className: "-mt-0.5 me-2 inline-block h-5 w-5" + }, + { + value: "settings", + icon: Cog6ToothIcon, + label: "تنظیمات", + className: "-mt-1 me-2 inline-block h-5 w-5" + }, + ], + platformSettings: { + title: "تنظیمات پلتفرم", + action: "پاسخ", + }, + profileInfoCard: { + title: "اطلاعات پروفایل", + description: "سلام، من الک تامپسون هستم، تصمیم‌گیری: اگر نمی‌توانید تصمیم بگیرید، پاسخ خیر است. اگر دو مسیر به یکسان سخت باشند، مسیری را انتخاب کنید که در کوتاه مدت دردناک‌تر است (اجتناب از درد، ایجاد یک توهم برابری است).", + details: { + "نام": "الک ام. تامپسون", + "موبایل": "(44) 123 1234 123", + "ایمیل": "alecthompson@mail.com", + "موقعیت مکانی": "ایالات متحده آمریکا", + }, + social: { + facebook: "fa-brands fa-facebook text-blue-700", + twitter: "fa-brands fa-twitter text-blue-400", + instagram: "fa-brands fa-instagram text-purple-500", + }, + action: "ویرایش پروفایل", + }, + projects: { + title: "پروژه‌ها", + subtitle: "معماران خانه‌ها را طراحی می‌کنند", + action: "مشاهده پروژه", + } + }, + "tablesPage": { + authorsTable: { + title: "جدول نویسندگان", + tableHeaders: ["نویسنده", "تابع", "وضعیت", "استخدام شده", ""], + action: "ویرایش" + }, + projectsTable: { + title: "جدول پروژه‌ها", + tableHeaders: ["شرکت‌ها", "اعضا", "بودجه", "پیشرفت", ""], + } + }, + "alertsPage": { + notifications: { + aalertsTitle: "هشدارها", + alertsDescription: "یک هشدار ساده {color} با یک {link}. اگر دوست دارید روی آن کلیک کنید.", + alertsIconTitle: "هشدارها با آیکون", + } + } +} \ No newline at end of file diff --git a/src/data/persian/orders-overview-data.js b/src/data/persian/orders-overview-data.js new file mode 100644 index 00000000..64be0112 --- /dev/null +++ b/src/data/persian/orders-overview-data.js @@ -0,0 +1,49 @@ +import { + BellIcon, + PlusCircleIcon, + ShoppingCartIcon, + CreditCardIcon, + LockOpenIcon, + BanknotesIcon, +} from "@heroicons/react/24/solid"; + +export const ordersOverviewData = [ + { + icon: BellIcon, + color: "text-blue-gray-300", + title: "2400 دلار، تغییرات طراحی", + description: "22 دسامبر 7:20 بعد از ظهر", + }, + { + icon: PlusCircleIcon, + color: "text-blue-gray-300", + title: "سفارش جدید #1832412", + description: "21 دسامبر 11 بعد از ظهر", + }, + { + icon: ShoppingCartIcon, + color: "text-blue-gray-300", + title: "پرداخت های سرور برای آوریل", + description: "21 دسامبر 9:34 بعد از ظهر", + }, + { + icon: CreditCardIcon, + color: "text-blue-gray-300", + title: "کارت جدید اضافه شده برای سفارش #4395133", + description: "20 دسامبر 2:20 صبح", + }, + { + icon: LockOpenIcon, + color: "text-blue-gray-300", + title: "بسته ها را برای توسعه باز کنید", + description: "18 دسامبر 4:54 صبح", + }, + { + icon: BanknotesIcon, + color: "text-blue-gray-300", + title: "سفارش جدید #9583120", + description: "17 دسامبر", + }, +]; + +export default ordersOverviewData; diff --git a/src/data/persian/platform-settings-data.js b/src/data/persian/platform-settings-data.js new file mode 100644 index 00000000..1de0d52c --- /dev/null +++ b/src/data/persian/platform-settings-data.js @@ -0,0 +1,38 @@ +export const platformSettingsData = [ + { + title: "حساب", + options: [ + { + checked: true, + label: "وقتی کسی من را دنبال می کند به من ایمیل بزن", + }, + { + checked: false, + label: "وقتی کسی به پست من پاسخ می دهد به من ایمیل بزن", + }, + { + checked: true, + label: "وقتی کسی من را می گوید به من ایمیل بزن", + }, + ], + }, + { + title: "برنامه", + options: [ + { + checked: false, + label: "راه اندازی ها و پروژه های جدید", + }, + { + checked: true, + label: "به روزرسانی ماهانه محصول", + }, + { + checked: false, + label: "مشترک خبرنامه شوید", + }, + ], + }, +]; + +export default platformSettingsData; diff --git a/src/data/persian/projects-data.js b/src/data/persian/projects-data.js new file mode 100644 index 00000000..59bd693d --- /dev/null +++ b/src/data/persian/projects-data.js @@ -0,0 +1,60 @@ +export const projectsData = [ + { + img: "/img/home-decor-1.jpeg", + title: "مدرن", + tag: "پروژه #1", + description: + "همانطور که اوبر از طریق مقدار زیادی از آشفتگی مدیریت داخلی کار می کند.", + route: "/dashboard/profile", + members: [ + { img: "/img/team-1.jpeg", name: "رومینا حدید" }, + { img: "/img/team-2.jpeg", name: "رایان تامپسون" }, + { img: "/img/team-3.jpeg", name: "جسیکا دو" }, + { img: "/img/team-4.jpeg", name: "الکساندر اسمیت" }, + ], + }, + { + img: "/img/home-decor-2.jpeg", + title: "اسکاندیناوی", + tag: "پروژه #2", + description: + "موسیقی چیزی است که هر فرد نظر خاص خود را در مورد آن دارد.", + route: "/dashboard/profile", + members: [ + { img: "/img/team-4.jpeg", name: "الکساندر اسمیت" }, + { img: "/img/team-3.jpeg", name: "جسیکا دو" }, + { img: "/img/team-2.jpeg", name: "رایان تامپسون" }, + { img: "/img/team-1.jpeg", name: "رومینا حدید" }, + ], + }, + { + img: "/img/home-decor-3.jpeg", + title: "مینیمالیست", + tag: "پروژه #3", + description: + "افراد مختلف طعم متفاوتی دارند و انواع مختلفی از موسیقی وجود دارد.", + route: "/dashboard/profile", + members: [ + { img: "/img/team-1.jpeg", name: "رومینا حدید" }, + { img: "/img/team-2.jpeg", name: "رایان تامپسون" }, + { img: "/img/team-3.jpeg", name: "جسیکا دو" }, + { img: "/img/team-4.jpeg", name: "الکساندر اسمیت" }, + ], + }, + { + img: "/img/home-decor-4.jpeg", + title: "گوتیک", + tag: "پروژه #4", + description: + "چرا کسی باید آبی را بر روی صورتی انتخاب کند؟ صورتی آشکارا رنگ بهتری است.", + route: "/dashboard/profile", + members: [ + { img: "/img/team-4.jpeg", name: "الکساندر اسمیت" }, + { img: "/img/team-3.jpeg", name: "جسیکا دو" }, + { img: "/img/team-2.jpeg", name: "رایان تامپسون" }, + { img: "/img/team-1.jpeg", name: "رومینا حدید" }, + ], + }, +]; + +export default projectsData; diff --git a/src/data/persian/projects-table-data.js b/src/data/persian/projects-table-data.js new file mode 100644 index 00000000..547ea567 --- /dev/null +++ b/src/data/persian/projects-table-data.js @@ -0,0 +1,65 @@ +export const projectsTableData = [ + { + img: "/img/logo-xd.svg", + name: "نسخه XD متریال", + members: [ + { img: "/img/team-1.jpeg", name: "رومینا حدید" }, + { img: "/img/team-2.jpeg", name: "رایان تامپسون" }, + { img: "/img/team-3.jpeg", name: "جسیکا دو" }, + { img: "/img/team-4.jpeg", name: "الکساندر اسمیت" }, + ], + budget: "$14,000", + completion: 60, + }, + { + img: "/img/logo-atlassian.svg", + name: "اضافه کردن پیگیری پیشرفت", + members: [ + { img: "/img/team-2.jpeg", name: "رایان تامپسون" }, + { img: "/img/team-4.jpeg", name: "الکساندر اسمیت" }, + ], + budget: "$3,000", + completion: 10, + }, + { + img: "/img/logo-slack.svg", + name: "رفع خطاهای پلتفرم", + members: [ + { img: "/img/team-3.jpeg", name: "جسیکا دو" }, + { img: "/img/team-1.jpeg", name: "رومینا حدید" }, + ], + budget: "تنظیم نشده", + completion: 100, + }, + { + img: "/img/logo-spotify.svg", + name: "راه اندازی برنامه موبایل ما", + members: [ + { img: "/img/team-4.jpeg", name: "الکساندر اسمیت" }, + { img: "/img/team-3.jpeg", name: "جسیکا دو" }, + { img: "/img/team-2.jpeg", name: "رایان تامپسون" }, + { img: "/img/team-1.jpeg", name: "رومینا حدید" }, + ], + budget: "$20,500", + completion: 100, + }, + { + img: "/img/logo-jira.svg", + name: "اضافه کردن صفحه قیمت جدید", + members: [{ img: "/img/team-4.jpeg", name: "الکساندر اسمیت" }], + budget: "$500", + completion: 25, + }, + { + img: "/img/logo-invision.svg", + name: "طراحی مجدد فروشگاه آنلاین جدید", + members: [ + { img: "/img/team-1.jpeg", name: "رومینا حدید" }, + { img: "/img/team-4.jpeg", name: "الکساندر اسمیت" }, + ], + budget: "$2,000", + completion: 40, + }, +]; + +export default projectsTableData; diff --git a/src/data/persian/statistics-cards-data.js b/src/data/persian/statistics-cards-data.js new file mode 100644 index 00000000..479d2337 --- /dev/null +++ b/src/data/persian/statistics-cards-data.js @@ -0,0 +1,55 @@ +import { + BanknotesIcon, + UserPlusIcon, + UsersIcon, + ChartBarIcon, +} from "@heroicons/react/24/solid"; + +export const statisticsCardsData = [ + { + color: "gray", + icon: BanknotesIcon, + title: "پول امروز", + value: "$53k", + footer: { + color: "text-green-500", + value: "55%+", + label: "نسبت به هفته گذشته", + }, + }, + { + color: "gray", + icon: UsersIcon, + title: "کاربران امروز", + value: "2,300", + footer: { + color: "text-green-500", + value: "3%+", + label: "نسبت به ماه گذشته", + }, + }, + { + color: "gray", + icon: UserPlusIcon, + title: "مشتریان جدید", + value: "3,462", + footer: { + color: "text-red-500", + value: "2%-", + label: "نسبت به دیروز", + }, + }, + { + color: "gray", + icon: ChartBarIcon, + title: "فروش", + value: "$103,430", + footer: { + color: "text-green-500", + value: "5%+", + label: "نسبت به دیروز", + }, + }, +]; + +export default statisticsCardsData; diff --git a/src/data/persian/statistics-charts-data.js b/src/data/persian/statistics-charts-data.js new file mode 100644 index 00000000..8e3dd549 --- /dev/null +++ b/src/data/persian/statistics-charts-data.js @@ -0,0 +1,131 @@ +import { chartsConfig } from "@/configs"; + +const websiteViewsChart = { + type: "bar", + height: 220, + series: [ + { + name: "بازدیدها", + data: [50, 20, 10, 22, 50, 10, 40], + }, + ], + options: { + ...chartsConfig, + colors: "#388e3c", + plotOptions: { + bar: { + columnWidth: "16%", + borderRadius: 5, + }, + }, + xaxis: { + ...chartsConfig.xaxis, + categories: ["د", "س", "چ", "پ", "ج", "ش", "ی"], + }, + }, +}; + +const dailySalesChart = { + type: "line", + height: 220, + series: [ + { + name: "فروش", + data: [50, 40, 300, 320, 500, 350, 200, 230, 500], + }, + ], + options: { + ...chartsConfig, + colors: ["#0288d1"], + stroke: { + lineCap: "round", + }, + markers: { + size: 5, + }, + xaxis: { + ...chartsConfig.xaxis, + categories: [ + "آوریل", + "می", + "ژوئن", + "ژوئیه", + "آگوست", + "سپتامبر", + "اکتبر", + "نوامبر", + "دسامبر", + ], + }, + }, +}; + +const completedTaskChart = { + type: "line", + height: 220, + series: [ + { + name: "فروش", + data: [50, 40, 300, 320, 500, 350, 200, 230, 500], + }, + ], + options: { + ...chartsConfig, + colors: ["#388e3c"], + stroke: { + lineCap: "round", + }, + markers: { + size: 5, + }, + xaxis: { + ...chartsConfig.xaxis, + categories: [ + "آوریل", + "می", + "ژوئن", + "ژوئیه", + "آگوست", + "سپتامبر", + "اکتبر", + "نوامبر", + "دسامبر", + ], + }, + }, +}; +const completedTasksChart = { + ...completedTaskChart, + series: [ + { + name: "وظایف", + data: [50, 40, 300, 220, 500, 250, 400, 230, 500], + }, + ], +}; + +export const statisticsChartsData = [ + { + color: "white", + title: "بازدید وبسایت", + description: "عملکرد آخرین کمپین", + footer: "کمپین 2 روز پیش ارسال شد", + chart: websiteViewsChart, + }, + { + color: "white", + title: "فروش روزانه", + description: "افزایش 15٪ در فروش امروز", + footer: "4 دقیقه پیش به روز شد", + chart: dailySalesChart, + }, + { + color: "white", + title: "وظایف انجام شده", + description: "عملکرد آخرین کمپین", + footer: "همین الان به روز شد", + chart: completedTasksChart, + }, +]; + +export default statisticsChartsData; diff --git a/src/layouts/auth.jsx b/src/layouts/auth.jsx index 0741a741..c7a21165 100644 --- a/src/layouts/auth.jsx +++ b/src/layouts/auth.jsx @@ -34,9 +34,6 @@ export function Auth() { return (
-
- -
{routes.map( ({ layout, pages }) => @@ -46,9 +43,6 @@ export function Auth() { )) )} -
-
); } diff --git a/src/layouts/dashboard.jsx b/src/layouts/dashboard.jsx index 888a627a..961b373f 100644 --- a/src/layouts/dashboard.jsx +++ b/src/layouts/dashboard.jsx @@ -8,21 +8,22 @@ import { Footer, } from "@/widgets/layout"; import routes from "@/routes"; -import { useMaterialTailwindController, setOpenConfigurator } from "@/context"; +import { useMaterialTailwindController, setOpenConfigurator, useLanguage } from "@/context"; export function Dashboard() { const [controller, dispatch] = useMaterialTailwindController(); + const { documentDirection, language } = useLanguage(); const { sidenavType } = controller; return (
-
+
- {routes.map( + {routes[language].map( ({ layout, pages }) => layout === "dashboard" && pages.map(({ path, element }) => ( diff --git a/src/main.jsx b/src/main.jsx index 26c7fe48..bce5e25b 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,29 +1,34 @@ /** ========================================================= -* Material Tailwind Dashboard React - v2.0.0 +* Material Tailwind Dashboard React - v2.1.0 ========================================================= * Product Page: https://www.creative-tim.com/product/material-tailwind-dashboard-react -* Copyright 2022 Creative Tim (https://www.creative-tim.com) +* Copyright 2023 Creative Tim (https://www.creative-tim.com) * Licensed under MIT (https://github.com/creativetimofficial/material-tailwind-dashboard-react/blob/main/LICENSE.md) * Coded by Creative Tim ========================================================= * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. */ -import React from "react"; +import React, { Suspense } from "react"; import ReactDOM from "react-dom/client"; import App from "./App"; import { BrowserRouter } from "react-router-dom"; import { ThemeProvider } from "@material-tailwind/react"; -import { MaterialTailwindControllerProvider } from "@/context"; +import { LanguageProvider, MaterialTailwindControllerProvider } from "@/context"; import "../public/css/tailwind.css"; + ReactDOM.createRoot(document.getElementById("root")).render( - - - + + + + + + + diff --git a/src/pages/auth/sign-in.jsx b/src/pages/auth/sign-in.jsx index 3afe70f3..3b3da41a 100644 --- a/src/pages/auth/sign-in.jsx +++ b/src/pages/auth/sign-in.jsx @@ -1,62 +1,125 @@ -import { Link } from "react-router-dom"; import { Card, - CardHeader, - CardBody, - CardFooter, Input, Checkbox, Button, Typography, } from "@material-tailwind/react"; +import { Link } from "react-router-dom"; + export function SignIn() { return ( - <> - -
-
- - - - Sign In +
+
+
+ Sign In + Enter your email and password to Sign In. +
+
+
+ + Your email - - - - -
- -
-
- - - - Don't have an account? - + + + Password + + +
+ + I agree the  + + Terms and Conditions + + + } + containerProps={{ className: "-ml-2.5" }} + /> + + +
+ - Sign up + Subscribe me to newsletter - + } + containerProps={{ className: "-ml-2.5" }} + /> + + + Forgot Password + - - +
+
+ + +
+ + Not registered? + Create account + + + +
+
+
- + +
); } diff --git a/src/pages/auth/sign-up.jsx b/src/pages/auth/sign-up.jsx index 916fd296..5f040d04 100644 --- a/src/pages/auth/sign-up.jsx +++ b/src/pages/auth/sign-up.jsx @@ -1,63 +1,93 @@ -import { Link } from "react-router-dom"; import { Card, - CardHeader, - CardBody, - CardFooter, Input, Checkbox, Button, Typography, } from "@material-tailwind/react"; +import { Link } from "react-router-dom"; + export function SignUp() { return ( - <> - -
-
- - - - Sign Up +
+
+ +
+
+
+ Join Us Today + Enter your email and password to register. +
+
+
+ + Your email - - - - - -
- -
-
- - - - Already have an account? - - +
+ + I agree the  + - Sign in - - - - - + Terms and Conditions + + + } + containerProps={{ className: "-ml-2.5" }} + /> + + +
+ + +
+ + Already have an account? + Sign in + + +
- +
); } diff --git a/src/pages/dashboard/home.jsx b/src/pages/dashboard/home.jsx index 73d74b55..2f653a35 100644 --- a/src/pages/dashboard/home.jsx +++ b/src/pages/dashboard/home.jsx @@ -14,25 +14,21 @@ import { Progress, } from "@material-tailwind/react"; import { - ClockIcon, - CheckIcon, EllipsisVerticalIcon, ArrowUpIcon, } from "@heroicons/react/24/outline"; import { StatisticsCard } from "@/widgets/cards"; import { StatisticsChart } from "@/widgets/charts"; -import { - statisticsCardsData, - statisticsChartsData, - projectsTableData, - ordersOverviewData, -} from "@/data"; +import { CheckCircleIcon, ClockIcon } from "@heroicons/react/24/solid"; +import { useLanguage } from "@/context"; export function Home() { + const { languageData, documentDirection } = useLanguage(); + return (
- {statisticsCardsData.map(({ icon, title, footer, ...rest }) => ( + {languageData.statisticsCardsData.map(({ icon, title, footer, ...rest }) => (
- {statisticsChartsData.map((props) => ( + {languageData.statisticsChartsData.map((props) => ( - +  {props.footer} } @@ -67,7 +63,7 @@ export function Home() { ))}
- +
- Projects + {languageData.layoutData.homePage.projectsHeader} - - 30 done this month + + {languageData.layoutData.homePage.projectsSubHeader}
@@ -97,9 +93,13 @@ export function Home() { - Action - Another Action - Something else here + { + languageData.layoutData.homePage.projectsMenuItems.map( + (item => + {item} + ) + ) + }
@@ -107,11 +107,12 @@ export function Home() { - {["companies", "members", "budget", "completion"].map( + {languageData.layoutData.homePage.projectsTableHeaders.map( (el) => ( - {projectsTableData.map( + {languageData.projectsTableData.map( ({ img, name, members, budget, completion }, key) => { const className = `py-3 px-5 ${ - key === projectsTableData.length - 1 + key === languageData.projectsTableData.length - 1 ? "" : "border-b border-blue-gray-50" }`; @@ -194,7 +195,7 @@ export function Home() {
- + - Orders Overview + {languageData.layoutData.homePage.ordersOverviewHeader} - 24% this month + {languageData.layoutData.homePage.ordersOverviewSubHeader} - {ordersOverviewData.map( + {languageData.ordersOverviewData.map( ({ icon, color, title, description }, key) => (
@@ -33,19 +37,16 @@ export function Notifications() { className="m-0 p-4" > - Alerts + {alertsTitle} {alerts.map((color) => ( - setShowAlerts((current) => ({ ...current, [color]: false })), - }} + onClose={() => setShowAlerts((current) => ({ ...current, [color]: false }))} > A simple {color} alert with an example link. Give it a click if you like. @@ -61,25 +62,22 @@ export function Notifications() { className="m-0 p-4" > - Alerts with Icon + {alertsIconTitle} {alerts.map((color) => ( } - dismissible={{ - onClose: () => - setShowAlertsWithIcon((current) => ({ - ...current, - [color]: false, - })), - }} + onClose={() => setShowAlertsWithIcon((current) => ({ + ...current, + [color]: false, + }))} > A simple {color} alert with an example link. Give it a click if you like. diff --git a/src/pages/dashboard/profile.jsx b/src/pages/dashboard/profile.jsx index c5320fe8..e8d762f1 100644 --- a/src/pages/dashboard/profile.jsx +++ b/src/pages/dashboard/profile.jsx @@ -12,59 +12,54 @@ import { Tooltip, Button, } from "@material-tailwind/react"; -import { - HomeIcon, - ChatBubbleLeftEllipsisIcon, - Cog6ToothIcon, - PencilIcon, -} from "@heroicons/react/24/solid"; +import { PencilIcon } from "@heroicons/react/24/solid"; import { Link } from "react-router-dom"; import { ProfileInfoCard, MessageCard } from "@/widgets/cards"; -import { platformSettingsData, conversationsData, projectsData } from "@/data"; +import { conversationsData, projectsData } from "@/data/english"; +import { useLanguage } from "@/context"; export function Profile() { + const { languageData, documentDirection } = useLanguage(); + const { title, description, details, social, action } = languageData.layoutData.profilePage.profileInfoCard; + return ( <> -
-
+
+
- + -
+
- Richard Davis + {languageData.layoutData.profilePage.profileName} - CEO / Co-Founder + {languageData.layoutData.profilePage.profileSkill}
- - - App - - - - Message - - - - Settings - + {languageData.layoutData.profilePage.tabs.map( + ({ value, icon: Icon, label, className }) => ( + + + {label} + + ))}
@@ -72,10 +67,10 @@ export function Profile() {
- Platform Settings + {languageData.layoutData.profilePage.platformSettings.title}
- {platformSettingsData.map(({ title, options }) => ( + {languageData.platformSettingsData.map(({ title, options }) => (
{title} @@ -88,7 +83,7 @@ export function Profile() { label={label} defaultChecked={checked} labelProps={{ - className: "text-sm font-normal text-blue-gray-500", + className: `text-sm ${documentDirection === "rtl" && 'ps-2'} font-normal text-blue-gray-500`, }} /> ))} @@ -98,39 +93,27 @@ export function Profile() {
- - - -
- ), - }} + title={title} + description={description} + details={details} action={ - + } />
- Platform Settings + {languageData.layoutData.profilePage.platformSettings.title}
    - {conversationsData.map((props) => ( + {languageData.conversationsData.map((props) => ( - reply + {languageData.layoutData.profilePage.platformSettings.action} } /> @@ -140,16 +123,16 @@ export function Profile() {
- Projects + {languageData.layoutData.profilePage.projects.title} - Architects design houses + {languageData.layoutData.profilePage.projects.subtitle}
- {projectsData.map( + {languageData.projectsData.map( ({ img, title, description, tag, route, members }) => (
diff --git a/src/pages/dashboard/tables.jsx b/src/pages/dashboard/tables.jsx index 8c5b1570..44b840a7 100644 --- a/src/pages/dashboard/tables.jsx +++ b/src/pages/dashboard/tables.jsx @@ -9,25 +9,30 @@ import { Progress, } from "@material-tailwind/react"; import { EllipsisVerticalIcon } from "@heroicons/react/24/outline"; -import { authorsTableData, projectsTableData } from "@/data"; +import { authorsTableData, projectsTableData } from "@/data/english"; +import { useLanguage } from "@/context"; export function Tables() { + const { languageData, documentDirection } = useLanguage(); + const { title, tableHeaders, action } = languageData.layoutData.tablesPage.authorsTable; + const { title: projectsTableTitle, tableHeaders:projectsTableHeaders } = languageData.layoutData.tablesPage.projectsTable; return (
- + - Authors Table + {title} - {["author", "function", "status", "employed", ""].map((el) => ( + {tableHeaders.map((el) => ( - {authorsTableData.map( + {languageData.authorsTableData.map( ({ img, name, email, job, online, date }, key) => { const className = `py-3 px-5 ${ key === authorsTableData.length - 1 @@ -52,7 +57,7 @@ export function Tables() { @@ -106,16 +111,16 @@ export function Tables() { - + - Projects Table + {projectsTableTitle}
- +
@@ -94,7 +99,7 @@ export function Tables() { href="#" className="text-xs font-semibold text-blue-gray-600" > - Edit + {action}
- {["companies", "members", "budget", "completion", ""].map( + {projectsTableHeaders.map( (el) => ( - {projectsTableData.map( + {languageData.projectsTableData.map( ({ img, name, members, budget, completion }, key) => { const className = `py-3 px-5 ${ key === projectsTableData.length - 1 @@ -189,7 +194,7 @@ export function Tables() { diff --git a/src/routes.jsx b/src/routes.jsx index 28da8686..846857a3 100644 --- a/src/routes.jsx +++ b/src/routes.jsx @@ -2,9 +2,9 @@ import { HomeIcon, UserCircleIcon, TableCellsIcon, - BellIcon, - ArrowRightOnRectangleIcon, - UserPlusIcon, + InformationCircleIcon, + ServerStackIcon, + RectangleStackIcon, } from "@heroicons/react/24/solid"; import { Home, Profile, Tables, Notifications } from "@/pages/dashboard"; import { SignIn, SignUp } from "@/pages/auth"; @@ -13,7 +13,8 @@ const icon = { className: "w-5 h-5 text-inherit", }; -export const routes = [ +export const routes = { + "eng": [ { layout: "dashboard", pages: [ @@ -36,9 +37,9 @@ export const routes = [ element: , }, { - icon: , - name: "notifactions", - path: "/notifactions", + icon: , + name: "notifications", + path: "/notifications", element: , }, ], @@ -48,19 +49,69 @@ export const routes = [ layout: "auth", pages: [ { - icon: , + icon: , name: "sign in", path: "/sign-in", element: , }, { - icon: , + icon: , name: "sign up", path: "/sign-up", element: , }, ], }, -]; + ], + "fa": [ + { + layout: "dashboard", + pages: [ + { + icon: , + name: "داشبورد", + path: "/home", + element: , + }, + { + icon: , + name: "پروفایل", + path: "/profile", + element: , + }, + { + icon: , + name: "جداول", + path: "/tables", + element: , + }, + { + icon: , + name: "اعلانات", + path: "/notifications", + element: , + }, + ], + }, + { + title: "auth pages", + layout: "auth", + pages: [ + { + icon: , + name: "ورود به سیستم", + path: "/sign-in", + element: , + }, + { + icon: , + name: "ثبت نام", + path: "/sign-up", + element: , + }, + ], + }, + ] +}; export default routes; diff --git a/src/widgets/cards/message-card.jsx b/src/widgets/cards/message-card.jsx index b055685f..5a47ba56 100644 --- a/src/widgets/cards/message-card.jsx +++ b/src/widgets/cards/message-card.jsx @@ -8,6 +8,7 @@ export function MessageCard({ img, name, message, action }) {
diff --git a/src/widgets/cards/statistics-card.jsx b/src/widgets/cards/statistics-card.jsx index 28b8149b..1074f35f 100644 --- a/src/widgets/cards/statistics-card.jsx +++ b/src/widgets/cards/statistics-card.jsx @@ -1,3 +1,4 @@ +import { useLanguage } from "@/context"; import { Card, CardHeader, @@ -8,23 +9,28 @@ import { import PropTypes from "prop-types"; export function StatisticsCard({ color, icon, title, value, footer }) { + const { documentDirection } = useLanguage(); return ( - - +
+ - {icon} - - - - {title} - - - {value} - - + floated={false} + shadow={false} + className="grid h-12 w-12 place-items-center" + > + {icon} + + + + {title} + + + {value} + + +
{footer && ( {footer} diff --git a/src/widgets/charts/statistics-chart.jsx b/src/widgets/charts/statistics-chart.jsx index b7108d8b..015276f7 100644 --- a/src/widgets/charts/statistics-chart.jsx +++ b/src/widgets/charts/statistics-chart.jsx @@ -10,11 +10,11 @@ import Chart from "react-apexcharts"; export function StatisticsChart({ color, chart, title, description, footer }) { return ( - - + + - + {title} diff --git a/src/widgets/layout/configurator.jsx b/src/widgets/layout/configurator.jsx index 5694f76a..f87b8e23 100644 --- a/src/widgets/layout/configurator.jsx +++ b/src/widgets/layout/configurator.jsx @@ -13,6 +13,7 @@ import { setSidenavColor, setSidenavType, setFixedNavbar, + useLanguage, } from "@/context"; function formatNumber(number, decPlaces) { @@ -42,13 +43,14 @@ function formatNumber(number, decPlaces) { export function Configurator() { const [controller, dispatch] = useMaterialTailwindController(); + const { languageData, language, documentDirection, changeLanguage } = useLanguage(); const { openConfigurator, sidenavColor, sidenavType, fixedNavbar } = controller; const [stars, setStars] = React.useState(0); const sidenavColors = { - blue: "from-blue-400 to-blue-600", - "blue-gray": "from-blue-gray-800 to-blue-gray-900", + white: "from-gray-100 to-gray-100 border-gray-200", + dark: "from-black to-black border-gray-200", green: "from-green-400 to-green-600", orange: "from-orange-400 to-orange-600", red: "from-red-400 to-red-600", @@ -63,19 +65,30 @@ export function Configurator() { .then((data) => setStars(formatNumber(data.stargazers_count, 1))); }, []); + const setLanguage = React.useCallback((e) => { + if(e.target.value) { + const docLanguage = e.target.value; + changeLanguage(docLanguage); + } + }, []); + return (