Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarkhanzadian committed Dec 27, 2024
1 parent 320ca9c commit 2a15abf
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import { NativeScrollEvent, NativeSyntheticEvent } from 'react-native';

import { useSheetNavigatorContext } from '@/common/sheet-navigator/sheet-navigator-provider';
import { ActionBar, ActionBarMethods } from '@/components/action-bar/action-bar';
import { AppRoutes } from '@/routes';
import { TestId } from '@/shared/test-id';
import { useWallets } from '@/store/wallets/wallets.read';
import { isFeatureEnabled } from '@/utils/feature-flag';
import { t } from '@lingui/macro';
import { useRouter } from 'expo-router';

import {
ArrowsRepeatLeftRightIcon,
Expand Down Expand Up @@ -152,7 +150,6 @@ function ActionBarButton({ onPress, icon, label, testID }: ActionBarButtonProps)

export const ActionBarContainer = forwardRef<ActionBarMethods>((_, ref) => {
const { sendSheetRef, receiveSheetRef } = useSheetNavigatorContext();
const router = useRouter();
const wallets = useWallets();
const addWalletSheetRef = useRef<SheetRef>(null);

Expand Down Expand Up @@ -197,7 +194,10 @@ export const ActionBarContainer = forwardRef<ActionBarMethods>((_, ref) => {
right={
isFeatureEnabled() && (
<ActionBarButton
onPress={() => router.navigate(AppRoutes.Swap)}
onPress={() => {
// TODO: do nothing for now
//router.navigate(AppRoutes.Swap)
}}
icon={<ArrowsRepeatLeftRightIcon />}
label={t({
id: 'action_bar.swap_label',
Expand Down
3 changes: 2 additions & 1 deletion apps/mobile/src/features/approver/components/memo-card.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { t } from '@lingui/macro';

import { Avatar, Box, Cell, ChevronRightIcon, NoteTextIcon, Text } from '@leather.io/ui/native';
import { Avatar, Box, Cell, ChevronRightIcon, NoteTextIcon } from '@leather.io/ui/native';

interface MemoCardProps {
memo: string;
onPress(): void;
}

export function MemoCard({ memo, onPress }: MemoCardProps) {
return (
<Box mx="-5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface NonceCardProps {
nonce: string;
onPress(): void;
}

export function NonceCard({ nonce, onPress }: NonceCardProps) {
return (
<Box mx="-5">
Expand Down
18 changes: 14 additions & 4 deletions apps/mobile/src/features/psbt-signer/psbt-signer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,24 @@ export function BasePsbtSigner({
}, 1000);
},
onError() {
displayToast({ title: 'Failed to broadcast transaction', type: 'error' });
displayToast({
title: t({
id: 'approver.send.btc.error.broadcast',
message: 'Failed to broadcast transaction',
}),
type: 'error',
});
setApproverState('start');
},
});
} catch {
/* eslint-disable-next-line no-console */
console.log(e);
displayToast({ title: 'Failed to broadcast transaction', type: 'error' });
displayToast({
title: t({
id: 'approver.send.btc.error.broadcast',
message: 'Failed to broadcast transaction',
}),
type: 'error',
});
setApproverState('start');
}
}
Expand Down
40 changes: 30 additions & 10 deletions apps/mobile/src/features/stacks-tx-signer/stacks-tx-signer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,14 @@ export function StacksTxSigner({
setTxHex(newTxHex);
setSelectedFeeType(feeType);
}
} catch (e) {
displayToast({ title: 'Failed to change fee', type: 'error' });
console.log(e);
} catch {
displayToast({
title: t({
id: 'approver.send.stx.error.change-fee',
message: 'Failed to change fee',
}),
type: 'error',
});
}
}

Expand All @@ -155,7 +160,13 @@ export function StacksTxSigner({
setTxHex(newTxHex);
}
} catch {
displayToast({ title: 'Failed to change nonce', type: 'error' });
displayToast({
title: t({
id: 'approver.send.stx.error.change-nonce',
message: 'Failed to change nonce',
}),
type: 'error',
});
}
}
async function onChangeMemo(memo: string) {
Expand All @@ -171,9 +182,14 @@ export function StacksTxSigner({
const newTxHex = bytesToHex(newTx.serialize());
setTxHex(newTxHex);
}
} catch (e) {
displayToast({ title: 'Failed to change memo', type: 'error' });
console.log(e);
} catch {
displayToast({
title: t({
id: 'approver.send.stx.error.change-memo',
message: 'Failed to change memo',
}),
type: 'error',
});
}
}
if (!account) {
Expand Down Expand Up @@ -202,9 +218,13 @@ export function StacksTxSigner({
}
);
} catch (e) {
/* eslint-disable-next-line no-console */
console.log(e);
displayToast({ title: 'Failed to broadcast transaction', type: 'error' });
displayToast({
title: t({
id: 'approver.send.stx.error.broadcast',
message: 'Failed to broadcast transaction',
}),
type: 'error',
});
setApproverState('start');
}
}
Expand Down

0 comments on commit 2a15abf

Please sign in to comment.