Skip to content

Commit

Permalink
Finish removing usages of useSwapWidgetUIStore.getState().colors.primary
Browse files Browse the repository at this point in the history
  • Loading branch information
toddkao committed Jul 17, 2024
1 parent 6c5c1b0 commit ad00d4a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/widget/src/hooks/use-swap-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { Chain, useChains } from './use-chains';
import { useBalancesByChain } from './use-balances-by-chain';
import { useRoute } from './use-route';
import { getChainFeeAssets, getChainGasPrice } from '../utils/chain';
import { useSkipClient, useSkipConfig } from './use-skip-client';
import { useSkipClient } from './use-skip-client';
import { getAmountWei, parseAmountWei } from '../utils/number';
import { gracefullyConnect } from '../utils/wallet';
import { useSwapWidgetUIStore } from '../store/swap-widget';
Expand Down
26 changes: 13 additions & 13 deletions packages/widget/src/ui/PreviewRoute/ChainStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ import {
} from '../../utils/ledger-warning';
import { cn } from '../../utils/ui';
import { ExpandArrow } from '../Icon/ExpandArrow';
import { useSwapWidgetUIStore } from '../../store/swap-widget';
import { useAssets } from '../../provider/assets';
import { StyledPrimaryDiv } from '../StyledComponents/Theme';
import { lightOrDark, nameToRgba } from '../../utils/color';
import { useTheme } from 'styled-components';
import { useTheme, styled } from 'styled-components';
import { StyledPrimaryButton } from '../StyledComponents/Buttons';

export const ChainStep = ({
Expand Down Expand Up @@ -407,19 +406,16 @@ export const ChainStep = ({
</SimpleTooltip>
)}
{stepState?.explorerLink && (
<AdaptiveLink
<StyledAdaptiveLink
className={cn(
'flex flex-row items-center text-sm font-semibold underline'
)}
style={{
color: useSwapWidgetUIStore.getState().colors.primary,
}}
href={stepState.explorerLink.link}
data-testid={`explorer-link`}
>
{stepState.explorerLink.shorthand}
<FaExternalLinkAlt className="ml-1 h-3 w-3" />
</AdaptiveLink>
</StyledAdaptiveLink>
)}
</div>
<div
Expand Down Expand Up @@ -489,16 +485,12 @@ export const ChainStep = ({
!mutationStatus.isPending &&
!isSuccess && (
<button onClick={() => setIsAddressDialogOpen(index)}>
<PencilSquareIcon
<StyledPencilSquareIcon
className={cn(
'h-4 w-4',
isNotFocused && 'text-neutral-400'
)}
style={{
color: !isNotFocused
? useSwapWidgetUIStore.getState().colors.primary
: undefined,
}}
isFocused={!isNotFocused}
/>
</button>
)}
Expand Down Expand Up @@ -585,3 +577,11 @@ const AssetSwap = (props: {
</div>
);
};

const StyledAdaptiveLink = styled(AdaptiveLink)`
color: ${(props) => props.theme.primary.brandColor};
`;

const StyledPencilSquareIcon = styled(PencilSquareIcon)<{ isFocused: boolean }>`
${(props) => props.isFocused && props.theme.primary.brandColor};
`;

0 comments on commit ad00d4a

Please sign in to comment.