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.
feat: use skin hair and body shape from avatar (decentraland#487)
* feat: use skin hair and body shape from avatar * fix: user without avatar
- Loading branch information
Showing
6 changed files
with
74 additions
and
26 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { getData as getProfiles } from 'decentraland-dapps/dist/modules/profile/selectors' | ||
import { Avatar } from 'decentraland-ui' | ||
import { connect } from 'react-redux' | ||
import { RootState } from '../../modules/reducer' | ||
import { getWallet } from '../../modules/wallet/selectors' | ||
import { | ||
MapStateProps, | ||
MapDispatchProps, | ||
MapDispatch | ||
} from './AssetImage.types' | ||
import AssetImage from './AssetImage' | ||
|
||
const mapState = (state: RootState): MapStateProps => { | ||
const profiles = getProfiles(state) | ||
const wallet = getWallet(state) | ||
let avatar: Avatar | undefined = undefined | ||
if (wallet && !!profiles[wallet.address]) { | ||
const profile = profiles[wallet.address] | ||
avatar = profile.avatars[0] | ||
} | ||
return { | ||
avatar | ||
} | ||
} | ||
|
||
const mapDispatch = (_dispatch: MapDispatch): MapDispatchProps => ({}) | ||
|
||
export default connect(mapState, mapDispatch)(AssetImage) |
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,2 +1,2 @@ | ||
import AssetImage from './AssetImage' | ||
import AssetImage from './AssetImage.container' | ||
export { AssetImage } |