diff --git a/ui/components/multichain/app-footer/app-footer.js b/ui/components/multichain/app-footer/app-footer.js index b4862ced74c9..fe536945d5de 100644 --- a/ui/components/multichain/app-footer/app-footer.js +++ b/ui/components/multichain/app-footer/app-footer.js @@ -1,11 +1,15 @@ import React from 'react'; import { useLocation } from 'react-router-dom'; -import { useDispatch } from 'react-redux'; +import { useDispatch, useSelector } from 'react-redux'; import { CONNECTED_ROUTE, DEFAULT_ROUTE, } from '../../../helpers/constants/routes'; import { + AvatarFavicon, + AvatarNetwork, + AvatarNetworkSize, + BadgeWrapper, Box, ButtonIcon, ButtonIconSize, @@ -19,14 +23,23 @@ import { AlignItems, BackgroundColor, BlockSize, + BorderColor, BorderRadius, Display, FlexDirection, IconColor, JustifyContent, + Size, TextColor, TextVariant, } from '../../../helpers/constants/design-system'; +import { + getConnectedSubjectsForAllAddresses, + getCurrentNetwork, + getOriginOfCurrentTab, + getSelectedAddress, + getTestNetworkBackgroundColor, +} from '../../../selectors'; import { showSelectActionModal } from './app-footer-actions'; export const AppFooter = () => { @@ -39,6 +52,20 @@ export const AppFooter = () => { const activeWallet = location.pathname === DEFAULT_ROUTE; const activeConnections = location.pathname === CONNECTED_ROUTE; + const selectedAddress = useSelector(getSelectedAddress); + + const currentTabOrigin = useSelector(getOriginOfCurrentTab); + const connectedSites = useSelector(getConnectedSubjectsForAllAddresses); + const connectedSite = connectedSites[selectedAddress]?.find( + ({ origin }) => origin === currentTabOrigin, + ); + const connectedAvatar = connectedSite?.iconUrl; + const connectedAvatarName = connectedSite?.name; + + const testNetworkBackgroundColor = useSelector(getTestNetworkBackgroundColor); + + const currentChain = useSelector(getCurrentNetwork); + return ( { alignItems={AlignItems.center} tabIndex={0} > - + {connectedSite ? ( + + + } + > + + + + ) : ( + + )} ; - DefaultStory.storyName = 'Default'; + +export const ConnectedStory = () => ; +ConnectedStory.storyName = 'Connected'; +ConnectedStory.decorators = [ + (Story) => ( + + + + ), +];