| | import { get } from 'lodash'; |
| | import { getAutomatedTransfer } from 'calypso/state/automated-transfer/selectors/get-automated-transfer'; |
| | import type { AppState } from 'calypso/types'; |
| |
|
| | import 'calypso/state/automated-transfer/init'; |
| |
|
| | |
| | |
| | |
| | export { getAutomatedTransfer } from 'calypso/state/automated-transfer/selectors/get-automated-transfer'; |
| | export { getAutomatedTransferStatus } from 'calypso/state/automated-transfer/selectors/get-automated-transfer-status'; |
| | export { isAutomatedTransferActive } from 'calypso/state/automated-transfer/selectors/is-automated-transfer-active'; |
| | export { isAutomatedTransferFailed } from 'calypso/state/automated-transfer/selectors/is-automated-transfer-failed'; |
| | export { default as isFetchingAutomatedTransferStatus } from 'calypso/state/automated-transfer/selectors/is-fetching-automated-transfer-status'; |
| |
|
| | export interface DomainNames { |
| | current: string; |
| | new: string; |
| | } |
| |
|
| | export interface EligibilityWarning { |
| | description: string; |
| | name: string; |
| | id: string; |
| | supportPostId?: number; |
| | supportUrl?: string; |
| | domainNames?: DomainNames; |
| | } |
| |
|
| | export interface EligibilityData { |
| | lastUpdate: number; |
| | eligibilityHolds?: string[]; |
| | eligibilityWarnings?: EligibilityWarning[]; |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | export const getEligibilityData = ( state: AppState ): EligibilityData => |
| | get( state, 'eligibility', { lastUpdate: 0 } ); |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | export const getEligibility = ( state: AppState, siteId: number | null ) => |
| | getEligibilityData( getAutomatedTransfer( state, siteId ) ); |
| |
|
| | |
| | |
| | |
| | |
| | |
| | export const getEligibilityStatus = ( state: AppState ): boolean => |
| | !! get( state, 'lastUpdate', 0 ) && ! get( state, 'eligibilityHolds', [] ).length; |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | export const isEligibleForAutomatedTransfer = ( state: AppState, siteId: number | null ) => |
| | getEligibilityStatus( getEligibility( state, siteId ) ); |
| |
|