From 0172eb8b908faac485dade04d9f7aae311a20043 Mon Sep 17 00:00:00 2001 From: BORIS Date: Sat, 23 Nov 2024 19:45:18 +0300 Subject: [PATCH 1/2] Section with reviews --- .../components/lastSection/_lastSection.sass | 28 +++++++++++++++ .../components/lastSection/lastSection.jsx | 36 +++++++++++++++++++ apps/frontend/src/routes/index.lazy.tsx | 5 ++- 3 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 apps/frontend/src/components/lastSection/_lastSection.sass create mode 100644 apps/frontend/src/components/lastSection/lastSection.jsx diff --git a/apps/frontend/src/components/lastSection/_lastSection.sass b/apps/frontend/src/components/lastSection/_lastSection.sass new file mode 100644 index 0000000..c64433f --- /dev/null +++ b/apps/frontend/src/components/lastSection/_lastSection.sass @@ -0,0 +1,28 @@ +@use "~/sass/star4" + +.last-section + display: flex + flex-direction: column + text-align: center + margin-top: 5rem + @include star4.layout(compact, compact) + margin-top: 10rem + &__container + border: solid .1rem black + border-radius: 3rem + padding: 1rem + margin-bottom: 3rem + &__p + font-size: 1rem + @include star4.layout(compact, compact) + font-size: 1.3rem + line-height: 130% + @include star4.typescale(body, large) + &__h2 + font-size: 1.5rem + text-align: center + margin-bottom: 5rem + @include star4.typescale(headline, medium) + @include star4.layout(compact, compact) + font-size: 1.5rem + line-height: 130% diff --git a/apps/frontend/src/components/lastSection/lastSection.jsx b/apps/frontend/src/components/lastSection/lastSection.jsx new file mode 100644 index 0000000..2aaa6b8 --- /dev/null +++ b/apps/frontend/src/components/lastSection/lastSection.jsx @@ -0,0 +1,36 @@ +import { useStableCallback } from "@tanstack/react-router"; +import { memo, useEffect, useState } from "react"; +import "./_lastSection.sass"; + +const LastSectionComponent = function LastSection() { + const [data, setData] = useState(null); + useEffect(() => { + async function fetchData() { + return await fetch("http://localhost:5000/event"); + } + setData( + [ + `Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorum, inventore adipisci totam modi, pariatur nisi consequatur cumque, quo nagendi quidem dicta suscipit voluptatibus.`, + `Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorum, inventore adipisci totam modi, pariatur nisi consequatur cumque, quo nam temporequidem dicta suscipit voluptatibus.`, + ].map((text) => { + return ( +
+

{text}

+
+ ); + }), + ); + }, []); + return ( + <> +
+

+ Здесь будут представлены ваши ошибки +

+ {data} +
+ + ); +}; + +export const LastSection = memo(LastSectionComponent); diff --git a/apps/frontend/src/routes/index.lazy.tsx b/apps/frontend/src/routes/index.lazy.tsx index ead75a2..3a86a91 100644 --- a/apps/frontend/src/routes/index.lazy.tsx +++ b/apps/frontend/src/routes/index.lazy.tsx @@ -1,6 +1,7 @@ import { createLazyFileRoute } from "@tanstack/react-router"; import { SectionHello } from "~/components/section-hello"; import { Hero } from "~/components/hero-old"; +import { LastSection } from "~/components/lastSection/lastSection"; import styles from "./index.module.sass"; @@ -12,9 +13,7 @@ function Index() { return (
{/* */} -
- -
+
) } From f8f0c099fdfba3ba6caad20230f31f5e3d39e414 Mon Sep 17 00:00:00 2001 From: BORIS Date: Sat, 23 Nov 2024 19:46:22 +0300 Subject: [PATCH 2/2] Section with reviews v2 --- apps/frontend/src/components/lastSection/lastSection.jsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/frontend/src/components/lastSection/lastSection.jsx b/apps/frontend/src/components/lastSection/lastSection.jsx index 2aaa6b8..6a874f9 100644 --- a/apps/frontend/src/components/lastSection/lastSection.jsx +++ b/apps/frontend/src/components/lastSection/lastSection.jsx @@ -9,10 +9,7 @@ const LastSectionComponent = function LastSection() { return await fetch("http://localhost:5000/event"); } setData( - [ - `Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorum, inventore adipisci totam modi, pariatur nisi consequatur cumque, quo nagendi quidem dicta suscipit voluptatibus.`, - `Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorum, inventore adipisci totam modi, pariatur nisi consequatur cumque, quo nam temporequidem dicta suscipit voluptatibus.`, - ].map((text) => { + fetchData().map((text) => { return (

{text}