add concatct page
This commit is contained in:
parent
3e3dbed6e6
commit
71f697c88f
2
api.http
2
api.http
@ -13,7 +13,7 @@ Accept: application/json
|
|||||||
#Authorization: Bearer {{token}}
|
#Authorization: Bearer {{token}}
|
||||||
|
|
||||||
### GET request with a header
|
### GET request with a header
|
||||||
GET {{domain}}/api/prices-page?fields[0]=*&populate[price][fields][0]=*&populate[price][populate][prices][fields][0]=*&populate[price][populate][prices][populate][icon][fields][0]=name&populate[price][populate][prices][populate][icon][fields][1]=mime&populate[price][populate][prices][populate][icon][fields][2]=url&populate[price][populate][prices][populate][image][fields][0]=name&populate[price][populate][prices][populate][image][fields][1]=mime&populate[price][populate][prices][populate][image][fields][2]=url&populate[discount][fields][0]=*&populate[blogs][fields][0]=*&populate[blogs][populate][button][fields][0]=*&populate[blogs][populate][posts][fields][0]=name&populate[blogs][populate][posts][fields][1]=id&populate[blogs][populate][posts][fields][2]=header&populate[blogs][populate][posts][fields][3]=documentId&populate[blogs][populate][posts][populate][tags][fields][0]=*&populate[blogs][populate][posts][populate][teaserImage][fields][0]=name&populate[blogs][populate][posts][populate][teaserImage][fields][1]=mime&populate[blogs][populate][posts][populate][teaserImage][fields][2]=url&populate[subscribeNow][fields][0]=*&populate[footer][fields][0]=*&populate[footer][populate][links][fields][0]=*&populate[footer][populate][contactUsEmail][fields][0]=*&populate[footer][populate][contactUsLocation][fields][0]=*&populate[footer][populate][contactUsPhoneNumber][fields][0]=*
|
GET {{domain}}/api/contact-page?fields[0]=*&populate[contactUs][fields][0]=*&populate[google_maps][fields][0]=*&populate[blogs][fields][0]=*&populate[blogs][populate][button][fields][0]=*&populate[blogs][populate][posts][fields][0]=name&populate[blogs][populate][posts][fields][1]=id&populate[blogs][populate][posts][fields][2]=header&populate[blogs][populate][posts][fields][3]=documentId&populate[blogs][populate][posts][populate][tags][fields][0]=*&populate[blogs][populate][posts][populate][teaserImage][fields][0]=name&populate[blogs][populate][posts][populate][teaserImage][fields][1]=mime&populate[blogs][populate][posts][populate][teaserImage][fields][2]=url&populate[subscribe][fields][0]=*&populate[footer][fields][0]=*&populate[footer][populate][links][fields][0]=*&populate[footer][populate][contactUsEmail][fields][0]=*&populate[footer][populate][contactUsLocation][fields][0]=*&populate[footer][populate][contactUsPhoneNumber][fields][0]=*
|
||||||
Accept: application/json
|
Accept: application/json
|
||||||
#Authorization: Bearer {{token}}
|
#Authorization: Bearer {{token}}
|
||||||
|
|
||||||
|
|||||||
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 servicesQuery from "@/api/strapi/query/services.json";
|
||||||
import pricesQuery from "@/api/strapi/query/prices.json";
|
import pricesQuery from "@/api/strapi/query/prices.json";
|
||||||
import faqQuery from "@/api/strapi/query/faq.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 {YogaBlogPost_Plain} from "@/types/generated-strapi-interfaces/api/yoga-blog-post";
|
||||||
import {Home_Plain} from "@/types/generated-strapi-interfaces/api/home";
|
import {Home_Plain} from "@/types/generated-strapi-interfaces/api/home";
|
||||||
import {ServicesPage_Plain} from "@/types/generated-strapi-interfaces/api/services-page";
|
import {ServicesPage_Plain} from "@/types/generated-strapi-interfaces/api/services-page";
|
||||||
import {PricesPage_Plain} from "@/types/generated-strapi-interfaces/api/prices-page";
|
import {PricesPage_Plain} from "@/types/generated-strapi-interfaces/api/prices-page";
|
||||||
import {FaqPage_Plain} from "@/types/generated-strapi-interfaces/api/faq-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{
|
class StrapiApi{
|
||||||
@ -47,6 +49,9 @@ class StrapiApi{
|
|||||||
public getFaqPage(): Promise<FaqPage_Plain>{
|
public getFaqPage(): Promise<FaqPage_Plain>{
|
||||||
return this.getJson("/api/faq-page?",faqQuery);
|
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>{
|
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 strapiApi from "@/api/strapi/strapi-api";
|
||||||
import SubHeaderComponent from "@/components/subHeader.component";
|
import SubHeaderComponent from "@/components/subHeader.component";
|
||||||
import FaqComponent from "@/components/faq.component";
|
import FaqComponent from "@/components/faq.component";
|
||||||
|
import BootstrapComponent from "@/components/bootstrap.component";
|
||||||
|
|
||||||
export default async function About() {
|
export default async function About() {
|
||||||
const {
|
const {
|
||||||
@ -30,6 +31,7 @@ export default async function About() {
|
|||||||
{ subscribe && <SubscribeComponent config={subscribe} /> }
|
{ subscribe && <SubscribeComponent config={subscribe} /> }
|
||||||
{ footer && <FooterComponent config={footer} /> }
|
{ footer && <FooterComponent config={footer} /> }
|
||||||
<AosComponent />
|
<AosComponent />
|
||||||
|
<BootstrapComponent />
|
||||||
</>
|
</>
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|||||||
@ -14,6 +14,7 @@ const pathToBreadCrumbs = (path: string) => {
|
|||||||
'about' : 'Rólam',
|
'about' : 'Rólam',
|
||||||
'services' : 'Szolgáltatásaim',
|
'services' : 'Szolgáltatásaim',
|
||||||
'prices' : 'Áraim',
|
'prices' : 'Áraim',
|
||||||
|
'faq' : 'GYIK',
|
||||||
}
|
}
|
||||||
if ( mapping.hasOwnProperty(path)){
|
if ( mapping.hasOwnProperty(path)){
|
||||||
return mapping[path];
|
return mapping[path];
|
||||||
|
|||||||
@ -18,10 +18,12 @@ export default function FaqQaComponent({id,qa,isOpen,onClick}: Props){
|
|||||||
return (
|
return (
|
||||||
<div className="accordion-card">
|
<div className="accordion-card">
|
||||||
<div className="card-header" id={"heading" + id}>
|
<div className="card-header" id={"heading" + id}>
|
||||||
<a href="#" onClick={ (event) => {
|
<a href="#"
|
||||||
event.preventDefault();
|
// onClick={ (event) => {
|
||||||
onClick(id)
|
// event.preventDefault();
|
||||||
}} className={clsx("btn", "btn-link", {"collapsed": !isOpen})}
|
// onClick(id)
|
||||||
|
// }}
|
||||||
|
className={clsx("btn", "btn-link", {"collapsed": !isOpen})}
|
||||||
data-toggle="collapse" data-target={"#collapse" + id}
|
data-toggle="collapse" data-target={"#collapse" + id}
|
||||||
aria-expanded="false" aria-controls={"collapse" + id}>
|
aria-expanded="false" aria-controls={"collapse" + id}>
|
||||||
<h6>{qa.question}</h6>
|
<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;
|
href?: string;
|
||||||
label: string;
|
label: string;
|
||||||
children?: MenuItem[];
|
children?: MenuItem[];
|
||||||
active?: boolean
|
active?: boolean,
|
||||||
|
styleClass?: string;
|
||||||
}
|
}
|
||||||
export interface Props{
|
export interface Props{
|
||||||
menuItems: MenuItem[];
|
menuItems: MenuItem[];
|
||||||
@ -58,7 +59,7 @@ const MenuItemComponent: FC<MenuItemProps> = ({menuItem, dropdownItem}: MenuIte
|
|||||||
return (
|
return (
|
||||||
// <li className="nav-item active">
|
// <li className="nav-item active">
|
||||||
<li className={clsx("nav-item", {"active": menuItem.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>
|
</li>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,12 +2,17 @@ import YogaImageComponent from "@/components/yoga.image.component";
|
|||||||
import {
|
import {
|
||||||
YogaSubscribeNowComponent_Plain
|
YogaSubscribeNowComponent_Plain
|
||||||
} from "@/types/generated-strapi-interfaces/api/yoga-subscribe-now-component";
|
} from "@/types/generated-strapi-interfaces/api/yoga-subscribe-now-component";
|
||||||
|
import clsx from "clsx";
|
||||||
export interface Props{
|
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 (
|
return (
|
||||||
<section className="subscribe_section">
|
<section className={clsx("subscribe_section",styleClass)}>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="subscribe_background_image">
|
<div className="subscribe_background_image">
|
||||||
<div className="row">
|
<div className="row">
|
||||||
|
|||||||
@ -27,11 +27,15 @@ export const MAIN_MENU:MenuItem[] = [
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Team',
|
label: 'Rólam',
|
||||||
href: '/team'
|
href: '/team'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Blog',
|
label: 'Blog',
|
||||||
href: '/'
|
href: '/blog'
|
||||||
|
}, {
|
||||||
|
label: 'Kapcsolat',
|
||||||
|
href: '/contact',
|
||||||
|
styleClass: "contact_us"
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
78
yoga-cms/types/generated/contentTypes.d.ts
vendored
78
yoga-cms/types/generated/contentTypes.d.ts
vendored
@ -540,6 +540,52 @@ export interface ApiCategoryCategory extends Struct.CollectionTypeSchema {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ApiContactPageContactPage extends Struct.SingleTypeSchema {
|
||||||
|
collectionName: 'contact_pages';
|
||||||
|
info: {
|
||||||
|
description: '';
|
||||||
|
displayName: 'ContactPage';
|
||||||
|
pluralName: 'contact-pages';
|
||||||
|
singularName: 'contact-page';
|
||||||
|
};
|
||||||
|
options: {
|
||||||
|
draftAndPublish: true;
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
contactUs: Schema.Attribute.Relation<
|
||||||
|
'oneToOne',
|
||||||
|
'api::yoga-contact-us.yoga-contact-us'
|
||||||
|
>;
|
||||||
|
createdAt: Schema.Attribute.DateTime;
|
||||||
|
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
description: Schema.Attribute.Text;
|
||||||
|
footer: Schema.Attribute.Relation<
|
||||||
|
'oneToOne',
|
||||||
|
'api::yoga-footer.yoga-footer'
|
||||||
|
>;
|
||||||
|
google_maps: Schema.Attribute.Relation<
|
||||||
|
'oneToOne',
|
||||||
|
'api::yoga-google-maps-component.yoga-google-maps-component'
|
||||||
|
>;
|
||||||
|
header: Schema.Attribute.String;
|
||||||
|
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||||
|
localizations: Schema.Attribute.Relation<
|
||||||
|
'oneToMany',
|
||||||
|
'api::contact-page.contact-page'
|
||||||
|
> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
publishedAt: Schema.Attribute.DateTime;
|
||||||
|
subscribe: Schema.Attribute.Relation<
|
||||||
|
'oneToOne',
|
||||||
|
'api::yoga-subscribe-now-component.yoga-subscribe-now-component'
|
||||||
|
>;
|
||||||
|
updatedAt: Schema.Attribute.DateTime;
|
||||||
|
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export interface ApiFaqPageFaqPage extends Struct.SingleTypeSchema {
|
export interface ApiFaqPageFaqPage extends Struct.SingleTypeSchema {
|
||||||
collectionName: 'faq_pages';
|
collectionName: 'faq_pages';
|
||||||
info: {
|
info: {
|
||||||
@ -1407,6 +1453,36 @@ export interface ApiYogaFooterYogaFooter extends Struct.CollectionTypeSchema {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ApiYogaGoogleMapsComponentYogaGoogleMapsComponent
|
||||||
|
extends Struct.CollectionTypeSchema {
|
||||||
|
collectionName: 'yoga_google_maps_components';
|
||||||
|
info: {
|
||||||
|
displayName: 'YogaGoogleMapsComponent';
|
||||||
|
pluralName: 'yoga-google-maps-components';
|
||||||
|
singularName: 'yoga-google-maps-component';
|
||||||
|
};
|
||||||
|
options: {
|
||||||
|
draftAndPublish: true;
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
createdAt: Schema.Attribute.DateTime;
|
||||||
|
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
google_maps_url: Schema.Attribute.Text;
|
||||||
|
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||||
|
localizations: Schema.Attribute.Relation<
|
||||||
|
'oneToMany',
|
||||||
|
'api::yoga-google-maps-component.yoga-google-maps-component'
|
||||||
|
> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
name: Schema.Attribute.String;
|
||||||
|
publishedAt: Schema.Attribute.DateTime;
|
||||||
|
updatedAt: Schema.Attribute.DateTime;
|
||||||
|
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export interface ApiYogaMainHeaderComponentYogaMainHeaderComponent
|
export interface ApiYogaMainHeaderComponentYogaMainHeaderComponent
|
||||||
extends Struct.CollectionTypeSchema {
|
extends Struct.CollectionTypeSchema {
|
||||||
collectionName: 'yoga_main_header_components';
|
collectionName: 'yoga_main_header_components';
|
||||||
@ -2413,6 +2489,7 @@ declare module '@strapi/strapi' {
|
|||||||
'api::article.article': ApiArticleArticle;
|
'api::article.article': ApiArticleArticle;
|
||||||
'api::author.author': ApiAuthorAuthor;
|
'api::author.author': ApiAuthorAuthor;
|
||||||
'api::category.category': ApiCategoryCategory;
|
'api::category.category': ApiCategoryCategory;
|
||||||
|
'api::contact-page.contact-page': ApiContactPageContactPage;
|
||||||
'api::faq-page.faq-page': ApiFaqPageFaqPage;
|
'api::faq-page.faq-page': ApiFaqPageFaqPage;
|
||||||
'api::global.global': ApiGlobalGlobal;
|
'api::global.global': ApiGlobalGlobal;
|
||||||
'api::home.home': ApiHomeHome;
|
'api::home.home': ApiHomeHome;
|
||||||
@ -2433,6 +2510,7 @@ declare module '@strapi/strapi' {
|
|||||||
'api::yoga-faq-component.yoga-faq-component': ApiYogaFaqComponentYogaFaqComponent;
|
'api::yoga-faq-component.yoga-faq-component': ApiYogaFaqComponentYogaFaqComponent;
|
||||||
'api::yoga-faq-qa.yoga-faq-qa': ApiYogaFaqQaYogaFaqQa;
|
'api::yoga-faq-qa.yoga-faq-qa': ApiYogaFaqQaYogaFaqQa;
|
||||||
'api::yoga-footer.yoga-footer': ApiYogaFooterYogaFooter;
|
'api::yoga-footer.yoga-footer': ApiYogaFooterYogaFooter;
|
||||||
|
'api::yoga-google-maps-component.yoga-google-maps-component': ApiYogaGoogleMapsComponentYogaGoogleMapsComponent;
|
||||||
'api::yoga-main-header-component.yoga-main-header-component': ApiYogaMainHeaderComponentYogaMainHeaderComponent;
|
'api::yoga-main-header-component.yoga-main-header-component': ApiYogaMainHeaderComponentYogaMainHeaderComponent;
|
||||||
'api::yoga-our-services-component.yoga-our-services-component': ApiYogaOurServicesComponentYogaOurServicesComponent;
|
'api::yoga-our-services-component.yoga-our-services-component': ApiYogaOurServicesComponentYogaOurServicesComponent;
|
||||||
'api::yoga-price-component.yoga-price-component': ApiYogaPriceComponentYogaPriceComponent;
|
'api::yoga-price-component.yoga-price-component': ApiYogaPriceComponentYogaPriceComponent;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user