From 038ad432b8efabebe84a398dee5c1c67a8f6bea0 Mon Sep 17 00:00:00 2001 From: Nick Koukis Date: Sat, 14 Oct 2023 11:34:31 +0300 Subject: [PATCH] seperate components --- src/views/Home/Home.tsx | 316 +----------------- .../components/LandingPage/LandingPage.tsx | 280 ++++++++++++++++ 2 files changed, 287 insertions(+), 309 deletions(-) create mode 100644 src/views/Home/components/LandingPage/LandingPage.tsx diff --git a/src/views/Home/Home.tsx b/src/views/Home/Home.tsx index 654f318..d23c24a 100644 --- a/src/views/Home/Home.tsx +++ b/src/views/Home/Home.tsx @@ -1,68 +1,19 @@ -import { useSession, signIn, signOut } from "next-auth/react" -import { Button, Box, useBreakpointValue } from "@chakra-ui/react"; +import { useSession, signOut } from "next-auth/react" import { useGetUserInfo } from "@/views/Home/hooks/hooks"; import NewUserForm from "./components/NewUserForm/NewUserForm"; -import withDappProvider from "@/hoc/withDappProvider"; import ExistingUser from "./components/ExistingUser/ExistingUser"; -import { - Flex, - Heading, - Text, - Link, - SimpleGrid, - Stack, - Icon, - Spacer,VStack,Grid -} from "@chakra-ui/react"; -import { AtSignIcon, LockIcon, CheckIcon } from "@chakra-ui/icons"; -import { useCallback } from "react"; -import Particles from "react-particles"; -//import { loadFull } from "tsparticles"; // if you are going to use `loadFull`, install the "tsparticles" package too. -import { loadSlim } from "tsparticles-slim"; -import type { Container, Engine } from "tsparticles-engine"; +import { Button, Box } from "@chakra-ui/react"; import { useState } from "react"; - - - -interface FeatureCardProps { - icon: React.ComponentType; // Specify the type for the 'icon' prop - title: string; // Specify the type for the 'title' prop - description: string; // Specify the type for the 'description' prop -} - -function FeatureCard({ icon: IconComponent, title, description }: FeatureCardProps) { - return ( -
- {/* Render your component using IconComponent, title, and description */} - -

{title}

-

{description}

-
- ); -} +import LandingPage from "./components/LandingPage/LandingPage"; const Home = () => { - - const particlesInit = useCallback(async (engine: Engine) => { - // you can initialize the tsParticles instance (engine) here, adding custom shapes or presets - // this loads the tsparticles package bundle, it's the easiest method for getting everything ready - // starting from v2 you can add only the features you need reducing the bundle size - //await loadFull(engine); - await loadSlim(engine); -}, []); - -const particlesLoaded = useCallback(async (container: Container | undefined) => { - await console.log(container); -}, []); - const columnCount = useBreakpointValue({ base: 2, md: 4 }); // Two columns for mobile, four columns for larger screens - const { data: session } = useSession() const email = session?.user?.email || ""; const platform = "google"; - const {userInfo, isLoadingUserInfo, errorUserInfo} = useGetUserInfo(email, platform); + const { userInfo, isLoadingUserInfo, errorUserInfo } = useGetUserInfo(email, platform); const [clickedSubmit, setClickedSubmit] = useState(false); @@ -94,263 +45,10 @@ const particlesLoaded = useCallback(async (container: Container | undefined) => ) } - return ( - - - - - - - - - {/* Header */} - - {/* Logo */} - - SociWallet - - - {/* Spacer for mobile */} - - - {/* Nav Links */} - - - How it works - - - SociWallet SDK - - - Documentation - - - About us - - - - - {/* ... rest of the page content */} - - {/* Hero Section */} - - - {/* Content */} - - The SociWallet - - Create a secure MultiversX wallet in moments with your Google account and a secret PIN. Your PIN, exclusively for seed phrase encryption, is not stored anywhere. Access your seed phrase with your PIN whenever needed, giving you freedom and peace of mind. - - - - - - - - - {/* Stats Section */} - - - - {/* Stat Item 1 */} - - 562M - of active daily users - - - {/* Stat Item 2 */} - - 1234 - transactions per second - - - {/* Stat Item 3 */} - - 11236 - validator nodes - - - {/* Stat Item 4 */} - - 2M - transactions per day - - - - - - {/* Key Features Section */} - - - Key features that set us apart - - - Nexowallet is more than just a wallet - its a comprehensive platform with features that are tailored to the needs of cryptocurrency enthusiasts - - - - - - - {/* ... other feature cards */} - - - - - - - - ) - - - - - + return ( + + ) }; export default Home; \ No newline at end of file diff --git a/src/views/Home/components/LandingPage/LandingPage.tsx b/src/views/Home/components/LandingPage/LandingPage.tsx new file mode 100644 index 0000000..cf8cee1 --- /dev/null +++ b/src/views/Home/components/LandingPage/LandingPage.tsx @@ -0,0 +1,280 @@ +import React from 'react'; +import { useSession, signIn, signOut } from "next-auth/react" +import { useCallback } from "react"; +import { Box, Flex, Heading, Link, Text, Button, useBreakpointValue, Spacer, Grid, VStack, SimpleGrid } from '@chakra-ui/react'; +import { loadSlim } from "tsparticles-slim"; +import Particles from "react-particles"; +import type { Container, Engine } from "tsparticles-engine"; +import { AtSignIcon, LockIcon, CheckIcon } from "@chakra-ui/icons"; + +interface FeatureCardProps { + icon: React.ComponentType; // Specify the type for the 'icon' prop + title: string; // Specify the type for the 'title' prop + description: string; // Specify the type for the 'description' prop +} + +export default function LandingPage() { + + const particlesInit = useCallback(async (engine: Engine) => { + // you can initialize the tsParticles instance (engine) here, adding custom shapes or presets + // this loads the tsparticles package bundle, it's the easiest method for getting everything ready + // starting from v2 you can add only the features you need reducing the bundle size + //await loadFull(engine); + await loadSlim(engine); + }, []); + + const particlesLoaded = useCallback(async (container: Container | undefined) => { + }, []); + const columnCount = useBreakpointValue({ base: 2, md: 4 }); // Two columns for mobile, four columns for larger screens + + function FeatureCard({ icon: IconComponent, title, description }: FeatureCardProps) { + return ( +
+ {/* Render your component using IconComponent, title, and description */} + +

{title}

+

{description}

+
+ ); + } + + + return ( + + + + + + {/* Header */} + + {/* Logo */} + + SociWallet + + + {/* Spacer for mobile */} + + + {/* Nav Links */} + + + How it works + + + SociWallet SDK + + + Documentation + + + About us + + + + + {/* ... rest of the page content */} + + {/* Hero Section */} + + + {/* Content */} + + The SociWallet + + Create a secure MultiversX wallet in moments with your Google account and a secret PIN. Your PIN, exclusively for seed phrase encryption, is not stored anywhere. Access your seed phrase with your PIN whenever needed, giving you freedom and peace of mind. + + + + + + + + + {/* Stats Section */} + + {/* Stat Item 1 */} + + 562M + of active daily users + + + {/* Stat Item 2 */} + + 1234 + transactions per second + + + {/* Stat Item 3 */} + + 11236 + validator nodes + + + {/* Stat Item 4 */} + + 2M + transactions per day + + + {/* Key Features Section */} + + + Key features that set us apart + + + Nexowallet is more than just a wallet - its a comprehensive platform with features that are tailored to the needs of cryptocurrency enthusiasts + + + + + + + {/* ... other feature cards */} + + + + ); +}