Arch changes and feature flags

This commit is contained in:
James Pattinson
2025-11-23 15:46:51 +00:00
parent 6f1d09cd77
commit e1659c07ea
22 changed files with 577 additions and 119 deletions
+24 -19
View File
@@ -1,5 +1,6 @@
import React, { useState, useEffect } from 'react';
import { membershipService, paymentService, MembershipTier, MembershipCreateData, PaymentCreateData } from '../services/membershipService';
import { useFeatureFlags } from '../contexts/FeatureFlagContext';
import SquarePayment from './SquarePayment';
interface MembershipSetupProps {
@@ -15,6 +16,8 @@ const MembershipSetup: React.FC<MembershipSetupProps> = ({ onMembershipCreated,
const [paymentMethod, setPaymentMethod] = useState<'square' | 'cash' | null>(null);
const [error, setError] = useState('');
const [createdMembershipId, setCreatedMembershipId] = useState<number | null>(null);
const { isEnabled } = useFeatureFlags();
useEffect(() => {
loadTiers();
@@ -202,26 +205,28 @@ const MembershipSetup: React.FC<MembershipSetupProps> = ({ onMembershipCreated,
<span></span>
</button>
<button
className="btn btn-secondary"
onClick={() => handlePaymentMethodSelect('cash')}
disabled={loading}
style={{
padding: '16px',
textAlign: 'left',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center'
}}
>
<div>
<strong>Cash Payment</strong>
<div style={{ fontSize: '14px', marginTop: '4px', opacity: 0.8 }}>
Pay in person or by check
{isEnabled('CASH_PAYMENT_ENABLED') && (
<button
className="btn btn-secondary"
onClick={() => handlePaymentMethodSelect('cash')}
disabled={loading}
style={{
padding: '16px',
textAlign: 'left',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center'
}}
>
<div>
<strong>Cash Payment</strong>
<div style={{ fontSize: '14px', marginTop: '4px', opacity: 0.8 }}>
Pay in person or by check
</div>
</div>
</div>
<span></span>
</button>
<span></span>
</button>
)}
</div>
<div style={{ marginTop: '20px', textAlign: 'center' }}>