forked from decentraland/marketplace
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: proceed loading (decentraland#306)
* fix: proceed loading * fix: loading states
- Loading branch information
Showing
19 changed files
with
168 additions
and
103 deletions.
There are no files selected for viewing
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
25 changes: 7 additions & 18 deletions
25
webapp/src/components/AuthorizationModal/AuthorizationModal.types.ts
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,31 +1,20 @@ | ||
import { Dispatch } from 'redux' | ||
import { Transaction } from 'decentraland-dapps/dist/modules/transaction/types' | ||
import { Authorization } from 'decentraland-dapps/dist/modules/authorization/types' | ||
import { | ||
grantTokenRequest, | ||
GrantTokenRequestAction, | ||
revokeTokenRequest, | ||
RevokeTokenRequestAction | ||
} from 'decentraland-dapps/dist/modules/authorization/actions' | ||
|
||
export type Props = { | ||
open: boolean | ||
authorization: Authorization | ||
authorizations: Authorization[] | ||
pendingTransactions: Transaction[] | ||
isLoading: boolean | ||
onGrant: typeof grantTokenRequest | ||
onRevoke: typeof revokeTokenRequest | ||
isAuthorizing: boolean | ||
isLoading?: boolean | ||
onCancel: () => void | ||
onProceed: () => void | ||
} | ||
|
||
export type MapStateProps = Pick< | ||
export type MapStateProps = Pick<Props, 'authorizations' | 'isAuthorizing'> | ||
export type MapDispatchProps = {} | ||
export type MapDispatch = Dispatch | ||
export type OwnProps = Pick< | ||
Props, | ||
'authorizations' | 'pendingTransactions' | 'isLoading' | ||
'open' | 'authorization' | 'onProceed' | 'isLoading' | ||
> | ||
export type MapDispatchProps = Pick<Props, 'onGrant' | 'onRevoke'> | ||
export type MapDispatch = Dispatch< | ||
GrantTokenRequestAction | RevokeTokenRequestAction | ||
> | ||
export type OwnProps = Pick<Props, 'open' | 'authorization' | 'onProceed'> |
11 changes: 9 additions & 2 deletions
11
webapp/src/components/CancelSalePage/CancelSalePage.container.ts
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
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
30 changes: 30 additions & 0 deletions
30
webapp/src/components/SettingsPage/Authorization/Authorization.container.ts
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { connect } from 'react-redux' | ||
import { | ||
getData as getAuthorizations, | ||
getLoading | ||
} from 'decentraland-dapps/dist/modules/authorization/selectors' | ||
import { | ||
grantTokenRequest, | ||
revokeTokenRequest | ||
} from 'decentraland-dapps/dist/modules/authorization/actions' | ||
import { RootState } from '../../../modules/reducer' | ||
import { getPendingAuthorizationTransactions } from '../../../modules/transaction/selectors' | ||
import { | ||
MapStateProps, | ||
MapDispatchProps, | ||
MapDispatch | ||
} from './Authorization.types' | ||
import Authorization from './Authorization' | ||
|
||
const mapState = (state: RootState): MapStateProps => ({ | ||
authorizations: getAuthorizations(state), | ||
pendingTransactions: getPendingAuthorizationTransactions(state), | ||
loading: getLoading(state) | ||
}) | ||
|
||
const mapDispatch = (dispatch: MapDispatch): MapDispatchProps => ({ | ||
onGrant: authorization => dispatch(grantTokenRequest(authorization)), | ||
onRevoke: authorization => dispatch(revokeTokenRequest(authorization)) | ||
}) | ||
|
||
export default connect(mapState, mapDispatch)(Authorization) |
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
17 changes: 15 additions & 2 deletions
17
webapp/src/components/SettingsPage/Authorization/Authorization.types.ts
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,15 +1,28 @@ | ||
import { | ||
grantTokenRequest, | ||
revokeTokenRequest | ||
GrantTokenRequestAction, | ||
revokeTokenRequest, | ||
RevokeTokenRequestAction | ||
} from 'decentraland-dapps/dist/modules/authorization/actions' | ||
import { Authorization } from 'decentraland-dapps/dist/modules/authorization/types' | ||
import { LoadingState } from 'decentraland-dapps/dist/modules/loading/reducer' | ||
import { Transaction } from 'decentraland-dapps/dist/modules/transaction/types' | ||
import { Dispatch } from 'redux' | ||
|
||
export type Props = { | ||
authorization: Authorization | ||
authorizations: Authorization[] | ||
pendingTransactions: Transaction[] | ||
isLoading?: boolean | ||
loading: LoadingState | ||
onGrant: typeof grantTokenRequest | ||
onRevoke: typeof revokeTokenRequest | ||
} | ||
|
||
export type MapStateProps = Pick< | ||
Props, | ||
'authorizations' | 'pendingTransactions' | 'loading' | ||
> | ||
export type MapDispatchProps = Pick<Props, 'onGrant' | 'onRevoke'> | ||
export type MapDispatch = Dispatch< | ||
GrantTokenRequestAction | RevokeTokenRequestAction | ||
> |
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,2 +1,2 @@ | ||
import Authorization from './Authorization' | ||
import Authorization from './Authorization.container' | ||
export { Authorization } |
Oops, something went wrong.