Compare commits
3 Commits
f33e97666e
...
87b3709191
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87b3709191 | ||
|
|
05659df254 | ||
|
|
128de83c9a |
5
dev.sh
5
dev.sh
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
cd environment/dev/docker-compose/yogastic
|
|
||||||
docker compose up -d
|
|
||||||
|
|
||||||
@@ -1,44 +1,29 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import strapiApi from "@/api/strapi/strapi-api";
|
import strapiApi from "@/api/strapi/strapi-api";
|
||||||
import {BlocksContent} from "@strapi/blocks-react-renderer";
|
import {BlocksContent, BlocksRenderer} from "@strapi/blocks-react-renderer";
|
||||||
import SubscribeComponent from "@/components/subscribe.component";
|
import SubscribeComponent from "@/components/subscribe.component";
|
||||||
import FooterComponent from "@/components/footer.component";
|
import FooterComponent from "@/components/footer.component";
|
||||||
import SubHeaderComponent from "@/components/subHeader.component";
|
import SubHeaderComponent from "@/components/subHeader.component";
|
||||||
import AosComponent from "@/components/aos.component";
|
import AosComponent from "@/components/aos.component";
|
||||||
import styles from './page.module.css'
|
import styles from './page.module.css'
|
||||||
import NextBlocksRenderer from "@/components/next.blocks.renderer";
|
import NextBlocksRenderer from "@/components/next.blocks.renderer";
|
||||||
import clsx from "clsx";
|
|
||||||
|
|
||||||
const rewriteStrapiImageUrlToNextImageUrl = (content: BlocksContent) =>{
|
|
||||||
console.info("content", content);
|
|
||||||
for(const item of content){
|
|
||||||
if ( item.type == 'image'){
|
|
||||||
const imageData = item.image;
|
|
||||||
const url = new URL(imageData.url);
|
|
||||||
imageData.url = strapiApi.getImageUrl(url.pathname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function ServiceArticlePage({params}: {
|
export default async function ServiceArticlePage({params}: {
|
||||||
params: Promise<{ slug: string }>
|
params: Promise<{ slug: string }>
|
||||||
}) {
|
}) {
|
||||||
const {slug} = await params
|
const {slug} = await params
|
||||||
const {footer, subscribeNow} = await strapiApi.getServicePage();
|
const {header, description, footer, subscribeNow} = await strapiApi.getServicePage();
|
||||||
const servicesByName = await strapiApi.getService(slug);
|
const servicesByName = await strapiApi.getService(slug);
|
||||||
const selectedService = servicesByName[0];
|
const selectedService = servicesByName[0];
|
||||||
console.info("selectedService",selectedService);
|
const article = selectedService.article;
|
||||||
const article: BlocksContent = rewriteStrapiImageUrlToNextImageUrl( selectedService.article);
|
|
||||||
console.info(article);
|
console.info(article);
|
||||||
|
|
||||||
|
selectedService.article
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{selectedService && selectedService.header && selectedService.description &&
|
{selectedService && selectedService.header && selectedService.description &&
|
||||||
<SubHeaderComponent header1={selectedService.header} description={selectedService.description}/>}
|
<SubHeaderComponent header1={selectedService.header} description={selectedService.description}/>}
|
||||||
<section className={clsx( styles.article, 'mb-3')}>
|
<section className={styles.article}>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className={"row"}>
|
<div className={"row"}>
|
||||||
<div className={"col-lg-12 col-md-12 col-sm-12 col-xs-12"}>
|
<div className={"col-lg-12 col-md-12 col-sm-12 col-xs-12"}>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
import {BlocksContent, BlocksRenderer} from "@strapi/blocks-react-renderer";
|
import {BlocksContent, BlocksRenderer} from "@strapi/blocks-react-renderer";
|
||||||
|
import strapiApi from "@/api/strapi/strapi-api";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import YogaImageComponent from "@/components/yoga.image.component";
|
import YogaImageComponent from "@/components/yoga.image.component";
|
||||||
|
|
||||||
@@ -12,11 +13,13 @@ const NextBlocksRenderer = ({ content }: Props) => {
|
|||||||
content={content}
|
content={content}
|
||||||
blocks={{
|
blocks={{
|
||||||
image: ({image}) => {
|
image: ({image}) => {
|
||||||
|
console.log(image);
|
||||||
|
const url = new URL(image.url);
|
||||||
return (
|
return (
|
||||||
<YogaImageComponent
|
<YogaImageComponent
|
||||||
src={image.url}
|
src={url.pathname}
|
||||||
// width={image.width}
|
width={image.width}
|
||||||
// height={image.height}
|
height={image.height}
|
||||||
alt={image.alternativeText || ""}
|
alt={image.alternativeText || ""}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export interface Props{
|
|||||||
config: YogaPrice_Plain
|
config: YogaPrice_Plain
|
||||||
}
|
}
|
||||||
|
|
||||||
export function PriceItemComponent({config: {header, description, option1,option2,price,pricePostfix, icon, image,buttonText}} : Props){
|
export function PriceItemComponent({config: {header,option1,option2,price,icon, image,buttonText}} : Props){
|
||||||
// there are some issues with the strapi generated types
|
// there are some issues with the strapi generated types
|
||||||
const iconFile: StrapiFile = icon as StrapiFile;
|
const iconFile: StrapiFile = icon as StrapiFile;
|
||||||
const imageFile: StrapiFile = image as StrapiFile;
|
const imageFile: StrapiFile = image as StrapiFile;
|
||||||
@@ -28,7 +28,6 @@ export function PriceItemComponent({config: {header, description, option1,option
|
|||||||
</div>
|
</div>
|
||||||
<div className="pricing_plans_box_lower_portion">
|
<div className="pricing_plans_box_lower_portion">
|
||||||
<h3>{header}</h3>
|
<h3>{header}</h3>
|
||||||
<p className={'text-center'}>{description}</p>
|
|
||||||
<ul className="list-unstyled">
|
<ul className="list-unstyled">
|
||||||
<li>
|
<li>
|
||||||
<i className="fa-solid fa-check" aria-hidden="true"></i>{option1}
|
<i className="fa-solid fa-check" aria-hidden="true"></i>{option1}
|
||||||
@@ -39,7 +38,7 @@ export function PriceItemComponent({config: {header, description, option1,option
|
|||||||
</ul>
|
</ul>
|
||||||
<div className="pricing_plans_span_wrapper">
|
<div className="pricing_plans_span_wrapper">
|
||||||
<span className="price">{price} FT</span>
|
<span className="price">{price} FT</span>
|
||||||
{ pricePostfix && <span className="per_month">{pricePostfix}</span> }
|
<span className="per_month">/per month</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="btn_wrapper">
|
<div className="btn_wrapper">
|
||||||
<a className="enroll_now_btn text-decoration-none" href="/pricing.html">{buttonText}</a>
|
<a className="enroll_now_btn text-decoration-none" href="/pricing.html">{buttonText}</a>
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ export interface YogaPrice {
|
|||||||
price?: number;
|
price?: number;
|
||||||
icon?: { data: Media };
|
icon?: { data: Media };
|
||||||
image?: { data: Media };
|
image?: { data: Media };
|
||||||
pricePostfix?: string;
|
|
||||||
description?: string;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
export interface YogaPrice_Plain {
|
export interface YogaPrice_Plain {
|
||||||
@@ -27,8 +25,6 @@ export interface YogaPrice_Plain {
|
|||||||
price?: number;
|
price?: number;
|
||||||
icon?: Media_Plain;
|
icon?: Media_Plain;
|
||||||
image?: Media_Plain;
|
image?: Media_Plain;
|
||||||
pricePostfix?: string;
|
|
||||||
description?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface YogaPrice_NoRelations {
|
export interface YogaPrice_NoRelations {
|
||||||
@@ -40,8 +36,6 @@ export interface YogaPrice_NoRelations {
|
|||||||
price?: number;
|
price?: number;
|
||||||
icon?: number;
|
icon?: number;
|
||||||
image?: number;
|
image?: number;
|
||||||
pricePostfix?: string;
|
|
||||||
description?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface YogaPrice_AdminPanelLifeCycle {
|
export interface YogaPrice_AdminPanelLifeCycle {
|
||||||
@@ -53,6 +47,4 @@ export interface YogaPrice_AdminPanelLifeCycle {
|
|||||||
price?: number;
|
price?: number;
|
||||||
icon?: AdminPanelRelationPropertyModification<Media_Plain>;
|
icon?: AdminPanelRelationPropertyModification<Media_Plain>;
|
||||||
image?: AdminPanelRelationPropertyModification<Media_Plain>;
|
image?: AdminPanelRelationPropertyModification<Media_Plain>;
|
||||||
pricePostfix?: string;
|
|
||||||
description?: string;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ export interface YogaPrice {
|
|||||||
price?: number;
|
price?: number;
|
||||||
icon?: { data: Media };
|
icon?: { data: Media };
|
||||||
image?: { data: Media };
|
image?: { data: Media };
|
||||||
pricePostfix?: string;
|
|
||||||
description?: string;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
export interface YogaPrice_Plain {
|
export interface YogaPrice_Plain {
|
||||||
@@ -27,8 +25,6 @@ export interface YogaPrice_Plain {
|
|||||||
price?: number;
|
price?: number;
|
||||||
icon?: Media_Plain;
|
icon?: Media_Plain;
|
||||||
image?: Media_Plain;
|
image?: Media_Plain;
|
||||||
pricePostfix?: string;
|
|
||||||
description?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface YogaPrice_NoRelations {
|
export interface YogaPrice_NoRelations {
|
||||||
@@ -40,8 +36,6 @@ export interface YogaPrice_NoRelations {
|
|||||||
price?: number;
|
price?: number;
|
||||||
icon?: number;
|
icon?: number;
|
||||||
image?: number;
|
image?: number;
|
||||||
pricePostfix?: string;
|
|
||||||
description?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface YogaPrice_AdminPanelLifeCycle {
|
export interface YogaPrice_AdminPanelLifeCycle {
|
||||||
@@ -53,6 +47,4 @@ export interface YogaPrice_AdminPanelLifeCycle {
|
|||||||
price?: number;
|
price?: number;
|
||||||
icon?: AdminPanelRelationPropertyModification<Media_Plain>;
|
icon?: AdminPanelRelationPropertyModification<Media_Plain>;
|
||||||
image?: AdminPanelRelationPropertyModification<Media_Plain>;
|
image?: AdminPanelRelationPropertyModification<Media_Plain>;
|
||||||
pricePostfix?: string;
|
|
||||||
description?: string;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
"info": {
|
"info": {
|
||||||
"singularName": "yoga-price",
|
"singularName": "yoga-price",
|
||||||
"pluralName": "yoga-prices",
|
"pluralName": "yoga-prices",
|
||||||
"displayName": "YogaPrice",
|
"displayName": "YogaPrice"
|
||||||
"description": ""
|
|
||||||
},
|
},
|
||||||
"options": {
|
"options": {
|
||||||
"draftAndPublish": true
|
"draftAndPublish": true
|
||||||
@@ -28,32 +27,24 @@
|
|||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"type": "media",
|
|
||||||
"multiple": false,
|
|
||||||
"required": false,
|
|
||||||
"allowedTypes": [
|
"allowedTypes": [
|
||||||
"images",
|
"images",
|
||||||
"files",
|
"files",
|
||||||
"videos",
|
"videos",
|
||||||
"audios"
|
"audios"
|
||||||
]
|
],
|
||||||
|
"type": "media",
|
||||||
|
"multiple": false
|
||||||
},
|
},
|
||||||
"image": {
|
"image": {
|
||||||
"type": "media",
|
|
||||||
"multiple": false,
|
|
||||||
"required": false,
|
|
||||||
"allowedTypes": [
|
"allowedTypes": [
|
||||||
"images",
|
"images",
|
||||||
"files",
|
"files",
|
||||||
"videos",
|
"videos",
|
||||||
"audios"
|
"audios"
|
||||||
]
|
],
|
||||||
},
|
"type": "media",
|
||||||
"pricePostfix": {
|
"multiple": false
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"type": "text"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
3
yoga-cms/types/generated/contentTypes.d.ts
vendored
3
yoga-cms/types/generated/contentTypes.d.ts
vendored
@@ -1680,7 +1680,6 @@ export interface ApiYogaPriceComponentYogaPriceComponent
|
|||||||
export interface ApiYogaPriceYogaPrice extends Struct.CollectionTypeSchema {
|
export interface ApiYogaPriceYogaPrice extends Struct.CollectionTypeSchema {
|
||||||
collectionName: 'yoga_prices';
|
collectionName: 'yoga_prices';
|
||||||
info: {
|
info: {
|
||||||
description: '';
|
|
||||||
displayName: 'YogaPrice';
|
displayName: 'YogaPrice';
|
||||||
pluralName: 'yoga-prices';
|
pluralName: 'yoga-prices';
|
||||||
singularName: 'yoga-price';
|
singularName: 'yoga-price';
|
||||||
@@ -1693,7 +1692,6 @@ export interface ApiYogaPriceYogaPrice extends Struct.CollectionTypeSchema {
|
|||||||
createdAt: Schema.Attribute.DateTime;
|
createdAt: Schema.Attribute.DateTime;
|
||||||
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||||
Schema.Attribute.Private;
|
Schema.Attribute.Private;
|
||||||
description: Schema.Attribute.Text;
|
|
||||||
header: Schema.Attribute.String;
|
header: Schema.Attribute.String;
|
||||||
icon: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>;
|
icon: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>;
|
||||||
image: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>;
|
image: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>;
|
||||||
@@ -1706,7 +1704,6 @@ export interface ApiYogaPriceYogaPrice extends Struct.CollectionTypeSchema {
|
|||||||
option1: Schema.Attribute.String;
|
option1: Schema.Attribute.String;
|
||||||
option2: Schema.Attribute.String;
|
option2: Schema.Attribute.String;
|
||||||
price: Schema.Attribute.Integer;
|
price: Schema.Attribute.Integer;
|
||||||
pricePostfix: Schema.Attribute.String;
|
|
||||||
publishedAt: Schema.Attribute.DateTime;
|
publishedAt: Schema.Attribute.DateTime;
|
||||||
updatedAt: Schema.Attribute.DateTime;
|
updatedAt: Schema.Attribute.DateTime;
|
||||||
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||||
|
|||||||
Reference in New Issue
Block a user