Skip to content
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

chore: add mock data #393

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import { useIntl } from 'react-intl';
import { Routes } from '../../route';
import { Button } from './Button';
import LocaleToggleButton from './LocaleToggleButton';

interface MenuItem {
route: string;
labelId: string;
}
import { MenuItem, MenuListItem } from './MenuListItem';

// 菜单项数组
const menuItems: MenuItem[] = [
Expand Down Expand Up @@ -53,22 +49,6 @@ const MenuButtons = ({
);
};

// 菜单列表项组件
const MenuListItem = ({ item, onPress }: { item: MenuItem; onPress: (route: string) => void }) => {
const intl = useIntl();

return (
<ListItem
title={intl.formatMessage({ id: item.labelId })}
onPress={() => onPress(item.route)}
fontWeight="bold"
textAlign="center"
size="$5"
color="black"
/>
);
};

const HeaderView = () => {
const media = useMedia();
const route = useRoute();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ListItem } from 'tamagui';

export interface MenuItem {
route: string;
labelId: string;
}

export const MenuListItem = ({
item,
onPress,
}: {
item: MenuItem;
onPress: (route: string) => void;
}) => (
<ListItem
title={item.labelId}
onPress={() => onPress(item.route)}
fontWeight="bold"
textAlign="center"
size="$5"
color="black"
/>
);
ByteZhang1024 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { useIntl } from 'react-intl';
import { ListItem } from 'tamagui';

export interface MenuItem {
route: string;
labelId: string;
}

export const MenuListItem = ({
item,
onPress,
}: {
item: MenuItem;
onPress: (route: string) => void;
}) => {
const intl = useIntl();

return (
<ListItem
title={intl.formatMessage({ id: item.labelId })}
// title={item.labelId}
ByteZhang1024 marked this conversation as resolved.
Show resolved Hide resolved
onPress={() => onPress(item.route)}
fontWeight="bold"
textAlign="center"
size="$5"
color="black"
/>
);
};
ByteZhang1024 marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 7 additions & 0 deletions packages/connect-examples/expo-example/src/data/bitcoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ const api: PlaygroundProps[] = [
coin: 'TEST',
},
},
{
title: 'Mock Babylon Staking(Seed3 专用)',
value: {
psbt: '70736274ff0100fd7f0102000000059b7e2b54e4d24e4c003f76c87e08efe7b05a12a1eeccee492a035322ec4e03cf0000000000fdffffffa078bbb428d8e2aa30c8c6e624f95a7d5eac2a989e6955a86c284e1cac1218b80000000000fdffffffbecc3c860dd99b902be9c1dfbc4f2c0e431668880a1216a619a9503f8cffabf20000000000fdffffff5f1787d5d4edce60e926b13ec8e3c2894d757bcb0145ace5539d5fbdcd58c9900200000000fdffffff85f5c8b72fbe754a6435ce117ef4ef66ffd36bc7f80185f5764044d3e9cac4bf0200000000fdffffff03888a0100000000002251206449c9fb89c3c2692205041fe231934a250ff43a8c1f319893e56f6a6bc89fdc0000000000000000496a476262643400f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b21c61411d36685bb4b293ab968ad430d591a1a88c3d191139cbc30a914b3423c70096751e000000000000225120c3f45119b701bc0384b45e064a4abbea7949c8c492e278f0f594a1fd83f148970a4a03000001012b9174000000000000225120c3f45119b701bc0384b45e064a4abbea7949c8c492e278f0f594a1fd83f148972116f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b21900fc885a5e5600008001000080000000800000000000000000011720f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b20001012bd968000000000000225120c3f45119b701bc0384b45e064a4abbea7949c8c492e278f0f594a1fd83f148972116f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b21900fc885a5e5600008001000080000000800000000000000000011720f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b20001012bd968000000000000225120c3f45119b701bc0384b45e064a4abbea7949c8c492e278f0f594a1fd83f148972116f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b21900fc885a5e5600008001000080000000800000000000000000011720f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b20001012bbe40000000000000225120c3f45119b701bc0384b45e064a4abbea7949c8c492e278f0f594a1fd83f148972116f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b21900fc885a5e5600008001000080000000800000000000000000011720f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b20001012bef23000000000000225120c3f45119b701bc0384b45e064a4abbea7949c8c492e278f0f594a1fd83f148972116f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b21900fc885a5e5600008001000080000000800000000000000000011720f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b2000000010520f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b22107f4b1f1ca7515d009aee696ec84ee76e901139c6ad80269ebe7e6b6e8f42ae7b21900fc885a5e560000800100008000000080000000000000000000',
coin: 'TEST',
ByteZhang1024 marked this conversation as resolved.
Show resolved Hide resolved
},
},
ByteZhang1024 marked this conversation as resolved.
Show resolved Hide resolved
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function ExecuteView() {
const res = await sdk[`${method}` as keyof typeof sdk](
connectId,
deviceId,
requestParams,
requestParams
);
return { payload: res, skipVerify: true };
} catch (error) {
Expand Down
Loading