From 9defa6abce460666eff126eacf1689ef954f38d4 Mon Sep 17 00:00:00 2001 From: ArtChaos189 Date: Tue, 12 Dec 2023 22:57:28 +0300 Subject: [PATCH] updated the login buttons --- src/pages/Landing/HeaderLanding.tsx | 142 ++++++++++++++------------ src/pages/Landing/Hero.tsx | 151 +++++++++++++++------------- 2 files changed, 157 insertions(+), 136 deletions(-) diff --git a/src/pages/Landing/HeaderLanding.tsx b/src/pages/Landing/HeaderLanding.tsx index d801bc49..e363748a 100644 --- a/src/pages/Landing/HeaderLanding.tsx +++ b/src/pages/Landing/HeaderLanding.tsx @@ -1,72 +1,86 @@ -import React from 'react'; -import Box from '@mui/material/Box'; -import Button from '@mui/material/Button'; -import SectionStyled from './SectionStyled'; +import React from "react"; +import Box from "@mui/material/Box"; +import Button from "@mui/material/Button"; +import SectionStyled from "./SectionStyled"; import NavMenuItem from "@ui_kit/Header/NavMenuItem"; import QuizLogo from "./images/icons/QuizLogo"; import { useMediaQuery, useTheme } from "@mui/material"; import { setIsContactFormOpen } from "../../stores/contactForm"; +import { useUserStore } from "@root/user"; +import { useNavigate } from "react-router-dom"; -const buttonMenu = ['Меню 1', 'Меню 2', 'Меню 3', 'Меню 4', 'Меню 5', 'Меню 1', 'Меню 2'] +const buttonMenu = ["Меню 1", "Меню 2", "Меню 3", "Меню 4", "Меню 5", "Меню 1", "Меню 2"]; export default function Component() { - const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(600)); - const isTablet = useMediaQuery(theme.breakpoints.down(1000)) - const [select, setSelect] = React.useState(0) - return ( - - - {/* state.userId); + const navigate = useNavigate(); - {/* }}*/} - {/*>*/} - {/* {buttonMenu.map( (element, index) => (*/} - {/* {*/} - {/* setSelect(index);*/} - {/* }}*/} - {/* isActive={select === index}*/} - {/* />*/} - {/* ))}*/} - {/**/} - - - ) -} \ No newline at end of file + const onClick = () => (userId ? navigate("/list") : setIsContactFormOpen(true)); + + return ( + + + {/**/} + {/* {buttonMenu.map( (element, index) => (*/} + {/* {*/} + {/* setSelect(index);*/} + {/* }}*/} + {/* isActive={select === index}*/} + {/* />*/} + {/* ))}*/} + {/**/} + + + ); +} diff --git a/src/pages/Landing/Hero.tsx b/src/pages/Landing/Hero.tsx index 9bae131e..6e784075 100644 --- a/src/pages/Landing/Hero.tsx +++ b/src/pages/Landing/Hero.tsx @@ -1,75 +1,82 @@ -import React from 'react'; -import Box from '@mui/material/Box'; -import Button from '@mui/material/Button'; -import {Typography, useMediaQuery, useTheme} from "@mui/material"; -import abstraction from '../../assets/Quiz-main.png' -import SectionStyled from './SectionStyled'; -import { Link, redirect } from 'react-router-dom'; -import {setIsContactFormOpen} from "@root/contactForm"; +import React from "react"; +import Box from "@mui/material/Box"; +import Button from "@mui/material/Button"; +import { Typography, useMediaQuery, useTheme } from "@mui/material"; +import abstraction from "../../assets/Quiz-main.png"; +import SectionStyled from "./SectionStyled"; +import { Link, redirect, useNavigate } from "react-router-dom"; +import { setIsContactFormOpen } from "@root/contactForm"; +import { useUserStore } from "@root/user"; export default function Component() { - const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(600)); - const isTablet = useMediaQuery(theme.breakpoints.down(1000)) - return( - - - - Pena Quiz - - - - Помогаем посетителю оставить заявку.
Готовые шаблоны квизов с легкой установкой на любой сайт и социальные сети -
-
- {/**/} - - {/**/} + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down(600)); + const isTablet = useMediaQuery(theme.breakpoints.down(1000)); + const userId = useUserStore((state) => state.userId); + const navigate = useNavigate(); - - -
- ) -} \ No newline at end of file + const tryItForFreeonClick = () => (userId ? navigate("/list") : setIsContactFormOpen(true)); + + return ( + + + Pena Quiz + + + Помогаем посетителю оставить заявку.
Готовые шаблоны + квизов с легкой установкой на любой сайт и социальные сети +
+
+ {/**/} + + {/**/} + + + +
+ ); +}