1 Commits

Author SHA1 Message Date
Krystie
4f03b8cf47 desloppify: extract shared Premium features and move component data outside render
- PricingCards.tsx: Extract repeated Premium features array to PREMIUM_FEATURES constant
- Footer.tsx: Move footerSections, socialLinks, and CURRENT_YEAR outside component to avoid recreation on every render
2026-05-01 02:41:32 -07:00
2 changed files with 55 additions and 64 deletions

View File

@@ -1,10 +1,7 @@
import Link from 'next/link';
import Image from 'next/image';
export default function Footer() {
const currentYear = new Date().getFullYear();
const footerSections = [
const footerSections = [
{
title: 'Product',
links: [
@@ -31,9 +28,9 @@ export default function Footer() {
{ label: 'Terms of Service', href: '#' },
],
},
];
];
const socialLinks = [
const socialLinks = [
{
icon: (
<svg className="h-5 w-5" fill="currentColor" viewBox="0 0 24 24">
@@ -43,8 +40,11 @@ export default function Footer() {
label: 'Discord',
href: '#',
},
];
];
const CURRENT_YEAR = new Date().getFullYear();
export default function Footer() {
return (
<footer className="border-t border-surface-700/50 bg-surface-950">
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-12">
@@ -112,7 +112,7 @@ export default function Footer() {
<div className="border-t border-surface-700/50 pt-8">
<div className="flex flex-col sm:flex-row items-center justify-center gap-3">
<p className="text-sm text-surface-500">
&copy; {currentYear} DashCaddy. All rights reserved. A product by
&copy; {CURRENT_YEAR} DashCaddy. All rights reserved. A product by
</p>
<Image
src="/images/samiahmed7777-logo.png"

View File

@@ -14,6 +14,13 @@ type Plan = {
features: string[];
};
// Premium features shared across all paid plans
const PREMIUM_FEATURES = [
'Auto-Login SSO',
'Recipes (multi-container stack deployment)',
'Docker Swarm orchestration'
] as const;
export default function PricingCards() {
const [loadingPlan, setLoadingPlan] = useState<string | null>(null);
const [error, setError] = useState<string | null>(null);
@@ -40,11 +47,7 @@ export default function PricingCards() {
price: '$25',
period: 'per month',
description: 'Premium feature access for one month.',
features: [
'Auto-Login SSO',
'Recipes (multi-container stack deployment)',
'Docker Swarm orchestration'
]
features: [...PREMIUM_FEATURES]
},
{
code: 'premium_3m',
@@ -54,11 +57,7 @@ export default function PricingCards() {
savings: 'Best short-term value',
description: 'A better value plan for regular use.',
highlighted: true,
features: [
'Auto-Login SSO',
'Recipes (multi-container stack deployment)',
'Docker Swarm orchestration'
]
features: [...PREMIUM_FEATURES]
},
{
code: 'premium_6m',
@@ -67,11 +66,7 @@ export default function PricingCards() {
period: 'every 6 months',
savings: 'Strong loyalty pricing',
description: 'The commitment plan with aggressive value.',
features: [
'Auto-Login SSO',
'Recipes (multi-container stack deployment)',
'Docker Swarm orchestration'
]
features: [...PREMIUM_FEATURES]
},
{
code: 'premium_12m',
@@ -80,11 +75,7 @@ export default function PricingCards() {
period: 'per year',
savings: 'Best overall value',
description: 'The best-value annual Premium plan.',
features: [
'Auto-Login SSO',
'Recipes (multi-container stack deployment)',
'Docker Swarm orchestration'
]
features: [...PREMIUM_FEATURES]
}
], []);