feat: Add About Us page CMS functionality with dedicated sections and image upload support.
This commit is contained in:
@@ -59,6 +59,53 @@ export interface TestimonialsContent {
|
||||
testimonials: TestimonialItem[];
|
||||
}
|
||||
|
||||
export interface AboutHeroContent {
|
||||
badge: string;
|
||||
headline: string;
|
||||
description: string;
|
||||
ctaButtonText: string;
|
||||
bannerImageUrl: string;
|
||||
bannerOverlayText: string;
|
||||
}
|
||||
|
||||
export interface AboutStatItem {
|
||||
value: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface AboutStatsContent {
|
||||
stats: AboutStatItem[];
|
||||
}
|
||||
|
||||
export interface AboutFeatureItem {
|
||||
iconPath: string;
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface AboutFeaturesContent {
|
||||
badge: string;
|
||||
features: AboutFeatureItem[];
|
||||
}
|
||||
|
||||
export interface AboutTeamMember {
|
||||
name: string;
|
||||
role: string;
|
||||
imageUrl: string;
|
||||
}
|
||||
|
||||
export interface AboutTeamContent {
|
||||
title: string;
|
||||
subtitle: string;
|
||||
members: AboutTeamMember[];
|
||||
}
|
||||
|
||||
export interface AboutCtaContent {
|
||||
title: string;
|
||||
description: string;
|
||||
buttonText: string;
|
||||
}
|
||||
|
||||
export interface CmsContentRecord {
|
||||
id: string;
|
||||
pageSlug: string;
|
||||
|
||||
@@ -72,4 +72,12 @@ export type {
|
||||
TestimonialsContent,
|
||||
TestimonialItem,
|
||||
StatItem,
|
||||
AboutHeroContent,
|
||||
AboutStatItem,
|
||||
AboutStatsContent,
|
||||
AboutFeatureItem,
|
||||
AboutFeaturesContent,
|
||||
AboutTeamMember,
|
||||
AboutTeamContent,
|
||||
AboutCtaContent,
|
||||
} from './cms.service';
|
||||
|
||||
@@ -1,8 +1,36 @@
|
||||
import api from './api';
|
||||
|
||||
interface PresignedUrlResponse {
|
||||
uploadUrl: string;
|
||||
publicUrl: string;
|
||||
key: string;
|
||||
}
|
||||
|
||||
class UploadService {
|
||||
private basePath = '/upload';
|
||||
|
||||
/**
|
||||
* Get a presigned upload URL for S3
|
||||
*/
|
||||
async getPresignedUploadUrl(filename: string, contentType: string, folder: string): Promise<PresignedUrlResponse> {
|
||||
const response = await api.post<{ data: PresignedUrlResponse }>(
|
||||
`${this.basePath}/presigned-url`,
|
||||
{ filename, contentType, folder }
|
||||
);
|
||||
return response.data.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload a file to S3 using a presigned URL
|
||||
*/
|
||||
async uploadFileToS3(uploadUrl: string, file: File): Promise<void> {
|
||||
await fetch(uploadUrl, {
|
||||
method: 'PUT',
|
||||
body: file,
|
||||
headers: { 'Content-Type': file.type },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a presigned download URL for an S3 key
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user