add concatct page
This commit is contained in:
31
yoga-app/src/api/strapi/query/contact.json
Normal file
31
yoga-app/src/api/strapi/query/contact.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"fields": ["*"],
|
||||
"populate": {
|
||||
"contactUs": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"google_maps": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"subscribe": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"footer": {
|
||||
"fields": ["*"],
|
||||
"populate": {
|
||||
"links": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"contactUsEmail": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"contactUsLocation": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"contactUsPhoneNumber": {
|
||||
"fields": ["*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,13 @@ import homeQuery from "@/api/strapi/query/home.json";
|
||||
import servicesQuery from "@/api/strapi/query/services.json";
|
||||
import pricesQuery from "@/api/strapi/query/prices.json";
|
||||
import faqQuery from "@/api/strapi/query/faq.json";
|
||||
import contactQuery from "@/api/strapi/query/contact.json";
|
||||
import {YogaBlogPost_Plain} from "@/types/generated-strapi-interfaces/api/yoga-blog-post";
|
||||
import {Home_Plain} from "@/types/generated-strapi-interfaces/api/home";
|
||||
import {ServicesPage_Plain} from "@/types/generated-strapi-interfaces/api/services-page";
|
||||
import {PricesPage_Plain} from "@/types/generated-strapi-interfaces/api/prices-page";
|
||||
import {FaqPage_Plain} from "@/types/generated-strapi-interfaces/api/faq-page";
|
||||
import {ContactPage_Plain} from "@/types/generated-strapi-interfaces/api/contact-page";
|
||||
|
||||
|
||||
class StrapiApi{
|
||||
@@ -47,6 +49,9 @@ class StrapiApi{
|
||||
public getFaqPage(): Promise<FaqPage_Plain>{
|
||||
return this.getJson("/api/faq-page?",faqQuery);
|
||||
}
|
||||
public getContactPage(): Promise<ContactPage_Plain>{
|
||||
return this.getJson("/api/contact-page?",contactQuery);
|
||||
}
|
||||
|
||||
|
||||
public getBlog(blogId: string): Promise<YogaBlogPost_Plain>{
|
||||
|
||||
36
yoga-app/src/app/contact/page.tsx
Normal file
36
yoga-app/src/app/contact/page.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
import strapiApi from "@/api/strapi/strapi-api";
|
||||
import SubHeaderComponent from "@/components/subHeader.component";
|
||||
import FaqComponent from "@/components/faq.component";
|
||||
import BlogPostsComponent from "@/components/blog.posts.component";
|
||||
import SubscribeComponent from "@/components/subscribe.component";
|
||||
import FooterComponent from "@/components/footer.component";
|
||||
import AosComponent from "@/components/aos.component";
|
||||
import BootstrapComponent from "@/components/bootstrap.component";
|
||||
import React from "react";
|
||||
import ContactUsComponent from "@/components/contact.us.component";
|
||||
import GoogleMapsComponent from "@/components/google.maps.component";
|
||||
|
||||
export default async function ContactPage(){
|
||||
|
||||
const {
|
||||
header,
|
||||
description,
|
||||
contactUs,
|
||||
google_maps,
|
||||
subscribe,
|
||||
footer
|
||||
} = await strapiApi.getContactPage();
|
||||
return (
|
||||
<>
|
||||
{ <SubHeaderComponent header1={header} description={description} /> }
|
||||
{ contactUs && <ContactUsComponent contactUs={contactUs} /> }
|
||||
{ google_maps && <GoogleMapsComponent config={google_maps} /> }
|
||||
{ subscribe && <SubscribeComponent config={subscribe} styleClass={"contact_subscribe_section"} /> }
|
||||
{ footer && <FooterComponent config={footer} />}
|
||||
<AosComponent />
|
||||
<BootstrapComponent />
|
||||
</>
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import SubscribeComponent from "@/components/subscribe.component";
|
||||
import strapiApi from "@/api/strapi/strapi-api";
|
||||
import SubHeaderComponent from "@/components/subHeader.component";
|
||||
import FaqComponent from "@/components/faq.component";
|
||||
import BootstrapComponent from "@/components/bootstrap.component";
|
||||
|
||||
export default async function About() {
|
||||
const {
|
||||
@@ -30,6 +31,7 @@ export default async function About() {
|
||||
{ subscribe && <SubscribeComponent config={subscribe} /> }
|
||||
{ footer && <FooterComponent config={footer} /> }
|
||||
<AosComponent />
|
||||
<BootstrapComponent />
|
||||
</>
|
||||
|
||||
);
|
||||
|
||||
@@ -14,6 +14,7 @@ const pathToBreadCrumbs = (path: string) => {
|
||||
'about' : 'Rólam',
|
||||
'services' : 'Szolgáltatásaim',
|
||||
'prices' : 'Áraim',
|
||||
'faq' : 'GYIK',
|
||||
}
|
||||
if ( mapping.hasOwnProperty(path)){
|
||||
return mapping[path];
|
||||
|
||||
@@ -18,10 +18,12 @@ export default function FaqQaComponent({id,qa,isOpen,onClick}: Props){
|
||||
return (
|
||||
<div className="accordion-card">
|
||||
<div className="card-header" id={"heading" + id}>
|
||||
<a href="#" onClick={ (event) => {
|
||||
event.preventDefault();
|
||||
onClick(id)
|
||||
}} className={clsx("btn", "btn-link", {"collapsed": !isOpen})}
|
||||
<a href="#"
|
||||
// onClick={ (event) => {
|
||||
// event.preventDefault();
|
||||
// onClick(id)
|
||||
// }}
|
||||
className={clsx("btn", "btn-link", {"collapsed": !isOpen})}
|
||||
data-toggle="collapse" data-target={"#collapse" + id}
|
||||
aria-expanded="false" aria-controls={"collapse" + id}>
|
||||
<h6>{qa.question}</h6>
|
||||
|
||||
26
yoga-app/src/components/google.maps.component.tsx
Normal file
26
yoga-app/src/components/google.maps.component.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import {
|
||||
YogaGoogleMapsComponent,
|
||||
YogaGoogleMapsComponent_Plain
|
||||
} from "@/types/generated-strapi-interfaces/api/yoga-google-maps-component";
|
||||
|
||||
export interface Props{
|
||||
config: YogaGoogleMapsComponent_Plain
|
||||
}
|
||||
|
||||
export default function GoogleMapsComponent({config}: Props){
|
||||
|
||||
if(!config?.google_maps_url){
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="contact_map_section">
|
||||
<div className="row">
|
||||
<div className="col-lg-12 col-md-12 col-sm-12 col-xs-12"
|
||||
dangerouslySetInnerHTML={{ __html: config.google_maps_url }}
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -8,7 +8,8 @@ export interface MenuItem{
|
||||
href?: string;
|
||||
label: string;
|
||||
children?: MenuItem[];
|
||||
active?: boolean
|
||||
active?: boolean,
|
||||
styleClass?: string;
|
||||
}
|
||||
export interface Props{
|
||||
menuItems: MenuItem[];
|
||||
@@ -58,7 +59,7 @@ const MenuItemComponent: FC<MenuItemProps> = ({menuItem, dropdownItem}: MenuIte
|
||||
return (
|
||||
// <li className="nav-item active">
|
||||
<li className={clsx("nav-item", {"active": menuItem.active})}>
|
||||
<a className={clsx("nav-link", {"dropdown-item":dropdownItem})} href={menuItem.href}>{menuItem.label}</a>
|
||||
<a className={clsx("nav-link", {"dropdown-item":dropdownItem},menuItem.styleClass)} href={menuItem.href}>{menuItem.label}</a>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,12 +2,17 @@ import YogaImageComponent from "@/components/yoga.image.component";
|
||||
import {
|
||||
YogaSubscribeNowComponent_Plain
|
||||
} from "@/types/generated-strapi-interfaces/api/yoga-subscribe-now-component";
|
||||
import clsx from "clsx";
|
||||
export interface Props{
|
||||
config: YogaSubscribeNowComponent_Plain
|
||||
config: YogaSubscribeNowComponent_Plain,
|
||||
styleClass: string
|
||||
}
|
||||
const SubscribeComponent = ({config: {title,header,placeHolderEmail,buttonSubscribeLabel}}: Props) => {
|
||||
const SubscribeComponent = ({
|
||||
config: {title,header,placeHolderEmail,buttonSubscribeLabel},
|
||||
styleClass
|
||||
}: Props) => {
|
||||
return (
|
||||
<section className="subscribe_section">
|
||||
<section className={clsx("subscribe_section",styleClass)}>
|
||||
<div className="container">
|
||||
<div className="subscribe_background_image">
|
||||
<div className="row">
|
||||
|
||||
@@ -27,11 +27,15 @@ export const MAIN_MENU:MenuItem[] = [
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Team',
|
||||
label: 'Rólam',
|
||||
href: '/team'
|
||||
},
|
||||
{
|
||||
label: 'Blog',
|
||||
href: '/'
|
||||
href: '/blog'
|
||||
}, {
|
||||
label: 'Kapcsolat',
|
||||
href: '/contact',
|
||||
styleClass: "contact_us"
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user