footer, feedback, subscribe
This commit is contained in:
@@ -5,15 +5,13 @@ 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 QuotesComponent from "@/components/quotes.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 BootstrapComponent from "@/components/bootstrap.component";
|
||||
import webApi from "@/app/api/web-client/web-api";
|
||||
import aboutUsComponent from "@/components/about.us.component";
|
||||
import pricingComponent from "@/components/pricing.component";
|
||||
|
||||
export default async function About() {
|
||||
const pageData = await webApi.getAboutPage();
|
||||
@@ -24,22 +22,25 @@ export default async function About() {
|
||||
contactUs,
|
||||
ourSpecialities,
|
||||
prices,
|
||||
blogs
|
||||
blogs,
|
||||
subscribeNow,
|
||||
footer,
|
||||
feedbacks
|
||||
} = pageData;
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<SubHeaderComponent header1={header?.header1} header2={header?.header2} description={header?.description}/>
|
||||
<OurServicesComponent title={ourServices?.title!} header={ourServices?.header!} description={ourServices?.description!} />
|
||||
{ header && <SubHeaderComponent header1={header?.header1} header2={header?.header2} description={header?.description}/> }
|
||||
{ ourServices && <OurServicesComponent title={ourServices?.title!} header={ourServices?.header!} description={ourServices?.description!} /> }
|
||||
{ aboutUs && <AboutUsComponent data={aboutUs}/>}
|
||||
{ ourSpecialities && <OurSpecialitiesComponent config={ourSpecialities} /> }
|
||||
{ contactUs && <ContactUsComponent contactUs={contactUs}/>}
|
||||
{ prices && <PricingComponent config={prices} /> }
|
||||
<QuotesComponent />
|
||||
{ feedbacks && <FeedbackComponent config={feedbacks} /> }
|
||||
{ blogs && <BlogPostsComponent config={blogs} />}
|
||||
<SubscribeComponent />
|
||||
<FooterComponent />
|
||||
{subscribeNow && <SubscribeComponent config={subscribeNow} /> }
|
||||
{ footer && <FooterComponent config={footer} />}
|
||||
<AosComponent />
|
||||
<BootstrapComponent />
|
||||
|
||||
|
||||
@@ -3,11 +3,34 @@
|
||||
"header": {
|
||||
"fields": ["header1","description"]
|
||||
},
|
||||
"footer": {
|
||||
"fields": ["*"],
|
||||
"populate": {
|
||||
"links": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"contactUsEmail": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"contactUsLocation": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"contactUsPhoneNumber": {
|
||||
"fields": ["*"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"subscribeNow": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"blogs": {
|
||||
"fields": ["*"],
|
||||
"populate": {
|
||||
"button": {
|
||||
"fields": ["*"]
|
||||
},
|
||||
"posts": {
|
||||
"fields": ["name", "id", "header" ],
|
||||
"fields": ["name", "id", "header","documentId" ],
|
||||
"populate": {
|
||||
"tags": {
|
||||
"fields": ["*" ]
|
||||
|
||||
@@ -3,28 +3,36 @@ import strapiClient from "@/app/api/strapi/strapi-client";
|
||||
import {StrapiQuery} from "@/app/api/strapi/strapi-query";
|
||||
import qs from "qs";
|
||||
import aboutQuery from "@/app/api/strapi/query/about.json";
|
||||
import {YogaBlogPost_Plain} from "@/types/generated-strapi-interfaces/api/yoga-blog-post";
|
||||
|
||||
|
||||
class StrapiApi{
|
||||
constructor( ) {
|
||||
}
|
||||
|
||||
protected async getJson<T>(path: string, params?: object){
|
||||
const query = params ? qs.stringify(params,{ arrayFormat: 'indices' , encode: false}) : "";
|
||||
const payload = await strapiClient.httpGetJson<T>(
|
||||
path+ query
|
||||
);
|
||||
return payload?.data;
|
||||
}
|
||||
|
||||
public getImageUrl(imagePath: string){
|
||||
return strapiClient.getImageUrl(imagePath);
|
||||
}
|
||||
public async getAboutPage(): Promise<About_Plain>{
|
||||
const query = qs.stringify(aboutQuery,{ arrayFormat: 'indices' , encode: false})
|
||||
const payload = await strapiClient.httpGetJson<About_Plain>(
|
||||
"/api/about?"+ query
|
||||
|
||||
);
|
||||
return payload?.data;
|
||||
|
||||
return this.getJson("/api/about?",aboutQuery);
|
||||
}
|
||||
|
||||
public getHomePage(){
|
||||
console.info('Get Home Page');
|
||||
return this.getJson("/api/home?",aboutQuery);
|
||||
|
||||
}
|
||||
|
||||
public getBlog(blogId: string): Promise<YogaBlogPost_Plain>{
|
||||
return this.getJson("/api/yoga-blog-posts/"+blogId,undefined);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
16
yoga-app/src/app/blog/[blogId]/page.tsx
Normal file
16
yoga-app/src/app/blog/[blogId]/page.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import strapiApi from "@/app/api/strapi/strapi-api";
|
||||
import clsx from "clsx";
|
||||
|
||||
export default async function BlogComponent({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ blogId: string }>
|
||||
}){
|
||||
const blogId = (await params).blogId
|
||||
const blog = await strapiApi.getBlog(blogId);
|
||||
return (
|
||||
<div className={clsx("container", "text-primary")}>
|
||||
<h1 className={clsx("container", "text-primary")}>{blog.header}</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
6
yoga-app/src/app/blog/page.tsx
Normal file
6
yoga-app/src/app/blog/page.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
export default function BlogListComponent(){
|
||||
return (
|
||||
<div>Blog list</div>
|
||||
)
|
||||
}
|
||||
@@ -5,7 +5,7 @@ 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 QuotesComponent from "@/components/quotes.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";
|
||||
@@ -18,7 +18,7 @@ export default function About() {
|
||||
<OurSpecialitiesComponent />
|
||||
<ContactUsComponent />
|
||||
<PricingComponent />
|
||||
<QuotesComponent />
|
||||
<FeedbackComponent />
|
||||
<BlogPostsComponent />
|
||||
<SubscribeComponent />
|
||||
<FooterComponent />
|
||||
|
||||
@@ -5,7 +5,7 @@ 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 QuotesComponent from "@/components/quotes.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";
|
||||
@@ -22,7 +22,7 @@ export default function Home() {
|
||||
<OurSpecialitiesComponent />
|
||||
<ContactUsComponent />
|
||||
<PricingComponent />
|
||||
<QuotesComponent />
|
||||
<FeedbackComponent />
|
||||
<BlogPostsComponent />
|
||||
<SubscribeComponent />
|
||||
<FooterComponent />
|
||||
|
||||
@@ -5,7 +5,7 @@ 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 QuotesComponent from "@/components/quotes.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";
|
||||
@@ -18,7 +18,7 @@ export default function About() {
|
||||
<OurSpecialitiesComponent />
|
||||
<ContactUsComponent />
|
||||
<PricingComponent />
|
||||
<QuotesComponent />
|
||||
<FeedbackComponent />
|
||||
<BlogPostsComponent />
|
||||
<SubscribeComponent />
|
||||
<FooterComponent />
|
||||
|
||||
@@ -5,7 +5,7 @@ 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 QuotesComponent from "@/components/quotes.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";
|
||||
@@ -18,7 +18,7 @@ export default function About() {
|
||||
<OurSpecialitiesComponent />
|
||||
<ContactUsComponent />
|
||||
<PricingComponent />
|
||||
<QuotesComponent />
|
||||
<FeedbackComponent />
|
||||
<BlogPostsComponent />
|
||||
<SubscribeComponent />
|
||||
<FooterComponent />
|
||||
|
||||
Reference in New Issue
Block a user