[yoga-21] footer.component.tsx add editable image

This commit is contained in:
Roland Schneider 2025-08-26 22:07:19 +02:00
parent a3e57f295f
commit f1069f3124
13 changed files with 55 additions and 3 deletions

View File

@ -88,6 +88,9 @@
},
"contactUsPhoneNumber": {
"fields": ["*"]
},
"logo": {
"fields": ["name","mime","url"]
}
}
}

View File

@ -32,6 +32,9 @@
},
"contactUsPhoneNumber": {
"fields": ["*"]
},
"logo": {
"fields": ["name","mime","url"]
}
}
}

View File

@ -67,6 +67,9 @@
},
"contactUsPhoneNumber": {
"fields": ["*"]
},
"logo": {
"fields": ["name","mime","url"]
}
}
}

View File

@ -36,6 +36,9 @@
},
"contactUsPhoneNumber": {
"fields": ["*"]
},
"logo": {
"fields": ["name","mime","url"]
}
}
},

View File

@ -64,6 +64,9 @@
},
"contactUsPhoneNumber": {
"fields": ["*"]
},
"logo": {
"fields": ["name","mime","url"]
}
}
}

View File

@ -34,6 +34,9 @@
},
"contactUsPhoneNumber": {
"fields": ["*"]
},
"logo": {
"fields": ["name","mime","url"]
}
}
}

View File

@ -26,6 +26,9 @@
},
"contactUsPhoneNumber": {
"fields": ["*"]
},
"logo": {
"fields": ["name","mime","url"]
}
}
}

View File

@ -106,6 +106,9 @@
},
"contactUsPhoneNumber": {
"fields": ["*"]
},
"logo": {
"fields": ["name","mime","url"]
}
}
}

View File

@ -1,6 +1,8 @@
import Link from "next/link";
import YogaImageComponent from "@/components/yoga.image.component";
import {YogaFooter_Plain} from "@/types/generated-strapi-interfaces/api/yoga-footer";
import {StrapiFile} from "@/types/types";
import strapiApi from "@/api/strapi/strapi-api";
export interface Props{
config: YogaFooter_Plain
@ -14,10 +16,13 @@ const FooterComponent = ({ config: {
contactUsEmail,
contactUsLocation,
contactUsPhoneNumber,
copyRight
copyRight,
logo = undefined
} }: Props) => {
const imageFile: StrapiFile = logo as StrapiFile;
const imageUrl = strapiApi.getImageUrl(imageFile?.url)
console.info("imageUrl", imageUrl);
return (<section className="footer-section" id="footer_section">
<div className="container">
@ -26,7 +31,7 @@ const FooterComponent = ({ config: {
<div className="col-lg-3 col-md-4 col-sm-6 col-xs-12 d-lg-block d-none">
<div className="footer_logo">
<Link href="/index.html" className="text-decoration-none">
<figure className="mb-0"><YogaImageComponent src="/assets/images/footer_logo.png" alt=""
<figure className="mb-0"><YogaImageComponent src={imageUrl} alt=""
className="img-fluid"/></figure>
</Link>
</div>

View File

@ -1,8 +1,11 @@
// Interface automatically generated by schemas-to-ts
import { Link } from '../components/yoga-site/Link';
import { Media } from '../components/shared/Media';
import { Link_Plain } from '../components/yoga-site/Link';
import { Media_Plain } from '../components/shared/Media';
import { Link_NoRelations } from '../components/yoga-site/Link';
import { AdminPanelRelationPropertyModification } from '../common/AdminPanelRelationPropertyModification';
export interface YogaFooter {
id: number;
@ -17,6 +20,7 @@ export interface YogaFooter {
contactUsLocation?: Link;
copyRight?: string;
name?: string;
logo?: { data: Media };
};
}
export interface YogaFooter_Plain {
@ -31,6 +35,7 @@ export interface YogaFooter_Plain {
contactUsLocation?: Link_Plain;
copyRight?: string;
name?: string;
logo?: Media_Plain;
}
export interface YogaFooter_NoRelations {
@ -45,6 +50,7 @@ export interface YogaFooter_NoRelations {
contactUsLocation?: Link_NoRelations;
copyRight?: string;
name?: string;
logo?: number;
}
export interface YogaFooter_AdminPanelLifeCycle {
@ -59,4 +65,5 @@ export interface YogaFooter_AdminPanelLifeCycle {
contactUsLocation?: Link_Plain;
copyRight?: string;
name?: string;
logo?: AdminPanelRelationPropertyModification<Media_Plain>;
}

View File

@ -1,8 +1,11 @@
// Interface automatically generated by schemas-to-ts
import { Link } from '../components/yoga-site/Link';
import { Media } from '../components/shared/Media';
import { Link_Plain } from '../components/yoga-site/Link';
import { Media_Plain } from '../components/shared/Media';
import { Link_NoRelations } from '../components/yoga-site/Link';
import { AdminPanelRelationPropertyModification } from '../common/AdminPanelRelationPropertyModification';
export interface YogaFooter {
id: number;
@ -17,6 +20,7 @@ export interface YogaFooter {
contactUsLocation?: Link;
copyRight?: string;
name?: string;
logo?: { data: Media };
};
}
export interface YogaFooter_Plain {
@ -31,6 +35,7 @@ export interface YogaFooter_Plain {
contactUsLocation?: Link_Plain;
copyRight?: string;
name?: string;
logo?: Media_Plain;
}
export interface YogaFooter_NoRelations {
@ -45,6 +50,7 @@ export interface YogaFooter_NoRelations {
contactUsLocation?: Link_NoRelations;
copyRight?: string;
name?: string;
logo?: number;
}
export interface YogaFooter_AdminPanelLifeCycle {
@ -59,4 +65,5 @@ export interface YogaFooter_AdminPanelLifeCycle {
contactUsLocation?: Link_Plain;
copyRight?: string;
name?: string;
logo?: AdminPanelRelationPropertyModification<Media_Plain>;
}

View File

@ -50,6 +50,14 @@
},
"name": {
"type": "string"
},
"logo": {
"allowedTypes": [
"images",
"files"
],
"type": "media",
"multiple": false
}
}
}

View File

@ -1593,6 +1593,7 @@ export interface ApiYogaFooterYogaFooter extends Struct.CollectionTypeSchema {
'api::yoga-footer.yoga-footer'
> &
Schema.Attribute.Private;
logo: Schema.Attribute.Media<'images' | 'files'>;
name: Schema.Attribute.String;
publishedAt: Schema.Attribute.DateTime;
quickLinksHeader: Schema.Attribute.String;