add prices page
This commit is contained in:
63
yoga-app/src/api/strapi/query/prices.json
Normal file
63
yoga-app/src/api/strapi/query/prices.json
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"fields": ["*"],
|
||||
"populate": {
|
||||
"price": {
|
||||
"fields": ["*"],
|
||||
"populate": {
|
||||
"prices": {
|
||||
"fields": ["*"],
|
||||
"populate": {
|
||||
"icon": {
|
||||
"fields": ["name","mime","url"]
|
||||
},
|
||||
"image": {
|
||||
"fields": ["name","mime","url"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"discount": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"blogs": {
|
||||
"fields": ["*"],
|
||||
"populate": {
|
||||
"button": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"posts": {
|
||||
"fields": ["name", "id", "header","documentId" ],
|
||||
"populate": {
|
||||
"tags": {
|
||||
"fields": ["*" ]
|
||||
},
|
||||
"teaserImage": {
|
||||
"fields": ["name","mime","url"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"subscribe": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"footer": {
|
||||
"fields": ["*"],
|
||||
"populate": {
|
||||
"links": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"contactUsEmail": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"contactUsLocation": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"contactUsPhoneNumber": {
|
||||
"fields": ["*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,11 @@ import qs from "qs";
|
||||
import aboutQuery from "@/api/strapi/query/about.json";
|
||||
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 {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";
|
||||
|
||||
|
||||
class StrapiApi{
|
||||
@@ -36,6 +38,11 @@ class StrapiApi{
|
||||
return this.getJson("/api/services-page?",servicesQuery);
|
||||
}
|
||||
|
||||
public getPricesPage(): Promise<PricesPage_Plain>{
|
||||
return this.getJson("/api/prices-page?",pricesQuery);
|
||||
}
|
||||
|
||||
|
||||
public getBlog(blogId: string): Promise<YogaBlogPost_Plain>{
|
||||
return this.getJson("/api/yoga-blog-posts/"+blogId,undefined);
|
||||
|
||||
|
||||
@@ -1,28 +1,39 @@
|
||||
import React from "react";
|
||||
import AosComponent from "@/components/aos.component";
|
||||
import OurServicesComponent from "@/components/our.services.component";
|
||||
import AboutUsComponent from "@/components/about.us.component";
|
||||
import OurSpecialitiesComponent from "@/components/our.specialities.component";
|
||||
import ContactUsComponent from "@/components/contact.us.component";
|
||||
import PricingComponent from "@/components/pricing.component";
|
||||
import FeedbackComponent from "@/components/feedbackComponent";
|
||||
import BlogPostsComponent from "@/components/blog.posts.component";
|
||||
import FooterComponent from "@/components/footer.component";
|
||||
import SubscribeComponent from "@/components/subscribe.component";
|
||||
import SubHeaderComponent from "@/components/subHeader.component";
|
||||
import YogaDiscountComponent from "@/components/yogaDiscountComponent";
|
||||
import {PricesPage_Plain} from "@/types/generated-strapi-interfaces/api/prices-page";
|
||||
import FooterComponent from "@/components/footer.component";
|
||||
import strapiApi from "@/api/strapi/strapi-api";
|
||||
import BootstrapComponent from "@/components/bootstrap.component";
|
||||
|
||||
export default function About() {
|
||||
export interface Props{
|
||||
config: PricesPage_Plain
|
||||
}
|
||||
export default async function PricesPage( ) {
|
||||
const {
|
||||
header,
|
||||
description,
|
||||
price,
|
||||
discount,
|
||||
blogs,
|
||||
subscribe,
|
||||
footer
|
||||
} = await strapiApi.getPricesPage();
|
||||
return (
|
||||
<>
|
||||
<OurServicesComponent />
|
||||
<AboutUsComponent />
|
||||
<OurSpecialitiesComponent />
|
||||
<ContactUsComponent />
|
||||
<PricingComponent />
|
||||
<FeedbackComponent />
|
||||
<BlogPostsComponent />
|
||||
<SubscribeComponent />
|
||||
<FooterComponent />
|
||||
<SubHeaderComponent header1={header} description={description}/>
|
||||
{ price && <PricingComponent config={price}/> }
|
||||
{ discount && <YogaDiscountComponent config={discount} /> }
|
||||
{ blogs && <BlogPostsComponent config={blogs} /> }
|
||||
{ subscribe && <SubscribeComponent config={subscribe} /> }
|
||||
{ footer && <FooterComponent config={footer} /> }
|
||||
<AosComponent />
|
||||
<BootstrapComponent />
|
||||
|
||||
</>
|
||||
|
||||
);
|
||||
|
||||
@@ -11,7 +11,8 @@ type Props = {
|
||||
const pathToBreadCrumbs = (path: string) => {
|
||||
const mapping: Record<string, string> = {
|
||||
'/' : 'Kezdőlap',
|
||||
'about' : 'Rólam'
|
||||
'about' : 'Rólam',
|
||||
'services' : 'Szolgáltatásaim',
|
||||
}
|
||||
if ( mapping.hasOwnProperty(path)){
|
||||
return mapping[path];
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// Interface automatically generated by schemas-to-ts
|
||||
|
||||
import { YogaPriceComponent } from './yoga-price-component';
|
||||
import { YogaDiscountComponent } from './yoga-discount-component';
|
||||
import { YogaBlogPostsComponent } from './yoga-blog-posts-component';
|
||||
import { YogaSubscribeNowComponent } from './yoga-subscribe-now-component';
|
||||
import { YogaFooter } from './yoga-footer';
|
||||
import { YogaPriceComponent_Plain } from './yoga-price-component';
|
||||
import { YogaDiscountComponent_Plain } from './yoga-discount-component';
|
||||
import { YogaBlogPostsComponent_Plain } from './yoga-blog-posts-component';
|
||||
import { YogaSubscribeNowComponent_Plain } from './yoga-subscribe-now-component';
|
||||
import { YogaFooter_Plain } from './yoga-footer';
|
||||
import { AdminPanelRelationPropertyModification } from '../common/AdminPanelRelationPropertyModification';
|
||||
|
||||
export interface PricesPage {
|
||||
id: number;
|
||||
attributes: {
|
||||
createdAt: Date; updatedAt: Date; publishedAt?: Date; header?: string;
|
||||
description?: string;
|
||||
price?: { data: YogaPriceComponent };
|
||||
discount?: { data: YogaDiscountComponent };
|
||||
blogs?: { data: YogaBlogPostsComponent };
|
||||
subscribe?: { data: YogaSubscribeNowComponent };
|
||||
footer?: { data: YogaFooter };
|
||||
};
|
||||
}
|
||||
export interface PricesPage_Plain {
|
||||
id: number;
|
||||
createdAt: Date; updatedAt: Date; publishedAt?: Date; header?: string;
|
||||
description?: string;
|
||||
price?: YogaPriceComponent_Plain;
|
||||
discount?: YogaDiscountComponent_Plain;
|
||||
blogs?: YogaBlogPostsComponent_Plain;
|
||||
subscribe?: YogaSubscribeNowComponent_Plain;
|
||||
footer?: YogaFooter_Plain;
|
||||
}
|
||||
|
||||
export interface PricesPage_NoRelations {
|
||||
id: number;
|
||||
createdAt: Date; updatedAt: Date; publishedAt?: Date; header?: string;
|
||||
description?: string;
|
||||
price?: number;
|
||||
discount?: number;
|
||||
blogs?: number;
|
||||
subscribe?: number;
|
||||
footer?: number;
|
||||
}
|
||||
|
||||
export interface PricesPage_AdminPanelLifeCycle {
|
||||
id: number;
|
||||
createdAt: Date; updatedAt: Date; publishedAt?: Date; header?: string;
|
||||
description?: string;
|
||||
price?: AdminPanelRelationPropertyModification<YogaPriceComponent_Plain>;
|
||||
discount?: AdminPanelRelationPropertyModification<YogaDiscountComponent_Plain>;
|
||||
blogs?: AdminPanelRelationPropertyModification<YogaBlogPostsComponent_Plain>;
|
||||
subscribe?: AdminPanelRelationPropertyModification<YogaSubscribeNowComponent_Plain>;
|
||||
footer?: AdminPanelRelationPropertyModification<YogaFooter_Plain>;
|
||||
}
|
||||
Reference in New Issue
Block a user