Skip to content

Commit a02e912

Browse files
authored
refactor(token-bottom-sheet): remove unused generic (#5484)
### Description This was added in #4242 when we were working towards multichain, but now there shouldn't be a need for multiple TokenBalance types ### Test plan CI ### Related issues N/A ### Backwards compatibility Yes ### Network scalability If a new NetworkId and/or Network are added in the future, the changes in this PR will: - [x] Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)
1 parent 1bb2371 commit a02e912

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/components/TokenBottomSheet.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ describe('TokenBottomSheet', () => {
114114
jest.clearAllMocks()
115115
})
116116

117-
function renderBottomSheet(props: Partial<TokenBottomSheetProps<TokenBalance>> = {}) {
117+
function renderBottomSheet(props: Partial<TokenBottomSheetProps> = {}) {
118118
return render(
119119
<Provider store={mockStore}>
120120
<TokenBottomSheet

src/components/TokenBottomSheet.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ export enum TokenPickerOrigin {
3434

3535
export const DEBOUNCE_WAIT_TIME = 200
3636

37-
export interface TokenBottomSheetProps<T extends TokenBalance> {
37+
export interface TokenBottomSheetProps {
3838
forwardedRef: RefObject<BottomSheetRefType>
3939
origin: TokenPickerOrigin
40-
onTokenSelected: (token: T, tokenPositionInList: number) => void
40+
onTokenSelected: (token: TokenBalance, tokenPositionInList: number) => void
4141
title: string
4242
titleStyle?: TextStyle
4343
searchEnabled?: boolean
4444
snapPoints?: (string | number)[]
45-
tokens: T[]
45+
tokens: TokenBalance[]
4646
TokenOptionComponent?: React.ComponentType<TokenOptionProps>
4747
showPriceUsdUnavailableWarning?: boolean
4848
filterChips?: FilterChip<TokenBalance>[]
@@ -87,7 +87,7 @@ function NoResults({
8787
)
8888
}
8989

90-
function TokenBottomSheet<T extends TokenBalance>({
90+
function TokenBottomSheet({
9191
forwardedRef,
9292
snapPoints,
9393
origin,
@@ -99,7 +99,7 @@ function TokenBottomSheet<T extends TokenBalance>({
9999
showPriceUsdUnavailableWarning,
100100
filterChips = [],
101101
areSwapTokensShuffled,
102-
}: TokenBottomSheetProps<T>) {
102+
}: TokenBottomSheetProps) {
103103
const insets = useSafeAreaInsets()
104104

105105
const filterChipsCarouselRef = useRef<ScrollView>(null)
@@ -157,7 +157,7 @@ function TokenBottomSheet<T extends TokenBalance>({
157157
}
158158
}
159159

160-
const onTokenPressed = (token: T, index: number) => () => {
160+
const onTokenPressed = (token: TokenBalance, index: number) => () => {
161161
ValoraAnalytics.track(TokenBottomSheetEvents.token_selected, {
162162
origin,
163163
tokenAddress: token.address,

0 commit comments

Comments
 (0)