feat: Add About Us page CMS functionality with dedicated sections and image upload support.

This commit is contained in:
pradeepkumar
2026-02-24 03:30:35 +05:30
parent f435173566
commit 956ccede2d
4 changed files with 385 additions and 27 deletions

View File

@@ -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;

View File

@@ -72,4 +72,12 @@ export type {
TestimonialsContent,
TestimonialItem,
StatItem,
AboutHeroContent,
AboutStatItem,
AboutStatsContent,
AboutFeatureItem,
AboutFeaturesContent,
AboutTeamMember,
AboutTeamContent,
AboutCtaContent,
} from './cms.service';

View File

@@ -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
*/