-
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: changed background for smaller screen sizes * fix: changed table size * feat: added nee user menu
1 parent
cf349d5
commit f0dd9a5
Showing
10 changed files
with
591 additions
and
4,212 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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
48 changes: 48 additions & 0 deletions
48
src/components/UserInformation/UserInformation.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,48 @@ | ||
import { connect } from 'react-redux' | ||
import { Network } from '@dcl/schemas/dist/dapps/network' | ||
import { getData as getProfiles } from 'decentraland-dapps/dist/modules/profile/selectors' | ||
import { isEnabled } from 'decentraland-dapps/dist/modules/translation/selectors' | ||
import { disconnectWallet } from 'decentraland-dapps/dist/modules/wallet/actions' | ||
import { getAddress, getNetworks, isConnected, isConnecting } from 'decentraland-dapps/dist/modules/wallet/selectors' | ||
import { UserInformationContainer } from 'decentraland-ui/dist/components/UserInformationContainer/UserInformationContainer' | ||
import { RootState } from '../../modules/reducer' | ||
import { MapStateProps, MapDispatch, MapDispatchProps, Props } from './UserInformation.types' | ||
|
||
const mapState = (state: RootState): MapStateProps => { | ||
const isSignedIn = isConnected(state) | ||
const address = getAddress(state) | ||
const profile = address ? getProfiles(state)[address] : undefined | ||
const networks = getNetworks(state) | ||
|
||
const manaBalances: Props['manaBalances'] = {} | ||
if (isSignedIn) { | ||
const networkList = Object.values(Network) as Network[] | ||
for (const network of networkList) { | ||
const networkData = networks?.[network] | ||
if (networkData) { | ||
manaBalances[network] = networks?.[network].mana | ||
} | ||
} | ||
} | ||
|
||
return { | ||
address, | ||
manaBalances, | ||
avatar: profile ? profile.avatars[0] : undefined, | ||
isSignedIn, | ||
isSigningIn: isConnecting(state), | ||
hasActivity: false, | ||
hasTranslations: isEnabled(state) | ||
} | ||
} | ||
|
||
const mapDispatch = (dispatch: MapDispatch): MapDispatchProps => ({ | ||
onSignOut: () => dispatch(disconnectWallet()) | ||
}) | ||
|
||
const mergeProps = (mapStateProps: MapStateProps, mapDispatchProps: MapDispatchProps) => ({ | ||
...mapStateProps, | ||
...mapDispatchProps | ||
}) | ||
|
||
export default connect(mapState, mapDispatch, mergeProps)(UserInformationContainer) |
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,12 @@ | ||
import { Dispatch } from '@reduxjs/toolkit' | ||
import { ConnectWalletRequestAction, DisconnectWalletAction } from 'decentraland-dapps/dist/modules/wallet/actions' | ||
import { UserInformationComponentProps } from 'decentraland-ui/dist/components/UserInformationContainer/UserInformationContainer' | ||
|
||
export type Props = UserInformationComponentProps & { hasTranslations: boolean } | ||
|
||
export type MapStateProps = Pick< | ||
Props, | ||
'isSignedIn' | 'isSigningIn' | 'address' | 'avatar' | 'manaBalances' | 'hasActivity' | 'hasTranslations' | ||
> | ||
export type MapDispatchProps = Pick<Props, 'onSignOut'> | ||
export type MapDispatch = Dispatch<ConnectWalletRequestAction | DisconnectWalletAction> |
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,3 @@ | ||
import UserInformation from './UserInformation.container' | ||
|
||
export default UserInformation |
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