From fcfdddbe4fe576da237194c733b1526e1d6f7606 Mon Sep 17 00:00:00 2001 From: mildrette Date: Thu, 27 Jun 2024 13:58:35 +0100 Subject: [PATCH 1/3] update to carousel --- src/App.css | 7 +++++++ src/Components/Blog.js | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/App.css b/src/App.css index 26fb1c2..0367d67 100644 --- a/src/App.css +++ b/src/App.css @@ -157,3 +157,10 @@ button:hover { font-size: 30px; text-align: center; } + +/* carousel */ +.centered-carousel { + display: flex; + /* justify-content: center; */ + /* align-items: center; */ +} diff --git a/src/Components/Blog.js b/src/Components/Blog.js index 5a6c533..969450b 100644 --- a/src/Components/Blog.js +++ b/src/Components/Blog.js @@ -32,7 +32,7 @@ const BlogCarousel = () => { arrows autoPlaySpeed={3000} centerMode={false} - className="" + className="centered-carousel" containerClass="container-with-dots" dotListClass="" draggable From 794f047a71adc7620c071ba04a1076510659afa3 Mon Sep 17 00:00:00 2001 From: mildrette Date: Thu, 27 Jun 2024 14:46:45 +0100 Subject: [PATCH 2/3] fixed RTL direction issues --- src/Components/Blog.js | 228 +++++++++++++++++--------------- src/Components/Nav.js | 290 ++++++++++++++++++++--------------------- src/Pages/Landing.js | 96 +++++++++++--- 3 files changed, 348 insertions(+), 266 deletions(-) diff --git a/src/Components/Blog.js b/src/Components/Blog.js index 969450b..ed96bc9 100644 --- a/src/Components/Blog.js +++ b/src/Components/Blog.js @@ -5,7 +5,9 @@ import { Card, CardContent, CardMedia, Typography, Box, Avatar } from "@mui/mate import { useTranslation } from "react-i18next"; const BlogCarousel = () => { - const { t } = useTranslation(); + const { t, i18n } = useTranslation(); + + const isRTL = i18n.language === "fa"; // Check if the current language is RTL const items = [ { @@ -27,113 +29,129 @@ const BlogCarousel = () => { ]; return ( - + {" "} + {/* Set the direction based on isRTL */} + - {items.map((item, index) => ( -
- - - - + {items.map((item, index) => ( +
+ + + + {" "} + {/* Adjust text alignment based on RTL */} + + {item.title} + + + {item.description} + +
+ {t("Blog.ReadMore")} +
+
+
+ - {item.title} - - - {item.description} - -
- {t("Blog.ReadMore")} -
-
- - - {item.avatar} - - {item.author} - - -
-
- ))} - + {" "} + {/* Adjust alignment based on RTL */} + {item.avatar} + + {item.author} + + +
+
+ ))} +
+ ); }; diff --git a/src/Components/Nav.js b/src/Components/Nav.js index e714f87..10b3462 100644 --- a/src/Components/Nav.js +++ b/src/Components/Nav.js @@ -13,7 +13,7 @@ import IconButton from "@mui/material/IconButton"; import MenuItem from "@mui/material/MenuItem"; import MenuIcon from "@mui/icons-material/Menu"; import Menu from "@mui/material/Menu"; -import { useTheme, createTheme } from "@mui/material/styles"; +import { useTheme, createTheme, ThemeProvider } from "@mui/material/styles"; import { useTranslation } from "react-i18next"; import useMediaQuery from "@mui/material/useMediaQuery"; import LanguageSwitcher from "../Components/LanguageSwitcher"; @@ -75,151 +75,151 @@ export default function BackToTop(props) { }); return ( - - - - - - Logo - {isMobile ? ( - <> - - - - + + + + + + Logo + {isMobile ? ( + <> + + + + + + + {t("Nav.help")} + + + + + {t("Nav.Blog")} + + + + + + + + + + + + + + + + + + ) : ( + - - - {t("Nav.help")} - - - - - - {t("Nav.Blog")} - - - - - - - - - - - - - - - - - - - ) : ( - - - {t("Nav.help")} - - - {t("Nav.Blog")} - - - - - - - - - - )} - - - - - - - - - - + + {t("Nav.help")} + + + {t("Nav.Blog")} + + + + + + + + + + )} + + + + + + + + + + + ); } diff --git a/src/Pages/Landing.js b/src/Pages/Landing.js index 43dbea0..b0e8c0d 100644 --- a/src/Pages/Landing.js +++ b/src/Pages/Landing.js @@ -41,7 +41,7 @@ export default function Landing() { > {/* Banner Page */} - + - + {t("Landing.landingh2")} - {/* */} + {/* Buttons */} - {/* */} - {/* */} - {/* */} @@ -127,7 +130,8 @@ export default function Landing() { width: { md: "100%", xs: "60%", mx: "center" }, maxWidth: "80%", height: "auto", - transform: "rotate(10deg)" + transform: "rotate(10deg)", + textAlign: isRTL ? "left" : "right" // Adjust image alignment based on RTL }} /> @@ -170,8 +174,16 @@ export default function Landing() { className="custom-card-img" /> - Card title - + + Card title + + {t(`Howitworks.${card.key}`)} @@ -179,6 +191,7 @@ export default function Landing() { ))} + {/* Getting Started Button */} @@ -244,32 +257,83 @@ export default function Landing() { {/* ------------------------------------------------------------------------------------ */} - + {/* blog section */} {t("Blog.WhatsNew")} {t("Blog.WhatsNew")} - {/* cards */} + {/* Blog cards */} + + {/* end of blog section */} + + {/* + + + + + + JavaScript + + JavaScript is a lightweight, cross-platform, single-threaded, and interpreted + compiled programming language. It is also known as the scripting language for + webpages. It is well-known for the development of web pages, and many + non-browser environments also use it. + + + + + + + + + React.js + + ReactJS is a declarative, efficient, and flexible JavaScript library for + building user interfaces. It is an open-source, component-based front-end + library that is responsible only for the view layer of the application. + + + + + + */} From dd1ea60b6b2bbab4f39173057d9946a1af18abc8 Mon Sep 17 00:00:00 2001 From: mildrette Date: Thu, 27 Jun 2024 14:51:53 +0100 Subject: [PATCH 3/3] fixed RTL direction issues --- src/Components/Nav.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Components/Nav.js b/src/Components/Nav.js index 10b3462..29fc9f4 100644 --- a/src/Components/Nav.js +++ b/src/Components/Nav.js @@ -78,7 +78,7 @@ export default function BackToTop(props) { - +