mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-02-13 22:00:25 -05:00
refactor: move types to config from client (#51266)
This commit is contained in:
committed by
GitHub
parent
97f33a9d9c
commit
dec82f802f
@@ -11,7 +11,8 @@ import {
|
||||
amountsConfig,
|
||||
durationsConfig,
|
||||
defaultDonation,
|
||||
modalDefaultDonation
|
||||
modalDefaultDonation,
|
||||
type DonationConfig
|
||||
} from '../../../../config/donation-settings';
|
||||
import { defaultDonationFormState } from '../../redux';
|
||||
import { updateDonationFormState, postCharge } from '../../redux/actions';
|
||||
@@ -35,8 +36,7 @@ import {
|
||||
PaymentContext,
|
||||
PostPayment,
|
||||
HandleAuthentication,
|
||||
DonationApprovalData,
|
||||
DonationConfig
|
||||
DonationApprovalData
|
||||
} from './types';
|
||||
|
||||
import './donation.css';
|
||||
|
||||
@@ -6,17 +6,14 @@ import {
|
||||
paypalConfigurator,
|
||||
paypalConfigTypes,
|
||||
defaultDonation,
|
||||
PaymentProvider
|
||||
PaymentProvider,
|
||||
type DonationDuration,
|
||||
type DonationAmount
|
||||
} from '../../../../config/donation-settings';
|
||||
import envData from '../../../../config/env.json';
|
||||
import { userSelector, signInLoadingSelector } from '../../redux/selectors';
|
||||
import { Themes } from '../settings/theme';
|
||||
import {
|
||||
DonationApprovalData,
|
||||
PostPayment,
|
||||
DonationDuration,
|
||||
DonationAmount
|
||||
} from './types';
|
||||
import { DonationApprovalData, PostPayment } from './types';
|
||||
import PayPalButtonScriptLoader from './paypal-button-script-loader';
|
||||
|
||||
type PaypalButtonProps = {
|
||||
|
||||
@@ -8,13 +8,6 @@ export type HandleAuthentication = (
|
||||
paymentMethod: string
|
||||
) => Promise<PaymentIntentResult | { error: { type: string } }>;
|
||||
|
||||
export type DonationAmount = 500 | 1000 | 2000 | 3000 | 4000 | 5000;
|
||||
export type DonationDuration = 'one-time' | 'month';
|
||||
export interface DonationConfig {
|
||||
donationAmount: DonationAmount;
|
||||
donationDuration: DonationDuration;
|
||||
}
|
||||
|
||||
export interface PostPayment {
|
||||
paymentProvider: PaymentProvider;
|
||||
data?: DonationApprovalData;
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
// Configuration for client side
|
||||
import { DonationConfig } from '../client/src/components/Donation/types';
|
||||
|
||||
export type DonationAmount = 500 | 1000 | 2000 | 3000 | 4000 | 5000;
|
||||
export type DonationDuration = 'one-time' | 'month';
|
||||
export interface DonationConfig {
|
||||
donationAmount: DonationAmount;
|
||||
donationDuration: DonationDuration;
|
||||
}
|
||||
|
||||
export const durationsConfig: {
|
||||
month: 'monthly';
|
||||
@@ -80,8 +86,6 @@ export const paypalConfigTypes = {
|
||||
}
|
||||
};
|
||||
|
||||
type DonationAmount = 500 | 1000 | 2000 | 3000 | 4000 | 5000;
|
||||
|
||||
interface OneTimeConfig {
|
||||
amount: DonationAmount;
|
||||
duration: 'one-time';
|
||||
|
||||
Reference in New Issue
Block a user