From 388f4e2a7b40fbb92f7c60c36c689bd778d50ff6 Mon Sep 17 00:00:00 2001 From: inmake Date: Fri, 15 Sep 2023 13:37:12 +0500 Subject: [PATCH] upd --- client/package.json | 1 + client/src/App.tsx | 86 +++++--------------- client/src/MainVideoPage.tsx | 25 ++++++ client/src/StreamPage.tsx | 108 +++++++++++++++++++++++++ client/src/components/FeedbackForm.tsx | 1 - client/src/layouts/DefaultLayout.tsx | 24 ++++++ client/src/main.tsx | 41 ++++++++-- client/yarn.lock | 20 +++++ server/app.js | 18 +---- 9 files changed, 232 insertions(+), 92 deletions(-) create mode 100644 client/src/MainVideoPage.tsx create mode 100644 client/src/StreamPage.tsx create mode 100644 client/src/layouts/DefaultLayout.tsx diff --git a/client/package.json b/client/package.json index 2835a75..5dd6ad1 100644 --- a/client/package.json +++ b/client/package.json @@ -23,6 +23,7 @@ "react-player": "^2.12.0", "react-rangeslider": "^2.2.0", "react-responsive-carousel": "^3.2.23", + "react-router-dom": "^6.15.0", "react-scroll": "^1.8.9", "react-yandex-metrika": "^2.6.0", "swiper": "^9.2.0", diff --git a/client/src/App.tsx b/client/src/App.tsx index 2797709..5e5cd1f 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -14,13 +14,13 @@ import Slider from "./components/Slider/Slider"; import FeatureSlider from "./components/FeatureSlider"; import useModalStore from "./store/modal"; import FeedbackForm from "./components/FeedbackForm"; -import { YMInitializer } from "react-yandex-metrika"; import Map from "./components/Map"; import FeedbackFormSuccess from "./components/FeedbackFormSuccess"; import StreamCard2 from "./components/StreamCard2"; -import ReactPlayer from "react-player"; +import { useParams } from "react-router-dom"; function App() { + const params = useParams(); const [fullname, setFullname] = useState(""); const [email, setEmail] = useState(""); const [phone, setPhone] = useState(""); @@ -90,8 +90,14 @@ function App() { document.title = t("title"); }, [changeLanguage]); + useEffect(() => { + if (window.location.hash === "#feedback") { + setModalComponent(); + } + }, []); + return ( -
+
@@ -226,7 +232,7 @@ function App() { r="49" transform="matrix(-1 0 0 1 100 0)" stroke="url(#paint1_linear_1936_29973)" - stroke-width="2" + strokeWidth="2" /> @@ -237,10 +243,10 @@ function App() { width="148" height="148" filterUnits="userSpaceOnUse" - color-interpolation-filters="sRGB" + colorInterpolationFilters="sRGB" > - - + + - - + + @@ -900,49 +906,6 @@ function App() {
- - {/*
-

- -

-
- - МФК «Re:volution towers» - - } - location={Россия, Екатеринбург} - href="https://stream.graff.tech/?build=nksJukovaDev" - /> - - - ЖК «Айвазовский» - - } - location={Россия, Тюмень} - href="https://stream.graff.tech/?build=Ivazowsky" - /> - - - ЖК «Life Резиденция» - - } - location={Россия, Тюмень} - href="https://stream.graff.tech/?build=lifeResidence" - /> -
-
*/}
@@ -1338,7 +1301,10 @@ function App() { > YouTube - + VK

@@ -1368,18 +1334,6 @@ function App() {
- - ); } diff --git a/client/src/MainVideoPage.tsx b/client/src/MainVideoPage.tsx new file mode 100644 index 0000000..9874654 --- /dev/null +++ b/client/src/MainVideoPage.tsx @@ -0,0 +1,25 @@ +import ReactPlayer from "react-player"; + +function MainVideoPage() { + return ( +
+
+
+ + + +
+ +
+ +
+
+
+ ); +} + +export default MainVideoPage; diff --git a/client/src/StreamPage.tsx b/client/src/StreamPage.tsx new file mode 100644 index 0000000..8c8beba --- /dev/null +++ b/client/src/StreamPage.tsx @@ -0,0 +1,108 @@ +import { Trans } from "react-i18next"; +import ReactPlayer from "react-player"; +import StreamCard2 from "./components/StreamCard2"; +import Title from "./components/Title"; +import Map from "./components/Map"; + +function StreamPage() { + return ( +
+
+
+
+ + + +
+ +
+ +
+
+ +
+
+ + {/* <Trans i18nKey="showAllAdvantagesHeading"> */} + Graff.estate stream + <br />—{" "} + <Trans i18nKey="remoteDemoHeading"> + удаленная демонстрация жилого комплекса + </Trans> + {/* </Trans> */} + + +
+

+ + Высокий уровень графики и полное погружение покупателя в + процесс выбора квартиры. + +

+

+ + Местоположение и устройство значения не имеют. Нужен только + интернет. + +

+
+ +
+ +
+
+ +
+

+ + Демонстрация технологии + +

+ +
+ + МФК «Revolution towers» + + } + location={Россия, Екатеринбург} + build={"nksJukovaDev"} + /> + + ЖК «Айвазовский City» + + } + location={Россия, Тюмень} + build={"Ivazowsky"} + /> + + ЖК «Life Резиденция» + + } + location={Россия, Тюмень} + build={"lifeResidence"} + /> +
+
+
+
+
+ ); +} + +export default StreamPage; diff --git a/client/src/components/FeedbackForm.tsx b/client/src/components/FeedbackForm.tsx index 00750d7..0c79a0d 100644 --- a/client/src/components/FeedbackForm.tsx +++ b/client/src/components/FeedbackForm.tsx @@ -4,7 +4,6 @@ import InputMask from "react-input-mask"; import useModalStore from "../store/modal"; import FeedbackFormSuccess from "./FeedbackFormSuccess"; import { Trans } from "react-i18next"; -import i18n from "../i18n"; import Title from "./Title"; function FeedbackForm() { diff --git a/client/src/layouts/DefaultLayout.tsx b/client/src/layouts/DefaultLayout.tsx new file mode 100644 index 0000000..ff5fcfb --- /dev/null +++ b/client/src/layouts/DefaultLayout.tsx @@ -0,0 +1,24 @@ +import { Outlet } from "react-router-dom"; +import { YMInitializer } from "react-yandex-metrika"; + +function DefaultLayout() { + return ( +
+ + + +
+ ); +} + +export default DefaultLayout; diff --git a/client/src/main.tsx b/client/src/main.tsx index a243733..29881ef 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -1,11 +1,36 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './App' +import React from "react"; +import ReactDOM from "react-dom/client"; +import App from "./App"; import "./i18n"; -import './index.css' +import { createBrowserRouter, RouterProvider } from "react-router-dom"; +import "./index.css"; +import DefaultLayout from "./layouts/DefaultLayout"; +import StreamPage from "./StreamPage"; +import MainVideoPage from "./MainVideoPage"; -ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( +const router = createBrowserRouter([ + { + path: "", + element: , + children: [ + { + index: true, + element: , + }, + { + path: "/main_video", + element: , + }, + { + path: "/stream", + element: , + }, + ], + }, +]); + +ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( // - - // , -) + + // +); diff --git a/client/yarn.lock b/client/yarn.lock index 72a286a..3ac43da 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -282,6 +282,11 @@ screen-space-reflections "2.5.0" three-stdlib "^2.8.11" +"@remix-run/router@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.8.0.tgz#e848d2f669f601544df15ce2a313955e4bf0bafc" + integrity sha512-mrfKqIHnSZRyIzBcanNJmVQELTnX+qagEDlcKO90RgRBVOZGSGvZKeDihTRfWcqoDn5N/NkUcwWTccnpN18Tfg== + "@swc/core-darwin-arm64@1.3.44": version "1.3.44" resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.44.tgz#e0f5eb9d962c4e6192531c2e3b8c11f55faf1b89" @@ -1215,6 +1220,21 @@ react-responsive-carousel@^3.2.23: prop-types "^15.5.8" react-easy-swipe "^0.0.21" +react-router-dom@^6.15.0: + version "6.15.0" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.15.0.tgz#6da7db61e56797266fbbef0d5e324d6ac443ee40" + integrity sha512-aR42t0fs7brintwBGAv2+mGlCtgtFQeOzK0BM1/OiqEzRejOZtpMZepvgkscpMUnKb8YO84G7s3LsHnnDNonbQ== + dependencies: + "@remix-run/router" "1.8.0" + react-router "6.15.0" + +react-router@6.15.0: + version "6.15.0" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.15.0.tgz#bf2cb5a4a7ed57f074d4ea88db0d95033f39cac8" + integrity sha512-NIytlzvzLwJkCQj2HLefmeakxxWHWAP+02EGqWEZy+DgfHHKQMUoBBjUQLOtFInBMhWtb3hiUy6MfFgwLjXhqg== + dependencies: + "@remix-run/router" "1.8.0" + react-scroll@^1.8.9: version "1.8.9" resolved "https://registry.npmjs.org/react-scroll/-/react-scroll-1.8.9.tgz" diff --git a/server/app.js b/server/app.js index 65b2b83..b0578f6 100644 --- a/server/app.js +++ b/server/app.js @@ -1,6 +1,5 @@ import express, { json } from "express"; import cors from "cors"; -import ky from "ky"; import mongoose from "mongoose"; import nodemailer from "nodemailer"; import Mail from "./models/Mail.js"; @@ -9,7 +8,7 @@ const app = express(); const port = 3000; app.use(cors()); -app.use(express.json()); +app.use(json()); app.get("/", (req, res) => { res.json({ ok: 1 }); @@ -144,10 +143,6 @@ app.get("/regions", async (req, res) => { }, ]; - // const result = await ky - // .get("https://наш.дом.рф/аналитика/квартирография/api/dictionaries/regions") - // .json(); - regions = regions .map((item) => item.regions) .flat() @@ -829,17 +824,6 @@ app.get("/region/:id", async (req, res) => { }, ]; - // const result2 = await ky - // .get( - // `https://наш.дом.рф/аналитика/api/rpp/?regionCode=${req.params.id}&repMonth=3&repYear=2023` - // ) - // .json(); - // const result3 = await ky - // .get( - // `https://наш.дом.рф/аналитика/api/developers/dashboard?sort=objSquareLivingAmt:desc&subjectTypes=region®ion=${req.params.id}&date=01-07-2023&limit=0` - // ) - // .json(); - try { const { totalArea, flatCount, priceAvg, objSquareLivingAmt, objCnt } = regionsData.find((item) => item.id == req.params.id);