Skip to content

Commit

Permalink
Add faq page
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Dec 7, 2024
1 parent 1a6f694 commit 075db75
Show file tree
Hide file tree
Showing 13 changed files with 173 additions and 91 deletions.
2 changes: 2 additions & 0 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Contact = lazy(() => import('@/pages/Contact'))
const NoMatch = lazy(() => import('@/pages/NoMatch'))
const Locations = lazy(() => import('@/pages/Locations'))
const Suppliers = lazy(() => import('@/pages/Suppliers'))
const Faq = lazy(() => import('@/pages/Faq'))

const App = () => (
<GlobalProvider>
Expand Down Expand Up @@ -57,6 +58,7 @@ const App = () => (
<Route path="/contact" element={<Contact />} />
<Route path="/locations" element={<Locations />} />
<Route path="/suppliers" element={<Suppliers />} />
<Route path="/faq" element={<Faq />} />

<Route path="*" element={<NoMatch />} />
</Routes>
Expand Down
31 changes: 31 additions & 0 deletions frontend/src/assets/css/faq-list.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
div.faq-list {
width: 100%;
background-color: #f9f9f9;
padding: 50px 30px;
display: flex;
flex-direction: column;
align-items: center;
}

div.faq-list h2 {
width: fit-content;
}

div.faq-list div.questions {
margin: 20px 120px 70px 120px;
}

div.faq-list div.questions .accordion-title {
font-weight: 500;
}


div.faq-list div.questions .accordion-details {
color: #676767;
}

@media only screen and (width <=960px) {
div.faq-list div.questions {
margin: 20px 0 70px 0;
}
}
15 changes: 15 additions & 0 deletions frontend/src/assets/css/faq.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
div.faq {
display: flex;
flex-direction: column;
flex: 1 0 auto;
align-items: center;
transform: translate3d(0, 0, 0);
padding: 50px 10%;
min-height: 100vh;
}

@media only screen and (width <=960px) {
div.faq {
padding: 50px 0;
}
}
30 changes: 0 additions & 30 deletions frontend/src/assets/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -297,32 +297,6 @@ div.home div.car-size div.boxes div.box div.box-content span.unit {
color: #A9A9A9;
}

div.home div.faq {
width: 100%;
background-color: #f9f9f9;
padding: 50px 30px;
display: flex;
flex-direction: column;
align-items: center;
}

div.home div.faq h2 {
width: fit-content;
}

div.home div.faq div.questions {
margin: 20px 120px 70px 120px;
}

div.home div.faq div.questions .accordion-title {
font-weight: 500;
}


div.home div.faq div.questions .accordion-details {
color: #676767;
}

div.home div.home-map {
width: 80%;
margin: 15px 0 30px;
Expand Down Expand Up @@ -424,10 +398,6 @@ div.home div.customer-care div.customer-care-img img {
margin-bottom: 30px;
}

div.home div.faq div.questions {
margin: 20px 0 70px 0;
}

div.home div.home-map {
width: 100%;
padding: 5px;
Expand Down
40 changes: 40 additions & 0 deletions frontend/src/components/FaqList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react'
import { Accordion, AccordionDetails, AccordionSummary, Button } from '@mui/material'
import { ExpandMore } from '@mui/icons-material'
import { strings } from '@/lang/faq-list'

import '@/assets/css/faq-list.css'

const Faq = () => (
<div className="faq-list">
<h2>{strings.FAQ_TITLE}</h2>
<div className="questions">
<Accordion>
<AccordionSummary expandIcon={<ExpandMore />} className="accordion-title">{strings.FAQ_DOCUMENTS_TITLE}</AccordionSummary>
<AccordionDetails className="accordion-details">{strings.FAQ_DOCUMENTS_TEXT}</AccordionDetails>
</Accordion>
<Accordion>
<AccordionSummary expandIcon={<ExpandMore />} className="accordion-title">{strings.FAQ_SERVICES_TITLE}</AccordionSummary>
<AccordionDetails className="accordion-details">{strings.FAQ_SERVICES_TEXT}</AccordionDetails>
</Accordion>

<Accordion>
<AccordionSummary expandIcon={<ExpandMore />} className="accordion-title">{strings.FAQ_AGE_TITLE}</AccordionSummary>
<AccordionDetails className="accordion-details">{strings.FAQ_AGE_TEXT}</AccordionDetails>
</Accordion>
<Accordion>
<AccordionSummary expandIcon={<ExpandMore />} className="accordion-title">{strings.FAQ_CANCEL_TITLE}</AccordionSummary>
<AccordionDetails className="accordion-details">{strings.FAQ_CANCEL_TEXT}</AccordionDetails>
</Accordion>
</div>
<Button
variant="contained"
className="btn-primary btn-home"
href="/contact"
>
{strings.MORE_QUESTIONS}
</Button>
</div>
)

export default Faq
1 change: 1 addition & 0 deletions frontend/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const Footer = () => {
<div className="title">{strings.SUPPORT}</div>
<ul className="links">
<li onClick={() => navigate('/contact')}>{strings.CONTACT}</li>
<li onClick={() => navigate('/faq')}>{strings.FAQ}</li>
</ul>
<div className="contact">
<MailOutline className="icon" />
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
CarRental as SupplierIcon,
LocationOn as LocationIcon,
PrivacyTip as PrivacyIcon,
QuestionAnswer as FaqIcon,
} from '@mui/icons-material'
import { useNavigate } from 'react-router-dom'
import * as bookcarsTypes from ':bookcars-types'
Expand Down Expand Up @@ -330,6 +331,10 @@ const Header = ({
<ListItemIcon><TosIcon /></ListItemIcon>
<ListItemText primary={strings.TOS} />
</ListItemLink>
<ListItemLink href="/faq">
<ListItemIcon><FaqIcon /></ListItemIcon>
<ListItemText primary={strings.FAQ} />
</ListItemLink>
<ListItemLink href="/contact">
<ListItemIcon><MailIcon /></ListItemIcon>
<ListItemText primary={strings.CONTACT} />
Expand Down
44 changes: 44 additions & 0 deletions frontend/src/lang/faq-list.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import LocalizedStrings from 'react-localization'
import * as langHelper from '@/common/langHelper'

const strings = new LocalizedStrings({
fr: {
FAQ_TITLE: 'FAQ',
MORE_QUESTIONS: 'Plus de questions ?',
FAQ_DOCUMENTS_TITLE: 'De quels documents ai-je besoin pour louer un véhicule ?',
FAQ_DOCUMENTS_TEXT: "Pour louer un véhicule, vous aurez généralement besoin d'un permis de conduire valide, d'une carte de crédit pour le paiement et le dépôt de garantie, ainsi que d'une preuve d'assurance. Des exigences supplémentaires peuvent varier en fonction de votre emplacement et du type de véhicule que vous louez.",
FAQ_SERVICES_TITLE: 'Proposez-vous des services de livraison et de restitution ?',
FAQ_SERVICES_TEXT: 'Oui, nous le faisons ! Nous proposons des services de livraison et de ramassage pratiques à divers endroits, notamment les aéroports, les hôtels, etc. Dites-nous simplement votre destination préférée et nous nous occuperons du reste.',
FAQ_AGE_TITLE: "Y a-t-il une limite d'âge pour louer un véhicule ?",
FAQ_AGE_TEXT: "Oui, l'âge minimum requis pour louer un véhicule est généralement de 18 ans. Cependant, certains endroits peuvent avoir des exigences d'âge plus élevées ou des restrictions supplémentaires pour certains types de véhicules.",
FAQ_CANCEL_TITLE: 'Que se passe-t-il si je dois annuler ma réservation ?',
FAQ_CANCEL_TEXT: "Nous comprenons que les plans peuvent changer, c'est pourquoi nous proposons des politiques d'annulation flexibles. Selon le moment de votre annulation, des frais peuvent s'appliquer. Veuillez vous référer à nos conditions générales ou contacter notre équipe d'assistance client pour obtenir de l'aide concernant les annulations.",
},
en: {
FAQ_TITLE: 'FAQ',
MORE_QUESTIONS: 'More questions?',
FAQ_DOCUMENTS_TITLE: 'What documents do I need to rent a vehicle?',
FAQ_DOCUMENTS_TEXT: "To rent a vehicle, you'll typically need a valid driver's license, a credit card for payment and security deposit, and proof of insurance. Additional requirements may vary depending on your location and the type of vehicle you're renting.",
FAQ_SERVICES_TITLE: 'Do you offer delivery and pickup services?',
FAQ_SERVICES_TEXT: "Yes, we do! We offer convenient delivery and pickup services to various locations, including airports, hotels, and more. Just let us know your preferred location, and we'll take care of the rest.",
FAQ_AGE_TITLE: 'Is there an age requirement for renting a vehicle?',
FAQ_AGE_TEXT: 'Yes, the minimum age requirement for renting a vehicle is usually 18 years old. However, some locations may have higher age requirements or additional restrictions for certain vehicle types.',
FAQ_CANCEL_TITLE: 'What happens if I need to cancel my reservation?',
FAQ_CANCEL_TEXT: 'We understand that plans can change, which is why we offer flexible cancellation policies. Depending on the timing of your cancellation, there may be applicable fees. Please refer to our terms and conditions or contact our customer support team for assistance with cancellations.',
},
es: {
FAQ_TITLE: 'Preguntas frecuentes',
MORE_QUESTIONS: '¿Más preguntas?',
FAQ_DOCUMENTS_TITLE: '¿Qué documentos necesito para alquilar un vehículo?',
FAQ_DOCUMENTS_TEXT: 'Para alquilar un vehículo, normalmente necesitarás una licencia de conducir válida, una tarjeta de crédito para el pago y el depósito de seguridad, y un comprobante de seguro. Los requisitos adicionales pueden variar según tu ubicación y el tipo de vehículo que estés alquilando.',
FAQ_SERVICES_TITLE: '¿Ofrecen servicios de entrega y recogida?',
FAQ_SERVICES_TEXT: '¡Sí, lo hacemos! Ofrecemos cómodos servicios de entrega y recogida en varios lugares, incluidos aeropuertos, hoteles y más. Solo indícanos tu ubicación preferida y nosotros nos encargaremos del resto.',
FAQ_AGE_TITLE: '¿Existe un requisito de edad para alquilar un vehículo?',
FAQ_AGE_TEXT: 'Sí, la edad mínima requerida para alquilar un vehículo suele ser de 18 años. Sin embargo, algunas ubicaciones pueden tener requisitos de edad más altos o restricciones adicionales para ciertos tipos de vehículos.',
FAQ_CANCEL_TITLE: '¿Qué sucede si necesito cancelar mi reserva?',
FAQ_CANCEL_TEXT: 'Entendemos que los planes pueden cambiar, por eso ofrecemos políticas de cancelación flexibles. Según el momento de tu cancelación, pueden aplicarse cargos. Consulta nuestros términos y condiciones o comunícate con nuestro equipo de atención al cliente para obtener ayuda con las cancelaciones.',
},
})

langHelper.setLanguage(strings)
export { strings }
3 changes: 3 additions & 0 deletions frontend/src/lang/footer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const strings = new LocalizedStrings({
CONTACT: 'Contact',
SECURE_PAYMENT: 'Paiement 100% sécurisé avec BookCars',
PRIVACY_POLICY: 'Politique de Confidentialité',
FAQ: 'FAQ',
},
en: {
COPYRIGHT_PART1,
Expand All @@ -31,6 +32,7 @@ const strings = new LocalizedStrings({
CONTACT: 'Contact',
SECURE_PAYMENT: '100% secure payment with BookCars',
PRIVACY_POLICY: 'Privacy Policy',
FAQ: 'FAQ',
},
es: {
COPYRIGHT_PART1,
Expand All @@ -45,6 +47,7 @@ const strings = new LocalizedStrings({
CONTACT: 'Contacto',
SECURE_PAYMENT: 'Pago 100% seguro con BookCars',
PRIVACY_POLICY: 'Política de Privacidad',
FAQ: 'Preguntas frecuentes',
},
})

Expand Down
3 changes: 3 additions & 0 deletions frontend/src/lang/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const strings = new LocalizedStrings({
SUPPLIERS: 'Fournisseurs',
LOCATIONS: 'Lieux',
PRIVACY_POLICY: 'Politique de Confidentialité',
FAQ: 'FAQ',
},
en: {
SIGN_IN: 'Sign in',
Expand All @@ -29,6 +30,7 @@ const strings = new LocalizedStrings({
SUPPLIERS: 'Suppliers',
LOCATIONS: 'Locations',
PRIVACY_POLICY: 'Privacy Policy',
FAQ: 'FAQ',
},
es: {
SIGN_IN: 'Iniciar sesión',
Expand All @@ -43,6 +45,7 @@ const strings = new LocalizedStrings({
SUPPLIERS: 'Proveedores',
LOCATIONS: 'Ubicaciones',
PRIVACY_POLICY: 'Política de Privacidad',
FAQ: 'Preguntas frecuentes',
},
})

Expand Down
30 changes: 0 additions & 30 deletions frontend/src/lang/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ const strings = new LocalizedStrings({
SERVICE_INSTANT_BOOKING: "Pas d'attente ! Une fois que vous avez choisi votre véhicule et effectué votre réservation, vous recevrez une confirmation immédiate, garantissant un processus de location fluide et sans tracas.",
SERVICES_SUPPORT_TITLE: 'Assistance client 24h/24 et 7j/7',
SERVICES_SUPPORT: "Que vous réserviez un véhicule, que vous ayez besoin d'assistance sur la route ou que vous ayez des questions, notre équipe d'assistance dédiée est disponible 24 heures sur 24.",
FAQ_TITLE: 'FAQ',
MORE_QUESTIONS: 'Plus de questions ?',
FAQ_DOCUMENTS_TITLE: 'De quels documents ai-je besoin pour louer un véhicule ?',
FAQ_DOCUMENTS_TEXT: "Pour louer un véhicule, vous aurez généralement besoin d'un permis de conduire valide, d'une carte de crédit pour le paiement et le dépôt de garantie, ainsi que d'une preuve d'assurance. Des exigences supplémentaires peuvent varier en fonction de votre emplacement et du type de véhicule que vous louez.",
FAQ_SERVICES_TITLE: 'Proposez-vous des services de livraison et de restitution ?',
FAQ_SERVICES_TEXT: 'Oui, nous le faisons ! Nous proposons des services de livraison et de ramassage pratiques à divers endroits, notamment les aéroports, les hôtels, etc. Dites-nous simplement votre destination préférée et nous nous occuperons du reste.',
FAQ_AGE_TITLE: "Y a-t-il une limite d'âge pour louer un véhicule ?",
FAQ_AGE_TEXT: "Oui, l'âge minimum requis pour louer un véhicule est généralement de 18 ans. Cependant, certains endroits peuvent avoir des exigences d'âge plus élevées ou des restrictions supplémentaires pour certains types de véhicules.",
FAQ_CANCEL_TITLE: 'Que se passe-t-il si je dois annuler ma réservation ?',
FAQ_CANCEL_TEXT: "Nous comprenons que les plans peuvent changer, c'est pourquoi nous proposons des politiques d'annulation flexibles. Selon le moment de votre annulation, des frais peuvent s'appliquer. Veuillez vous référer à nos conditions générales ou contacter notre équipe d'assistance client pour obtenir de l'aide concernant les annulations.",
CUSTOMER_CARE_TITLE: 'Service client BookCars',
CONTACT_US: 'Nous Contacter',
CUSTOMER_CARE_SUBTITLE: 'Toujours là pour vous aider',
Expand Down Expand Up @@ -105,16 +95,6 @@ const strings = new LocalizedStrings({
SERVICE_INSTANT_BOOKING: "No waiting around! Once you choose your vehicle and complete your booking, you'll receive an immediate confirmation, ensuring a smooth and hassle-free rental process.",
SERVICES_SUPPORT_TITLE: '24/7 Customer Support',
SERVICES_SUPPORT: "Whether you're booking a vehicle, need assistance on the road, or have any questions, our dedicated support team is available around the clock.",
FAQ_TITLE: 'FAQ',
MORE_QUESTIONS: 'More questions?',
FAQ_DOCUMENTS_TITLE: 'What documents do I need to rent a vehicle?',
FAQ_DOCUMENTS_TEXT: "To rent a vehicle, you'll typically need a valid driver's license, a credit card for payment and security deposit, and proof of insurance. Additional requirements may vary depending on your location and the type of vehicle you're renting.",
FAQ_SERVICES_TITLE: 'Do you offer delivery and pickup services?',
FAQ_SERVICES_TEXT: "Yes, we do! We offer convenient delivery and pickup services to various locations, including airports, hotels, and more. Just let us know your preferred location, and we'll take care of the rest.",
FAQ_AGE_TITLE: 'Is there an age requirement for renting a vehicle?',
FAQ_AGE_TEXT: 'Yes, the minimum age requirement for renting a vehicle is usually 18 years old. However, some locations may have higher age requirements or additional restrictions for certain vehicle types.',
FAQ_CANCEL_TITLE: 'What happens if I need to cancel my reservation?',
FAQ_CANCEL_TEXT: 'We understand that plans can change, which is why we offer flexible cancellation policies. Depending on the timing of your cancellation, there may be applicable fees. Please refer to our terms and conditions or contact our customer support team for assistance with cancellations.',
CUSTOMER_CARE_TITLE: 'BookCars Customer Care',
CONTACT_US: 'Contact Us',
CUSTOMER_CARE_SUBTITLE: 'Always Here to Help',
Expand Down Expand Up @@ -166,16 +146,6 @@ const strings = new LocalizedStrings({
SERVICE_INSTANT_BOOKING: '¡Sin esperas! Una vez que elijas tu vehículo y completes tu reserva, recibirás una confirmación inmediata, lo que garantiza un proceso de alquiler sin complicaciones y sin complicaciones.',
SERVICES_SUPPORT_TITLE: 'Atención al cliente las 24 horas, los 7 días de la semana',
SERVICES_SUPPORT: 'Ya sea que estés reservando un vehículo, necesites asistencia en la carretera o tengas alguna pregunta, nuestro equipo de soporte dedicado está disponible las 24 horas.',
FAQ_TITLE: 'Preguntas frecuentes',
MORE_QUESTIONS: '¿Más preguntas?',
FAQ_DOCUMENTS_TITLE: '¿Qué documentos necesito para alquilar un vehículo?',
FAQ_DOCUMENTS_TEXT: 'Para alquilar un vehículo, normalmente necesitarás una licencia de conducir válida, una tarjeta de crédito para el pago y el depósito de seguridad, y un comprobante de seguro. Los requisitos adicionales pueden variar según tu ubicación y el tipo de vehículo que estés alquilando.',
FAQ_SERVICES_TITLE: '¿Ofrecen servicios de entrega y recogida?',
FAQ_SERVICES_TEXT: '¡Sí, lo hacemos! Ofrecemos cómodos servicios de entrega y recogida en varios lugares, incluidos aeropuertos, hoteles y más. Solo indícanos tu ubicación preferida y nosotros nos encargaremos del resto.',
FAQ_AGE_TITLE: '¿Existe un requisito de edad para alquilar un vehículo?',
FAQ_AGE_TEXT: 'Sí, la edad mínima requerida para alquilar un vehículo suele ser de 18 años. Sin embargo, algunas ubicaciones pueden tener requisitos de edad más altos o restricciones adicionales para ciertos tipos de vehículos.',
FAQ_CANCEL_TITLE: '¿Qué sucede si necesito cancelar mi reserva?',
FAQ_CANCEL_TEXT: 'Entendemos que los planes pueden cambiar, por eso ofrecemos políticas de cancelación flexibles. Según el momento de tu cancelación, pueden aplicarse cargos. Consulta nuestros términos y condiciones o comunícate con nuestro equipo de atención al cliente para obtener ayuda con las cancelaciones.',
CUSTOMER_CARE_TITLE: 'Atención al cliente de BookCars',
CONTACT_US: 'Contáctanos',
CUSTOMER_CARE_SUBTITLE: 'Siempre aquí para ayudar',
Expand Down
18 changes: 18 additions & 0 deletions frontend/src/pages/Faq.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react'
import FaqList from '@/components/FaqList'
import Footer from '@/components/Footer'
import Layout from '@/components/Layout'

import '@/assets/css/faq.css'

const Faq = () => (
<Layout strict={false}>
<div className="faq">
<FaqList />
</div>

<Footer />
</Layout>
)

export default Faq
Loading

0 comments on commit 075db75

Please sign in to comment.