From 11ce49342631c25f3bdad5bcc9c4e6588a1b4dc9 Mon Sep 17 00:00:00 2001 From: ramith-kulal Date: Sat, 24 Feb 2024 17:59:14 +0530 Subject: [PATCH] Implemented design for request page based on Figma design --- client/src/components/Request/Request.jsx | 239 ++++++++++++++-------- 1 file changed, 157 insertions(+), 82 deletions(-) diff --git a/client/src/components/Request/Request.jsx b/client/src/components/Request/Request.jsx index b88968f..0952542 100644 --- a/client/src/components/Request/Request.jsx +++ b/client/src/components/Request/Request.jsx @@ -1,88 +1,163 @@ import { - Container, - Heading, - VStack, - Box, - Input, - FormLabel, - Button, - } from '@chakra-ui/react'; - import { Link } from 'react-router-dom'; - import GoToTopButton from '../Button/GoToTopButton'; - import React from 'react'; - - const Request = () => { - const [name, setName] = React.useState(''); - const [email, setEmail] = React.useState(''); - const [course, setCourse] = React.useState(''); - - return( - - - -
- - - setName(e.target.value)} - placeholder="Enter your Name" - type="text" - focusBorderColor="yellow.400" - /> - - - - - setEmail(e.target.value)} - placeholder="Abc" - type="email" - focusBorderColor="yellow.400" - /> - - - - - setCourse(e.target.value)} - placeholder="Explain the Course" - focusBorderColor="yellow.400" + Container, + Heading, + VStack, + Box, + Input, + FormLabel, + Button, + Flex, + Image, + useColorModeValue, +} from '@chakra-ui/react'; +import { Link } from 'react-router-dom'; +import { useEffect, useState } from 'react'; +import React from 'react'; +import GoToTopButton from '../Button/GoToTopButton'; +import requestImage from '../../assets/images/contact.jpg'; + +const Request = () => { + const [name, setName] = React.useState(''); + const [email, setEmail] = React.useState(''); + const [course, setCourse] = React.useState(''); + + const [viewportHeight, setViewportHeight] = useState(0); + + useEffect(() => { + const calculateViewportHeight = () => { + const height = window.innerHeight; + const offset = 134; // 20 pixels + setViewportHeight(height - offset); + }; + calculateViewportHeight(); + window.addEventListener('resize', calculateViewportHeight); + return () => { + window.removeEventListener('resize', calculateViewportHeight); + }; + }, []); + + const handleSubmit = e => { + e.preventDefault(); + // Add your form submission logic here + }; + + const textColor = useColorModeValue('gray.700', 'white'); + + return ( + + + + + - - - - - - See Available Courses!! - + + {' '} - {' '} + {/* Set text color */} + You can reach us anytime via + + - here - -
- + + + + setName(e.target.value)} + placeholder="Enter your Name" + focusBorderColor="yellow.400" + width={{ base: '100%', md: '505px' }} // Responsive width + height="45px" + /> + + + + + setEmail(e.target.value)} + placeholder=" 📧 Enter your Email Address" + type="email" + focusBorderColor="yellow.400" + width={{ base: '100%', md: '505px' }} // Responsive width + height="45px" + /> + + + + setName(e.target.value)} + placeholder="Enter the course name" + focusBorderColor="yellow.400" + width={{ base: '100%', md: '505px' }} // Responsive width + height="45px" + /> + + + + + setCourse(e.target.value)} + placeholder="Tell us a little about the course...." + focusBorderColor="yellow.400" + width={{ base: '100%', md: '505px' }} // Responsive width + paddingTop="19px" + paddingBottom="80px" + paddingLeft="10px" // Add padding to the left + textAlign="left" + /> + + + + + + + + Request Image + + +
- ) - }; - - export default Request; - \ No newline at end of file + ); +}; + +export default Request;