-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
148 lines (127 loc) · 3.79 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import { IProps as ICorporateEmissionFormProps } from 'containers/Modals/CorporateEmissionForm';
import { IProps as IEditInterestProps } from 'containers/Modals/EditInterests';
import { IProps as IEmissionPathSelectProps } from 'containers/Modals/EmissionPathSelect';
import { IExternalLinkDisclaimerModalProps } from 'containers/Modals/ExternalLinkDisclaimerModal/ExternalLinkDisclaimerModal';
import { IProps as IInexperiencedEmissionsWizardProps } from 'containers/Modals/InexperiencedEmissionsWizard';
import { IProps as IDataPrivacyInfoPromptProps } from 'containers/Modals/MissingDataPrivacyInfoPrompt';
import { IProps as ITaskListPromptProps } from 'containers/Modals/TaskListPrompt';
export enum ModalType {
NULL,
EDIT_INTERESTS,
EMISSION_PATH_SELECT,
TASK_LIST_PROMPT,
INEXPERIENCED_USER_FLOW,
AMBITION_SIMULATION_PROMPT,
TARGET_FORM,
CORPORATE_EMISSION_FORM,
REMOVE_EMISSION_FORM,
IEA_INFO,
EXTERNAL_LINK_DISCLAIMER,
EMISSION_ALLOCATION,
NEW_CONNECTION,
MISSING_DATA_PRIVACY_INFO_PROMPT,
INVITATION_SENT,
}
export enum CloseModalType {
LATER = 'LATER',
}
export type EditInterestsContentProps = Omit<IEditInterestProps, 'closeModal'>;
export type TaskListPromptContentProps = Omit<
ITaskListPromptProps,
'closeModal'
>;
export type MissingDataPrivacyInfoPromptContentProps = Omit<
IDataPrivacyInfoPromptProps,
'closeModal'
>;
export type InexperiencedEmissionsWizardProps = Omit<
IInexperiencedEmissionsWizardProps,
'closeModal'
>;
export type CorporateEmissionFormProps = Omit<
ICorporateEmissionFormProps,
'closeModal'
>;
export type EmissionPathSelectProps = Omit<
IEmissionPathSelectProps,
'closeModal'
>;
export type ExternalLinkDisclaimerModalProps = Omit<
IExternalLinkDisclaimerModalProps,
'closeModal'
>;
interface INull {
modalType: ModalType.NULL;
}
interface IEditInterests {
modalType: ModalType.EDIT_INTERESTS;
contentProps: EditInterestsContentProps;
}
interface ITaskListPrompt {
modalType: ModalType.TASK_LIST_PROMPT;
contentProps: TaskListPromptContentProps;
}
interface IMissingDataPrivacyInfoPrompt {
modalType: ModalType.MISSING_DATA_PRIVACY_INFO_PROMPT;
contentProps: MissingDataPrivacyInfoPromptContentProps;
}
interface IEmissionPathSelect {
modalType: ModalType.EMISSION_PATH_SELECT;
contentProps: EmissionPathSelectProps;
}
interface IInexperiencedEmissionsWizard {
modalType: ModalType.INEXPERIENCED_USER_FLOW;
contentProps: InexperiencedEmissionsWizardProps;
}
interface IAmbitionSimulationPrompt {
modalType: ModalType.AMBITION_SIMULATION_PROMPT;
}
interface ITargetForm {
modalType: ModalType.TARGET_FORM;
}
interface ICorporateEmissionForm {
modalType: ModalType.CORPORATE_EMISSION_FORM;
contentProps: CorporateEmissionFormProps;
}
interface IRemoveEmissionForm {
modalType: ModalType.REMOVE_EMISSION_FORM;
}
interface IIEAPopupSelector {
modalType: ModalType.IEA_INFO;
}
interface IExternalLinkDisclaimer {
modalType: ModalType.EXTERNAL_LINK_DISCLAIMER;
contentProps: ExternalLinkDisclaimerModalProps;
}
interface IEmissionAllocation {
modalType: ModalType.EMISSION_ALLOCATION;
onClose?: (type?: CloseModalType) => void;
}
interface INewConnection {
modalType: ModalType.NEW_CONNECTION;
onClose?: (type?: CloseModalType) => void;
}
interface IInvitationSent {
modalType: ModalType.INVITATION_SENT;
}
export type ModalState =
| INull
| IEditInterests
| ITaskListPrompt
| IEmissionPathSelect
| IInexperiencedEmissionsWizard
| IAmbitionSimulationPrompt
| IMissingDataPrivacyInfoPrompt
| ITargetForm
| ICorporateEmissionForm
| IRemoveEmissionForm
| IIEAPopupSelector
| IEmissionAllocation
| INewConnection
| IExternalLinkDisclaimer
| IInvitationSent;
export interface IModalContext {
modalState: ModalState | null;
openModal: (modalState: ModalState) => void;
closeModal: () => void;
}