feat: added country disabling feature (#1084)
* feat: added country disabling feature * fix: lint errors * test: added test case for disabled countries * refactor: combined test cases
This commit is contained in:
committed by
Awais Ansari
parent
8498d9f04f
commit
776cd125a2
@@ -22,6 +22,7 @@ export const initialState = {
|
||||
drafts: {},
|
||||
isLoadingProfile: true,
|
||||
isAuthenticatedUserProfile: false,
|
||||
disabledCountries: ['RU'],
|
||||
};
|
||||
|
||||
const profilePage = (state = initialState, action = {}) => {
|
||||
|
||||
@@ -23,6 +23,7 @@ export const isLoadingProfileSelector = state => state.profilePage.isLoadingProf
|
||||
export const currentlyEditingFieldSelector = state => state.profilePage.currentlyEditingField;
|
||||
export const accountErrorsSelector = state => state.profilePage.errors;
|
||||
export const isAuthenticatedUserProfileSelector = state => state.profilePage.isAuthenticatedUserProfile;
|
||||
export const disabledCountriesSelector = state => state.profilePage.disabledCountries;
|
||||
|
||||
export const editableFormModeSelector = createSelector(
|
||||
profileAccountSelector,
|
||||
@@ -130,10 +131,14 @@ export const countrySelector = createSelector(
|
||||
editableFormSelector,
|
||||
sortedCountriesSelector,
|
||||
countryMessagesSelector,
|
||||
(editableForm, sortedCountries, countryMessages) => ({
|
||||
disabledCountriesSelector,
|
||||
profileAccountSelector,
|
||||
(editableForm, sortedCountries, countryMessages, disabledCountries, account) => ({
|
||||
...editableForm,
|
||||
sortedCountries,
|
||||
countryMessages,
|
||||
disabledCountries,
|
||||
committedCountry: account.country,
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user