Skip to content

Commit

Permalink
refactor(token-bottom-sheet): remove unused generic (#5484)
Browse files Browse the repository at this point in the history
### 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)
  • Loading branch information
satish-ravi authored May 28, 2024
1 parent 1bb2371 commit a02e912
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/TokenBottomSheet.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('TokenBottomSheet', () => {
jest.clearAllMocks()
})

function renderBottomSheet(props: Partial<TokenBottomSheetProps<TokenBalance>> = {}) {
function renderBottomSheet(props: Partial<TokenBottomSheetProps> = {}) {
return render(
<Provider store={mockStore}>
<TokenBottomSheet
Expand Down
12 changes: 6 additions & 6 deletions src/components/TokenBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ export enum TokenPickerOrigin {

export const DEBOUNCE_WAIT_TIME = 200

export interface TokenBottomSheetProps<T extends TokenBalance> {
export interface TokenBottomSheetProps {
forwardedRef: RefObject<BottomSheetRefType>
origin: TokenPickerOrigin
onTokenSelected: (token: T, tokenPositionInList: number) => void
onTokenSelected: (token: TokenBalance, tokenPositionInList: number) => void
title: string
titleStyle?: TextStyle
searchEnabled?: boolean
snapPoints?: (string | number)[]
tokens: T[]
tokens: TokenBalance[]
TokenOptionComponent?: React.ComponentType<TokenOptionProps>
showPriceUsdUnavailableWarning?: boolean
filterChips?: FilterChip<TokenBalance>[]
Expand Down Expand Up @@ -87,7 +87,7 @@ function NoResults({
)
}

function TokenBottomSheet<T extends TokenBalance>({
function TokenBottomSheet({
forwardedRef,
snapPoints,
origin,
Expand All @@ -99,7 +99,7 @@ function TokenBottomSheet<T extends TokenBalance>({
showPriceUsdUnavailableWarning,
filterChips = [],
areSwapTokensShuffled,
}: TokenBottomSheetProps<T>) {
}: TokenBottomSheetProps) {
const insets = useSafeAreaInsets()

const filterChipsCarouselRef = useRef<ScrollView>(null)
Expand Down Expand Up @@ -157,7 +157,7 @@ function TokenBottomSheet<T extends TokenBalance>({
}
}

const onTokenPressed = (token: T, index: number) => () => {
const onTokenPressed = (token: TokenBalance, index: number) => () => {
ValoraAnalytics.track(TokenBottomSheetEvents.token_selected, {
origin,
tokenAddress: token.address,
Expand Down

0 comments on commit a02e912

Please sign in to comment.