Skip to content

Commit

Permalink
switch network accent color (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-schrammel authored Aug 18, 2023
1 parent bb5b697 commit 716aa07
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { motion } from 'framer-motion';
import React, {
import {
ReactNode,
useCallback,
useEffect,
Expand All @@ -12,7 +12,6 @@ import { initializeMessenger } from '~/core/messengers';
import { shortcuts } from '~/core/references/shortcuts';
import { useCurrentAddressStore } from '~/core/state';
import { Box, Inline, Stack, Symbol, Text } from '~/design-system';
import { AccentColorProviderWrapper } from '~/design-system/components/Box/ColorContext';

import { useAppMetadata } from '../../hooks/useAppMetadata';
import { useAppSession } from '../../hooks/useAppSession';
Expand Down Expand Up @@ -74,7 +73,7 @@ export const AppConnectionMenu = ({
const { isCommandKVisible } = useCommandKStatus();
const { trackShortcut } = useKeyboardAnalytics();
const { currentAddress } = useCurrentAddressStore();
const { appHost, appLogo, appName, appColor } = useAppMetadata({ url });
const { appHost, appLogo, appName } = useAppMetadata({ url });
const navigate = useRainbowNavigate();

const {
Expand Down Expand Up @@ -241,25 +240,21 @@ export const AppConnectionMenu = ({
appSession ? changeChainId : connectToApp
}
>
<AccentColorProviderWrapper
color={appColor || undefined}
>
<SwitchNetworkMenuSelector
type="dropdown"
highlightAccentColor
selectedValue={`${appSession?.chainId}`}
onNetworkSelect={(e) => {
e?.preventDefault();
toggleSubMenu(false);
setMenuOpen(false);
}}
onShortcutPress={
appSession ? changeChainId : connectToApp
}
showDisconnect={!!appSession}
disconnect={disconnect}
/>
</AccentColorProviderWrapper>
<SwitchNetworkMenuSelector
type="dropdown"
highlightAccentColor
selectedValue={`${appSession?.chainId}`}
onNetworkSelect={(e) => {
e?.preventDefault();
toggleSubMenu(false);
setMenuOpen(false);
}}
onShortcutPress={
appSession ? changeChainId : connectToApp
}
showDisconnect={!!appSession}
disconnect={disconnect}
/>
</DropdownMenuRadioGroup>
</Stack>
</Box>
Expand Down
10 changes: 5 additions & 5 deletions src/entries/popup/hooks/useAppMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
isValidUrl,
} from '~/core/utils/connectedApps';

import { useDominantColor } from './useDominantColor';
// import { useDominantColor } from './useDominantColor';

interface AppMetadata {
url?: string;
Expand All @@ -20,15 +20,15 @@ export function useAppMetadata({ url, title }: AppMetadata) {
const appName = appHostName
? getHardcodedDappInformation(appHostName)?.name || title
: '';
const { data: appColor } = useDominantColor({
imageUrl: appLogo ?? undefined,
});
// const { data: appColor } = useDominantColor({
// imageUrl: appLogo ?? undefined,
// });

return {
appHost,
appHostName,
appName,
appLogo,
appColor,
// appColor,
};
}

0 comments on commit 716aa07

Please sign in to comment.