From d0e3f6be0059102287b51af767bfb87d3c2111ac Mon Sep 17 00:00:00 2001 From: alij Date: Mon, 24 Jun 2024 01:18:39 +0430 Subject: [PATCH] feat : add react-helmet on pages --- package-lock.json | 32 +++++++++++++++++++ package.json | 1 + src/App.tsx | 59 +++++++++++++++++++----------------- src/layout/index.tsx | 13 ++++++++ src/pages/about/index.tsx | 23 +++++++++++--- src/pages/rule/index.tsx | 24 ++++++++++++--- src/pages/shop/index.tsx | 31 ++++++++++++++----- src/pages/tutorial/index.tsx | 23 +++++++++++--- 8 files changed, 157 insertions(+), 49 deletions(-) diff --git a/package-lock.json b/package-lock.json index 257bc94..e5b27b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "nprogress": "^0.2.0", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-helmet-async": "^2.0.5", "react-hot-toast": "^2.4.1", "react-icons": "^5.2.1", "react-otp-input": "^3.1.1", @@ -3783,6 +3784,14 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -4629,6 +4638,24 @@ "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz", "integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==" }, + "node_modules/react-helmet-async": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/react-helmet-async/-/react-helmet-async-2.0.5.tgz", + "integrity": "sha512-rYUYHeus+i27MvFE+Jaa4WsyBKGkL6qVgbJvSBoX8mbsWoABJXdEO0bZyi0F6i+4f0NuIb8AvqPMj3iXFHkMwg==", + "dependencies": { + "invariant": "^2.2.4", + "react-fast-compare": "^3.2.2", + "shallowequal": "^1.1.0" + }, + "peerDependencies": { + "react": "^16.6.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/react-helmet-async/node_modules/react-fast-compare": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz", + "integrity": "sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==" + }, "node_modules/react-hot-toast": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/react-hot-toast/-/react-hot-toast-2.4.1.tgz", @@ -4947,6 +4974,11 @@ "node": ">=10" } }, + "node_modules/shallowequal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", diff --git a/package.json b/package.json index 351e1d4..a213853 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "nprogress": "^0.2.0", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-helmet-async": "^2.0.5", "react-hot-toast": "^2.4.1", "react-icons": "^5.2.1", "react-otp-input": "^3.1.1", diff --git a/src/App.tsx b/src/App.tsx index c5403fc..e842733 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -16,39 +16,42 @@ import Login from "./pages/login"; import Profile from "./pages/profile"; import { Toaster } from "react-hot-toast"; import { isAuthenticated } from "./utils/auth"; +import { HelmetProvider } from "react-helmet-async"; const App = () => { return ( - - - - }> - } /> - } /> - } /> - } /> - }> - } /> + + + + + }> + } /> + } /> + } /> + } /> + }> + } /> + - - - ) : ( - - ) - } - > - } /> - - + + ) : ( + + ) + } + > + } /> + + + ); }; diff --git a/src/layout/index.tsx b/src/layout/index.tsx index 5c71694..31ab02e 100644 --- a/src/layout/index.tsx +++ b/src/layout/index.tsx @@ -2,10 +2,23 @@ import { Outlet } from "react-router-dom"; import Header from "../components/header"; import Footer from "../components/footer"; import Particle from "../components/particle"; +import { Helmet } from 'react-helmet-async'; const Layout = () => { return ( <> + + پرشین پینگ | Persian Ping + + + +
diff --git a/src/pages/about/index.tsx b/src/pages/about/index.tsx index 9be31e3..c12769c 100644 --- a/src/pages/about/index.tsx +++ b/src/pages/about/index.tsx @@ -1,12 +1,27 @@ +import { Helmet } from "react-helmet-async"; import Info from "./section/Info"; const About = () => { return ( -
-
- + <> + + درباره ما + + + + +
+
+ +
-
+ ); }; diff --git a/src/pages/rule/index.tsx b/src/pages/rule/index.tsx index 4a80699..42faeb3 100644 --- a/src/pages/rule/index.tsx +++ b/src/pages/rule/index.tsx @@ -1,12 +1,26 @@ +import { Helmet } from "react-helmet-async"; import Rules from "./section/Rules"; const Rule = () => { return ( -
-
- -
-
+ <> + + قوانین + + + +
+
+ +
+
{" "} + ); }; diff --git a/src/pages/shop/index.tsx b/src/pages/shop/index.tsx index b52abe0..8869f81 100644 --- a/src/pages/shop/index.tsx +++ b/src/pages/shop/index.tsx @@ -1,3 +1,4 @@ +import { Helmet } from "react-helmet-async"; import BestQuality from "./section/bestQuality/BestQuality"; import FastSell from "./section/fastSell/FastSell"; import Intro from "./section/intro/Intro"; @@ -6,15 +7,29 @@ import ProductList from "./section/productList/ProductList"; const Shop = () => { return ( -
-
- - - - - + <> + + فروشگاه + + + + +
+
+ + + + + +
-
+ ); }; diff --git a/src/pages/tutorial/index.tsx b/src/pages/tutorial/index.tsx index bd34f44..d00fe58 100644 --- a/src/pages/tutorial/index.tsx +++ b/src/pages/tutorial/index.tsx @@ -1,12 +1,27 @@ +import { Helmet } from "react-helmet-async"; import Tutorials from "./section/Tutorials"; const Tutorial = () => { return ( -
-
- + <> + + اموزش + + + + +
+
+ +
-
+ ); };