-
Notifications
You must be signed in to change notification settings - Fork 2
♻️ refactor lifi usage #681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: optimize
Are you sure you want to change the base?
Changes from all commits
7aa68a1
43e2760
249085d
48cfb4b
1cb4727
c7b38a9
f43b583
9c537a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,15 +31,14 @@ import shortenHex from "@exactly/common/shortenHex"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { WAD } from "@exactly/lib"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import AssetSelectSheet from "./AssetSelectSheet"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import TokenLogo from "./TokenLogo"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import OptimismImage from "../../assets/images/optimism.svg"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { getBridgeSources, getRouteFrom, tokenCorrelation, type BridgeSources, type RouteFrom } from "../../utils/lifi"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import openBrowser from "../../utils/openBrowser"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import queryClient from "../../utils/queryClient"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import reportError from "../../utils/reportError"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import useAccount from "../../utils/useAccount"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import ownerConfig, { addChains } from "../../utils/wagmi/owner"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import AssetLogo from "../shared/AssetLogo"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import ChainLogo from "../shared/ChainLogo"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import GradientScrollView from "../shared/GradientScrollView"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import SafeView from "../shared/SafeView"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import Skeleton from "../shared/Skeleton"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -537,7 +536,7 @@ export default function Bridge() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Text> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </YStack> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <XStack gap="$s3" alignItems="center"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <TokenLogo token={bridgePreview.sourceToken} size={32} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <AssetLogo symbol={bridgePreview.sourceToken.symbol} width={32} height={32} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Text title primary color="$uiNeutralPrimary"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {`${Number( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| formatUnits(bridgePreview.sourceAmount, bridgePreview.sourceToken.decimals), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -660,7 +659,6 @@ export default function Bridge() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| onUseMax={(maxAmount) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setSourceAmount(maxAmount); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chainLogoUri={selectedGroup?.chain.id === 10 ? undefined : selectedGroup?.chain.logoURI} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {insufficientBalance && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -699,23 +697,17 @@ export default function Bridge() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <XStack gap="$s3_5" alignItems="center" justifyContent="space-between" flex={1}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <XStack gap="$s3_5" alignItems="center" flex={1}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <View width={40} height={40} position="relative"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| {destinationToken.logoURI ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <AssetLogo source={{ uri: destinationToken.logoURI }} width={40} height={40} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <TokenLogo token={destinationToken} size={40} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <AssetLogo symbol={destinationToken.symbol} width={40} height={40} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <View | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| position="absolute" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bottom={0} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| right={0} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| width={20} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| height={20} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| borderWidth={1} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| borderColor="white" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| borderRadius={10} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| borderRadius="$r_0" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| overflow="hidden" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <OptimismImage width="100%" height="100%" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <ChainLogo size={20} /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </View> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+700
to
711
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# First, locate the tamagui config file
find . -name "tamagui.config.*" -type f 2>/dev/null | head -20Repository: exactly/exa Length of output: 74 🏁 Script executed: #!/bin/bash
# Get basic info about the Bridge.tsx file to understand context
wc -l src/components/add-funds/Bridge.tsx
head -30 src/components/add-funds/Bridge.tsxRepository: exactly/exa Length of output: 1174 🏁 Script executed: #!/bin/bash
# Examine the tamagui config to see color tokens
cat tamagui.config.ts | head -200Repository: exactly/exa Length of output: 6719 🏁 Script executed: #!/bin/bash
# Look at the specific lines in Bridge.tsx to understand context
sed -n '690,720p' src/components/add-funds/Bridge.tsxRepository: exactly/exa Length of output: 1731 🏁 Script executed: #!/bin/bash
# Check if there are more color tokens defined, particularly looking for background or neutral tokens
grep -n "background\|neutral\|border" tamagui.config.ts | head -50Repository: exactly/exa Length of output: 2863 🏁 Script executed: #!/bin/bash
# Get the complete color tokens section to see if there's a white or neutral color
sed -n '/color: {/,/},/p' tamagui.config.ts | tail -100Repository: exactly/exa Length of output: 3341 🏁 Script executed: #!/bin/bash
# Also check if there's any design token documentation or if $background is actually defined
grep -n "\$background\|background:" tamagui.config.tsRepository: exactly/exa Length of output: 106 🏁 Script executed: #!/bin/bash
# Check the exact hex value for grayscaleLight1 to confirm it's white-ish
grep -n "grayscaleLight1:" tamagui.config.tsRepository: exactly/exa Length of output: 90 🏁 Script executed: #!/bin/bash
# Let's see the full tamagui config around line 262-268 to understand the theme tokens better
sed -n '260,275p' tamagui.config.tsRepository: exactly/exa Length of output: 927 🏁 Script executed: #!/bin/bash
# Verify all available color tokens in the light theme
sed -n '260,275p' tamagui.config.tsRepository: exactly/exa Length of output: 927 🏁 Script executed: #!/bin/bash
# Check for any other white-like or neutral border tokens
grep -n "uiNeutral\|borderNeutral" tamagui.config.ts | head -20Repository: exactly/exa Length of output: 1276 🏁 Script executed: #!/bin/bash
# Search for other uses of borderColor in Bridge.tsx to see pattern
grep -n "borderColor" src/components/add-funds/Bridge.tsxRepository: exactly/exa Length of output: 374 🏁 Script executed: #!/bin/bash
# Search for other badge/overlay patterns with borders in the codebase
rg "borderColor.*white|borderColor.*\$ui|borderColor.*\$background" --type=tsx -C2 | head -50Repository: exactly/exa Length of output: 82 🏁 Script executed: #!/bin/bash
# Get more context about the light/dark theme tokens and what's available
sed -n '260,380p' tamagui.config.ts | grep -E "border|inverse"Repository: exactly/exa Length of output: 853 Hardcoded color violates design token guidelines; proposed fix is incorrect. Line 706 uses Proposed fix <View
position="absolute"
bottom={0}
right={0}
borderWidth={1}
- borderColor="white"
+ borderColor="$borderNeutralSoft"
borderRadius="$r_0"
overflow="hidden"
>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </View> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <YStack flex={1}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace hardcoded negative spacing with a token-derived value.
marginRight={... ? -12 : 0}violates the token-only spacing rule. Use a Tamagui space token value instead.🛠️ Suggested fix using Tamagui tokens
As per coding guidelines, use design tokens for spacing values.
🤖 Prompt for AI Agents