-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove connected react router (#379)
- Loading branch information
Melisa Anabella Rossi
authored
Jun 11, 2024
1 parent
abefce1
commit d7863ee
Showing
12 changed files
with
39 additions
and
50 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
import { connect } from 'react-redux' | ||
import { closeAllModals } from 'decentraland-dapps/dist/modules/modal' | ||
import { isConnected } from 'decentraland-dapps/dist/modules/wallet/selectors' | ||
import { getIsSubscriptionEnabled } from '../../modules/features/selectors' | ||
import { RootState } from '../../modules/reducer' | ||
import Routes from './Routes' | ||
import { MapStateProps } from './Routes.types' | ||
import { MapDispatch, MapDispatchProps, MapStateProps } from './Routes.types' | ||
|
||
const mapState = (state: RootState): MapStateProps => ({ | ||
isConnected: isConnected(state), | ||
isSubscriptionEnabled: !!getIsSubscriptionEnabled(state) | ||
}) | ||
|
||
export default connect(mapState)(Routes) | ||
const mapDispatch = (dispatch: MapDispatch): MapDispatchProps => ({ | ||
closeAllModals: () => dispatch(closeAllModals()) | ||
}) | ||
|
||
export default connect(mapState, mapDispatch)(Routes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,11 @@ | ||
import { LOCATION_CHANGE } from 'connected-react-router' | ||
import { closeAllModals, closeModal } from 'decentraland-dapps/dist/modules/modal/actions' | ||
import { ModalState } from 'decentraland-dapps/dist/modules/modal/reducer' | ||
import { getOpenModals } from 'decentraland-dapps/dist/modules/modal/selectors' | ||
import { delay, put, select, takeEvery } from 'redux-saga/effects' | ||
import { closeModal } from 'decentraland-dapps/dist/modules/modal/actions' | ||
import { put, takeEvery } from 'redux-saga/effects' | ||
import { IMPORT_WITHDRAWAL_SUCCESS } from '../mana/actions' | ||
|
||
export function* modalSaga() { | ||
yield takeEvery(LOCATION_CHANGE, handleLocationChange) | ||
yield takeEvery(IMPORT_WITHDRAWAL_SUCCESS, handleImportWithdrawalSuccess) | ||
} | ||
|
||
function* handleLocationChange() { | ||
const openModals: ModalState = yield select(getOpenModals) | ||
if (Object.keys(openModals).length > 0) { | ||
yield delay(100) | ||
yield put(closeAllModals()) | ||
} | ||
} | ||
|
||
function* handleImportWithdrawalSuccess() { | ||
yield put(closeModal('ImportWithdrawalModal')) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters