Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added style #493

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 25 additions & 22 deletions src/components/Design.jsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import React from 'react'
import {useState} from 'react'
import React, { useState } from 'react';

export const Design = ({question,answer}) => {
const [show,setShow]= useState(false);
const [sign,setSign]= useState("+");
function one(){
setShow(!show);
}
return (
<div className="card mt-5">
<div class="topic" style={{display:"flex",justifyContent:"space-between",cursor:"pointer"}} >
<h2 onClick={()=>{one()}}>{question} </h2>
<div onClick={()=>{one()}}>
<p style={{color:"black",paddingRight:"10px",paddingLeft:"30px"}}>{show?"-":"+"}</p></div>
</div>
{
show && <p style={{color:"black",background:"white",border:"1px solid black",padding:"20px"}}>{answer}</p>
}

</div>
)
}
export const Design = ({ question, answer }) => {
const [show, setShow] = useState(false);

const toggleAnswer = () => {
setShow(!show);
};

return (
<div className="faq-item">
<div
className="faq-question flex justify-between items-center cursor-pointer"
onClick={toggleAnswer}
>
<h2 className="text-xl">{question}</h2>
<p className="text-black px-4">{show ? '-' : '+'}</p>
</div>
<div className={`faq-answer ${show ? 'max-h-96' : 'max-h-0'}`}>
<div className="p-4">
{answer}
</div>
</div>
</div>
);
};
44 changes: 40 additions & 4 deletions src/components/Faq.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,43 @@
.faq-card{
margin-top:100px;
.faq-card {
margin-top: 100px;
display: flex;
flex-direction: column;
/* width:100%; */
padding: 50px;
}
}

.faq-item {
margin-bottom: 1rem;
}

.faq-question {
width: 100%;
text-align: left;
font-size: 1.5rem;
font-weight: 600;
background-color: #f0f0f0;
padding: 1rem;
border-radius: 0.5rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
cursor: pointer;
transition: background-color 0.3s ease;
}

.faq-question:hover {
background-color: #e0e0e0;
}

.faq-answer {
overflow: hidden;
max-height: 0;
transition: max-height 1.5s ease;
background-color: #fafafa;
padding: 0 1rem;
border-left: 2px solid #e0e0e0;
border-right: 2px solid #e0e0e0;
border-bottom: 2px solid #e0e0e0;
border-radius: 0 0 0.5rem 0.5rem;
}

.max-h-96 {
max-height: 24rem;
}
32 changes: 14 additions & 18 deletions src/components/Faq.jsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import React from 'react'
import {questions} from './Faq-ques'
import {useState} from 'react'

import './Faq.css'
import { Design } from './Design'
import React, { useState } from 'react';
import { questions } from './Faq-ques';
import './Faq.css';
import { Design } from './Design';

export const Faq = () => {
const[value,setValue]=useState(questions);
return (
<div className="faq-card shadow-xl">
<h1 className=' text-4xl text-[#f9a826]'>FAQ's about tourism in India</h1>
{
value.map((cur,index)=>{
return <Design key={index} {...cur}></Design>;
const [value, setValue] = useState(questions);

})
}
return (
<div className="faq-card shadow-xl">
<h1 className="text-4xl text-[#f9a826]">FAQ's about tourism in India</h1>
{value.map((cur, index) => (
<Design key={index} {...cur} />
))}
</div>
);
};

</div>
)
}
111 changes: 56 additions & 55 deletions src/pages/ContactUs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,79 +214,80 @@ export const ContactUs = () => {
</div>

<div className="w-2/4 m-5 flex flex-col items-center justify-center max-md:w-full">
<h2 className="text-lg font-medium w-full text-left">
Contact Form
</h2>

<form
className="flex flex-col items-center justify-center w-full m-5 max-md:w-11/12"
onSubmit={onSubmitHandler}
className="flex flex-col items-center justify-center w-full m-5 max-w-lg bg-white border border-gray-200 rounded-lg shadow-lg p-6"
onSubmit={onSubmitHandler}
>
<label htmlFor="name" className="text-left w-full pb-1">
<h2 className="text-2xl font-semibold text-gray-800 mb-4">Contact Us</h2>

<label htmlFor="name" className="text-left w-full pb-1 text-gray-700 font-medium">
Name:
</label>
<input
type="text"
ref={name}
id="name"
name="name"
className="w-full border-gray-300 border-2 mb-3 focus:outline-none p-2 rounded-lg"
required
type="text"
ref={name}
id="name"
name="name"
className="w-full border-gray-300 border mb-4 focus:outline-none focus:ring-2 focus:ring-green-500 p-2 rounded-lg shadow-sm"
required
/>

<label htmlFor="email" className="text-left w-full pb-1">
<label htmlFor="email" className="text-left w-full pb-1 text-gray-700 font-medium">
Email:
</label>
<input
type="email"
id="email"
ref={email}
className="w-full border-gray-300 border-2 mb-3 focus:outline-none p-2 rounded-lg"
name="email"
required
type="email"
id="email"
ref={email}
className="w-full border-gray-300 border mb-4 focus:outline-none focus:ring-2 focus:ring-green-500 p-2 rounded-lg shadow-sm"
name="email"
required
/>

<label htmlFor="phone" className="text-left w-full pb-1">
<label htmlFor="phone" className="text-left w-full pb-1 text-gray-700 font-medium">
Phone:
</label>
<input
type="tel"
ref={phone}
className="w-full border-gray-300 border-2 mb-3 focus:outline-none p-2 rounded-lg"
id="phone"
name="phone"
required
type="tel"
ref={phone}
className="w-full border-gray-300 border mb-4 focus:outline-none focus:ring-2 focus:ring-green-500 p-2 rounded-lg shadow-sm"
id="phone"
name="phone"
required
/>

<label htmlFor="subject" className="text-left w-full pb-1">
<label htmlFor="subject" className="text-left w-full pb-1 text-gray-700 font-medium">
Subject:
</label>
<input
type="text"
ref={subject}
className="w-full border-gray-300 border-2 mb-3 focus:outline-none p-2 rounded-lg"
id="subject"
name="subject"
required
type="text"
ref={subject}
className="w-full border-gray-300 border mb-4 focus:outline-none focus:ring-2 focus:ring-green-500 p-2 rounded-lg shadow-sm"
id="subject"
name="subject"
required
/>

<label className="text-left w-full pb-1" htmlFor="message">
<label className="text-left w-full pb-1 text-gray-700 font-medium" htmlFor="message">
Message:
</label>
<textarea
id="message"
ref={message}
name="message"
className="w-full border-gray-300 border-2 mb-3 focus:outline-none p-2 rounded-lg h-28"
required
id="message"
ref={message}
name="message"
className="w-full border-gray-300 border mb-4 focus:outline-none focus:ring-2 focus:ring-green-500 p-2 rounded-lg shadow-sm h-28"
required
></textarea>

<button
type="submit"
className="bg-green-600 text-white pt-2 pb-2 pl-3.5 pr-3.5 border-none rounded-md cursor-pointer"
type="submit"
className="bg-green-600 text-white py-2 px-4 border-none rounded-md cursor-pointer hover:bg-green-700 transition-colors shadow-md"
>
Submit
</button>
</form>

</div>
</div>

Expand All @@ -304,16 +305,16 @@ export const ContactUs = () => {
<h2 className="font-medium text-lg">FAQ</h2>
<div className="flex flex-col items-start justify-center p-5">
<Accordion
title={"How can I book a tour with Bharat Yatra?"}
content={
"Booking a tour is simple. Browse our tour packages, select your preferred tour, and contact us via the form or call +91-123-456-7890. Complete your booking and payment online."
}
title={"How can I book a tour with Bharat Yatra?"}
content={
"Booking a tour is simple. Browse our tour packages, select your preferred tour, and contact us via the form or call +91-123-456-7890. Complete your booking and payment online."
}
/>
<Accordion
title={"What are the payment options available?"}
content={
"We accept major credit/debit cards, net banking, UPI, and digital wallets like Paytm and Google Pay. For more details, please contact our customer service."
}
title={"What are the payment options available?"}
content={
"We accept major credit/debit cards, net banking, UPI, and digital wallets like Paytm and Google Pay. For more details, please contact our customer service."
}
/>
</div>

Expand All @@ -326,15 +327,15 @@ export const ContactUs = () => {
<div className="w-full flex flex-col items-center justify-center">
<p>
<a
href="https://www.facebook.com"
target="_blank"
rel="noopener noreferrer"
className="pl-5 pr-5"
href="https://www.facebook.com"
target="_blank"
rel="noopener noreferrer"
className="pl-5 pr-5"
>
<FacebookIcon />
<FacebookIcon/>
</a>{" "}
<a
href="https://www.twitter.com"
href="https://www.twitter.com"
target="_blank"
rel="noopener noreferrer"
className="pl-5 pr-5"
Expand Down
Loading