25 lines
1011 B
TypeScript
25 lines
1011 B
TypeScript
import { connect } from "react-redux"
|
|
import { getAddress, isConnecting } from "decentraland-dapps/dist/modules/wallet/selectors"
|
|
import { isLoggingIn } from "../../../modules/identity/selector"
|
|
import { getServer, getToken } from "../../../modules/conference/selector"
|
|
import { RootState } from "../../../modules/reducer"
|
|
import withRouter from "../../../utils/WithRouter"
|
|
import Conference from "./Conference"
|
|
import { MapDispatch, MapStateProps, OwnProps } from "./Conference.types"
|
|
|
|
const mapStateToProps = (state: RootState, ownProps: OwnProps): MapStateProps => {
|
|
const addressFromPath = ownProps.router.params.profileAddress
|
|
|
|
return {
|
|
profileAddress: addressFromPath?.toLowerCase(),
|
|
isLoading: isLoggingIn(state) || isConnecting(state),
|
|
loggedInAddress: getAddress(state)?.toLowerCase(),
|
|
server: getServer(state),
|
|
token: getToken(state),
|
|
}
|
|
}
|
|
|
|
const mapDispatch = (dispatch: MapDispatch): any => ({})
|
|
|
|
export default withRouter(connect(mapStateToProps, mapDispatch)(Conference))
|