Skip to content

Commit

Permalink
feature(shared): links & slug
Browse files Browse the repository at this point in the history
  • Loading branch information
andrashee committed Nov 22, 2024
1 parent 09d4afb commit 1f2257e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
34 changes: 34 additions & 0 deletions admin/src/collections/Campaigns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,36 @@ export const campaignsCollection = buildAuditedCollection<Campaign>({
description: 'Visible in the fundraising page.',
multiline: true,
},
link_website: {
title: 'Website Link',
dataType: 'string',
validation: { required: false },
description: 'The link to the website (optional)',
},
link_instagram: {
title: 'Instagram Link',
dataType: 'string',
validation: { required: false },
description: 'The link to the Instagram profile (optional)',
},
link_tiktok: {
title: 'TikTok Link',
dataType: 'string',
validation: { required: false },
description: 'The link to the TikTok profile (optional)',
},
link_facebook: {
title: 'Facebook Link',
dataType: 'string',
validation: { required: false },
description: 'The link to the Facebook profile (optional)',
},
link_x: {
title: 'X (formerly Twitter) Link',
dataType: 'string',
validation: { required: false },
description: 'The link to the X profile (optional)',
},
amount_collected_chf: {
dataType: 'number',
name: 'Collected amount in CHF',
Expand Down Expand Up @@ -116,6 +146,10 @@ export const campaignsCollection = buildAuditedCollection<Campaign>({
description: 'Featured on campaign overview',
defaultValue: false,
},
slug: {
dataType: 'string',
name: 'Url Slug',
},
metadata_description: {
dataType: 'string',
name: 'Metadata Description',
Expand Down
11 changes: 11 additions & 0 deletions shared/src/types/campaign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export type Campaign = {
second_description?: string;
third_description_title?: string;
third_description?: string;
link_website?: string;
link_instagram?: string;
link_tiktok?: string;
link_facebook?: string;
link_x?: string;
amount_collected_chf: number; // automatically updated by incoming payments.
contributions: number; // automatically updated by incoming payments.
goal?: number;
Expand All @@ -20,6 +25,7 @@ export type Campaign = {
status: CampaignStatus;
public?: boolean;
featured?: boolean;
slug?: string; // optional, for nicer url instead of firestore id
metadata_description?: string;
metadata_ogImage?: string;
metadata_twitterImage?: string;
Expand All @@ -29,3 +35,8 @@ export enum CampaignStatus {
Active = 'active',
Inactive = 'inactive',
}

export type Link = {
name: string;
url: string;
};

0 comments on commit 1f2257e

Please sign in to comment.