@reown/appkit-ui-react-native 0.0.0-feat-smart-account-20241016183051 → 0.0.0-feat-swaps-20241129153709
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/assets/svg/RecycleHorizontal.js +21 -0
- package/lib/commonjs/assets/svg/RecycleHorizontal.js.map +1 -0
- package/lib/commonjs/assets/visual/Profile.js +2 -2
- package/lib/commonjs/assets/visual/Profile.js.map +1 -1
- package/lib/commonjs/components/wui-card/index.js +1 -1
- package/lib/commonjs/components/wui-card/styles.js +1 -1
- package/lib/commonjs/components/wui-card/styles.js.map +1 -1
- package/lib/commonjs/components/wui-icon/index.js +2 -0
- package/lib/commonjs/components/wui-icon/index.js.map +1 -1
- package/lib/commonjs/components/wui-lean-text/index.js +15 -0
- package/lib/commonjs/components/wui-lean-text/index.js.map +1 -0
- package/lib/commonjs/components/wui-lean-text/index.web.js +13 -0
- package/lib/commonjs/components/wui-lean-text/index.web.js.map +1 -0
- package/lib/commonjs/components/wui-lean-view/index.js +15 -0
- package/lib/commonjs/components/wui-lean-view/index.js.map +1 -0
- package/lib/commonjs/components/wui-lean-view/index.web.js +13 -0
- package/lib/commonjs/components/wui-lean-view/index.web.js.map +1 -0
- package/lib/commonjs/components/wui-pressable/index.js +68 -0
- package/lib/commonjs/components/wui-pressable/index.js.map +1 -0
- package/lib/commonjs/components/wui-shimmer/index.js +5 -1
- package/lib/commonjs/components/wui-shimmer/index.js.map +1 -1
- package/lib/commonjs/components/wui-text/index.js +2 -2
- package/lib/commonjs/components/wui-text/index.js.map +1 -1
- package/lib/commonjs/composites/wui-account-button/styles.js +2 -2
- package/lib/commonjs/composites/wui-account-button/styles.js.map +1 -1
- package/lib/commonjs/composites/wui-account-pill/index.js +5 -11
- package/lib/commonjs/composites/wui-account-pill/index.js.map +1 -1
- package/lib/commonjs/composites/wui-account-pill/styles.js +5 -1
- package/lib/commonjs/composites/wui-account-pill/styles.js.map +1 -1
- package/lib/commonjs/composites/wui-button/index.js +2 -1
- package/lib/commonjs/composites/wui-button/index.js.map +1 -1
- package/lib/commonjs/composites/wui-button/styles.js +3 -4
- package/lib/commonjs/composites/wui-button/styles.js.map +1 -1
- package/lib/commonjs/composites/wui-chip/styles.js +2 -2
- package/lib/commonjs/composites/wui-chip/styles.js.map +1 -1
- package/lib/commonjs/composites/wui-connect-button/styles.js +1 -1
- package/lib/commonjs/composites/wui-connect-button/styles.js.map +1 -1
- package/lib/commonjs/composites/wui-icon-box/index.js +17 -1
- package/lib/commonjs/composites/wui-icon-box/index.js.map +1 -1
- package/lib/commonjs/composites/wui-input-text/styles.js +1 -1
- package/lib/commonjs/composites/wui-input-text/styles.js.map +1 -1
- package/lib/commonjs/composites/wui-list-item-loader/index.js +34 -0
- package/lib/commonjs/composites/wui-list-item-loader/index.js.map +1 -0
- package/lib/commonjs/composites/wui-list-item-loader/styles.js +18 -0
- package/lib/commonjs/composites/wui-list-item-loader/styles.js.map +1 -0
- package/lib/commonjs/composites/wui-list-token/index.js +29 -9
- package/lib/commonjs/composites/wui-list-token/index.js.map +1 -1
- package/lib/commonjs/composites/wui-list-token/styles.js +3 -0
- package/lib/commonjs/composites/wui-list-token/styles.js.map +1 -1
- package/lib/commonjs/composites/wui-list-wallet/index.js +4 -3
- package/lib/commonjs/composites/wui-list-wallet/index.js.map +1 -1
- package/lib/commonjs/composites/wui-network-button/styles.js +1 -1
- package/lib/commonjs/composites/wui-network-button/styles.js.map +1 -1
- package/lib/commonjs/composites/wui-qr-code/index.js +5 -2
- package/lib/commonjs/composites/wui-qr-code/index.js.map +1 -1
- package/lib/commonjs/composites/wui-snackbar/index.js +4 -1
- package/lib/commonjs/composites/wui-snackbar/index.js.map +1 -1
- package/lib/commonjs/composites/wui-snackbar/styles.js +1 -1
- package/lib/commonjs/composites/wui-snackbar/styles.js.map +1 -1
- package/lib/commonjs/composites/wui-tabs/styles.js +1 -1
- package/lib/commonjs/composites/wui-tabs/styles.js.map +1 -1
- package/lib/commonjs/composites/wui-toggle/index.js +65 -0
- package/lib/commonjs/composites/wui-toggle/index.js.map +1 -0
- package/lib/commonjs/composites/wui-toggle/styles.js +30 -0
- package/lib/commonjs/composites/wui-toggle/styles.js.map +1 -0
- package/lib/commonjs/composites/wui-token-button/index.js +21 -11
- package/lib/commonjs/composites/wui-token-button/index.js.map +1 -1
- package/lib/commonjs/composites/wui-token-button/styles.js +4 -0
- package/lib/commonjs/composites/wui-token-button/styles.js.map +1 -1
- package/lib/commonjs/composites/wui-wallet-image/styles.js +1 -1
- package/lib/commonjs/composites/wui-wallet-image/styles.js.map +1 -1
- package/lib/commonjs/index.js +27 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/layout/wui-flex/index.js +3 -2
- package/lib/commonjs/layout/wui-flex/index.js.map +1 -1
- package/lib/commonjs/layout/wui-separator/index.js +4 -4
- package/lib/commonjs/layout/wui-separator/index.js.map +1 -1
- package/lib/commonjs/utils/ThemeUtil.js +2 -1
- package/lib/commonjs/utils/ThemeUtil.js.map +1 -1
- package/lib/module/assets/svg/RecycleHorizontal.js +13 -0
- package/lib/module/assets/svg/RecycleHorizontal.js.map +1 -0
- package/lib/module/assets/visual/Profile.js +2 -2
- package/lib/module/assets/visual/Profile.js.map +1 -1
- package/lib/module/components/wui-card/index.js +1 -1
- package/lib/module/components/wui-card/styles.js +1 -1
- package/lib/module/components/wui-card/styles.js.map +1 -1
- package/lib/module/components/wui-icon/index.js +2 -0
- package/lib/module/components/wui-icon/index.js.map +1 -1
- package/lib/module/components/wui-lean-text/index.js +10 -0
- package/lib/module/components/wui-lean-text/index.js.map +1 -0
- package/lib/module/components/wui-lean-text/index.web.js +3 -0
- package/lib/module/components/wui-lean-text/index.web.js.map +1 -0
- package/lib/module/components/wui-lean-view/index.js +10 -0
- package/lib/module/components/wui-lean-view/index.js.map +1 -0
- package/lib/module/components/wui-lean-view/index.web.js +3 -0
- package/lib/module/components/wui-lean-view/index.web.js.map +1 -0
- package/lib/module/components/wui-pressable/index.js +62 -0
- package/lib/module/components/wui-pressable/index.js.map +1 -0
- package/lib/module/components/wui-shimmer/index.js +6 -2
- package/lib/module/components/wui-shimmer/index.js.map +1 -1
- package/lib/module/components/wui-text/index.js +2 -2
- package/lib/module/components/wui-text/index.js.map +1 -1
- package/lib/module/composites/wui-account-button/styles.js +2 -2
- package/lib/module/composites/wui-account-button/styles.js.map +1 -1
- package/lib/module/composites/wui-account-pill/index.js +5 -11
- package/lib/module/composites/wui-account-pill/index.js.map +1 -1
- package/lib/module/composites/wui-account-pill/styles.js +5 -1
- package/lib/module/composites/wui-account-pill/styles.js.map +1 -1
- package/lib/module/composites/wui-button/index.js +2 -1
- package/lib/module/composites/wui-button/index.js.map +1 -1
- package/lib/module/composites/wui-button/styles.js +3 -4
- package/lib/module/composites/wui-button/styles.js.map +1 -1
- package/lib/module/composites/wui-chip/styles.js +2 -2
- package/lib/module/composites/wui-chip/styles.js.map +1 -1
- package/lib/module/composites/wui-connect-button/styles.js +1 -1
- package/lib/module/composites/wui-connect-button/styles.js.map +1 -1
- package/lib/module/composites/wui-icon-box/index.js +17 -1
- package/lib/module/composites/wui-icon-box/index.js.map +1 -1
- package/lib/module/composites/wui-input-text/styles.js +1 -1
- package/lib/module/composites/wui-input-text/styles.js.map +1 -1
- package/lib/module/composites/wui-list-item-loader/index.js +27 -0
- package/lib/module/composites/wui-list-item-loader/index.js.map +1 -0
- package/lib/module/composites/wui-list-item-loader/styles.js +12 -0
- package/lib/module/composites/wui-list-item-loader/styles.js.map +1 -0
- package/lib/module/composites/wui-list-token/index.js +27 -8
- package/lib/module/composites/wui-list-token/index.js.map +1 -1
- package/lib/module/composites/wui-list-token/styles.js +3 -0
- package/lib/module/composites/wui-list-token/styles.js.map +1 -1
- package/lib/module/composites/wui-list-wallet/index.js +5 -4
- package/lib/module/composites/wui-list-wallet/index.js.map +1 -1
- package/lib/module/composites/wui-network-button/styles.js +1 -1
- package/lib/module/composites/wui-network-button/styles.js.map +1 -1
- package/lib/module/composites/wui-qr-code/index.js +5 -2
- package/lib/module/composites/wui-qr-code/index.js.map +1 -1
- package/lib/module/composites/wui-snackbar/index.js +4 -1
- package/lib/module/composites/wui-snackbar/index.js.map +1 -1
- package/lib/module/composites/wui-snackbar/styles.js +1 -1
- package/lib/module/composites/wui-snackbar/styles.js.map +1 -1
- package/lib/module/composites/wui-tabs/styles.js +1 -1
- package/lib/module/composites/wui-tabs/styles.js.map +1 -1
- package/lib/module/composites/wui-toggle/index.js +58 -0
- package/lib/module/composites/wui-toggle/index.js.map +1 -0
- package/lib/module/composites/wui-toggle/styles.js +24 -0
- package/lib/module/composites/wui-toggle/styles.js.map +1 -0
- package/lib/module/composites/wui-token-button/index.js +21 -11
- package/lib/module/composites/wui-token-button/index.js.map +1 -1
- package/lib/module/composites/wui-token-button/styles.js +4 -0
- package/lib/module/composites/wui-token-button/styles.js.map +1 -1
- package/lib/module/composites/wui-wallet-image/styles.js +1 -1
- package/lib/module/composites/wui-wallet-image/styles.js.map +1 -1
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/layout/wui-flex/index.js +3 -2
- package/lib/module/layout/wui-flex/index.js.map +1 -1
- package/lib/module/layout/wui-separator/index.js +4 -4
- package/lib/module/layout/wui-separator/index.js.map +1 -1
- package/lib/module/utils/ThemeUtil.js +2 -1
- package/lib/module/utils/ThemeUtil.js.map +1 -1
- package/lib/typescript/assets/svg/RecycleHorizontal.d.ts +4 -0
- package/lib/typescript/assets/svg/RecycleHorizontal.d.ts.map +1 -0
- package/lib/typescript/components/wui-icon/index.d.ts +1 -1
- package/lib/typescript/components/wui-icon/index.d.ts.map +1 -1
- package/lib/typescript/components/wui-lean-text/index.d.ts +5 -0
- package/lib/typescript/components/wui-lean-text/index.d.ts.map +1 -0
- package/lib/typescript/components/wui-lean-text/index.web.d.ts +3 -0
- package/lib/typescript/components/wui-lean-text/index.web.d.ts.map +1 -0
- package/lib/typescript/components/wui-lean-view/index.d.ts +5 -0
- package/lib/typescript/components/wui-lean-view/index.d.ts.map +1 -0
- package/lib/typescript/components/wui-lean-view/index.web.d.ts +3 -0
- package/lib/typescript/components/wui-lean-view/index.web.d.ts.map +1 -0
- package/lib/typescript/components/wui-pressable/index.d.ts +17 -0
- package/lib/typescript/components/wui-pressable/index.d.ts.map +1 -0
- package/lib/typescript/components/wui-shimmer/index.d.ts.map +1 -1
- package/lib/typescript/components/wui-text/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-account-pill/index.d.ts +1 -2
- package/lib/typescript/composites/wui-account-pill/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-account-pill/styles.d.ts +4 -0
- package/lib/typescript/composites/wui-account-pill/styles.d.ts.map +1 -1
- package/lib/typescript/composites/wui-button/styles.d.ts.map +1 -1
- package/lib/typescript/composites/wui-icon-box/index.d.ts +1 -1
- package/lib/typescript/composites/wui-icon-box/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-list-item-loader/index.d.ts +6 -0
- package/lib/typescript/composites/wui-list-item-loader/index.d.ts.map +1 -0
- package/lib/typescript/composites/wui-list-item-loader/styles.d.ts +11 -0
- package/lib/typescript/composites/wui-list-item-loader/styles.d.ts.map +1 -0
- package/lib/typescript/composites/wui-list-token/index.d.ts +4 -1
- package/lib/typescript/composites/wui-list-token/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-list-token/styles.d.ts +3 -0
- package/lib/typescript/composites/wui-list-token/styles.d.ts.map +1 -1
- package/lib/typescript/composites/wui-list-wallet/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-qr-code/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-snackbar/index.d.ts +1 -1
- package/lib/typescript/composites/wui-snackbar/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-toggle/index.d.ts +11 -0
- package/lib/typescript/composites/wui-toggle/index.d.ts.map +1 -0
- package/lib/typescript/composites/wui-toggle/styles.d.ts +23 -0
- package/lib/typescript/composites/wui-toggle/styles.d.ts.map +1 -0
- package/lib/typescript/composites/wui-token-button/index.d.ts +7 -3
- package/lib/typescript/composites/wui-token-button/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-token-button/styles.d.ts +4 -0
- package/lib/typescript/composites/wui-token-button/styles.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +4 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/layout/wui-flex/index.d.ts +2 -1
- package/lib/typescript/layout/wui-flex/index.d.ts.map +1 -1
- package/lib/typescript/layout/wui-separator/index.d.ts.map +1 -1
- package/lib/typescript/utils/ThemeUtil.d.ts +1 -0
- package/lib/typescript/utils/ThemeUtil.d.ts.map +1 -1
- package/lib/typescript/utils/TypesUtil.d.ts +2 -2
- package/lib/typescript/utils/TypesUtil.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/assets/svg/RecycleHorizontal.tsx +12 -0
- package/src/assets/visual/Profile.tsx +2 -2
- package/src/components/wui-card/index.tsx +1 -1
- package/src/components/wui-card/styles.ts +1 -1
- package/src/components/wui-icon/index.tsx +3 -1
- package/src/components/wui-lean-text/index.tsx +10 -0
- package/src/components/wui-lean-text/index.web.tsx +3 -0
- package/src/components/wui-lean-view/index.tsx +10 -0
- package/src/components/wui-lean-view/index.web.tsx +3 -0
- package/src/components/wui-pressable/index.tsx +92 -0
- package/src/components/wui-shimmer/index.tsx +9 -2
- package/src/components/wui-text/index.tsx +4 -3
- package/src/composites/wui-account-button/styles.ts +2 -2
- package/src/composites/wui-account-pill/index.tsx +2 -10
- package/src/composites/wui-account-pill/styles.ts +5 -1
- package/src/composites/wui-button/index.tsx +1 -1
- package/src/composites/wui-button/styles.ts +3 -4
- package/src/composites/wui-chip/styles.ts +2 -2
- package/src/composites/wui-connect-button/styles.ts +1 -1
- package/src/composites/wui-icon-box/index.tsx +18 -2
- package/src/composites/wui-input-text/styles.ts +1 -1
- package/src/composites/wui-list-item-loader/index.tsx +29 -0
- package/src/composites/wui-list-item-loader/styles.ts +12 -0
- package/src/composites/wui-list-token/index.tsx +31 -8
- package/src/composites/wui-list-token/styles.ts +3 -0
- package/src/composites/wui-list-wallet/index.tsx +7 -6
- package/src/composites/wui-network-button/styles.ts +1 -1
- package/src/composites/wui-qr-code/index.tsx +4 -2
- package/src/composites/wui-snackbar/index.tsx +7 -2
- package/src/composites/wui-snackbar/styles.ts +1 -1
- package/src/composites/wui-tabs/styles.ts +1 -1
- package/src/composites/wui-toggle/index.tsx +81 -0
- package/src/composites/wui-toggle/styles.ts +24 -0
- package/src/composites/wui-token-button/index.tsx +37 -8
- package/src/composites/wui-token-button/styles.ts +4 -0
- package/src/composites/wui-wallet-image/styles.ts +1 -1
- package/src/index.ts +4 -1
- package/src/layout/wui-flex/index.tsx +8 -3
- package/src/layout/wui-separator/index.tsx +7 -4
- package/src/utils/ThemeUtil.ts +2 -1
- package/src/utils/TypesUtil.ts +2 -0
|
@@ -6,7 +6,7 @@ export default StyleSheet.create({
|
|
|
6
6
|
flexDirection: 'row',
|
|
7
7
|
height: 40,
|
|
8
8
|
borderRadius: BorderRadius.full,
|
|
9
|
-
borderWidth:
|
|
9
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
10
10
|
justifyContent: 'center',
|
|
11
11
|
alignItems: 'center',
|
|
12
12
|
paddingHorizontal: Spacing['3xs']
|
|
@@ -36,7 +36,7 @@ export default StyleSheet.create({
|
|
|
36
36
|
paddingLeft: Spacing['3xs'],
|
|
37
37
|
paddingRight: Spacing.xs,
|
|
38
38
|
borderRadius: BorderRadius.full,
|
|
39
|
-
borderWidth:
|
|
39
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
40
40
|
},
|
|
41
41
|
address: {
|
|
42
42
|
marginLeft: Spacing['3xs']
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Animated, Pressable, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
2
|
import { Avatar } from '../wui-avatar';
|
|
3
3
|
import { UiUtil } from '../../utils/UiUtil';
|
|
4
|
-
import { IconLink } from '../wui-icon-link';
|
|
5
4
|
import { Text } from '../../components/wui-text';
|
|
6
5
|
import useAnimatedValue from '../../hooks/useAnimatedValue';
|
|
7
6
|
import { useTheme } from '../../hooks/useTheme';
|
|
8
7
|
import styles from './styles';
|
|
8
|
+
import { Icon } from '../../components/wui-icon';
|
|
9
9
|
|
|
10
10
|
export interface AccountPillProps {
|
|
11
11
|
onPress: () => void;
|
|
12
|
-
onCopy: (address: string) => void;
|
|
13
12
|
address?: string;
|
|
14
13
|
profileName?: string;
|
|
15
14
|
profileImage?: string;
|
|
@@ -20,7 +19,6 @@ const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
|
20
19
|
|
|
21
20
|
export function AccountPill({
|
|
22
21
|
onPress,
|
|
23
|
-
onCopy,
|
|
24
22
|
address,
|
|
25
23
|
profileName,
|
|
26
24
|
profileImage,
|
|
@@ -36,12 +34,6 @@ export function AccountPill({
|
|
|
36
34
|
const backgroundColor = animatedValue;
|
|
37
35
|
const borderColor = Theme['gray-glass-005'];
|
|
38
36
|
|
|
39
|
-
const handleCopyAddress = () => {
|
|
40
|
-
if (address) {
|
|
41
|
-
onCopy(address);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
37
|
return (
|
|
46
38
|
<AnimatedPressable
|
|
47
39
|
style={[styles.container, { backgroundColor, borderColor }, style]}
|
|
@@ -66,7 +58,7 @@ export function AccountPill({
|
|
|
66
58
|
truncate: 'middle'
|
|
67
59
|
})}
|
|
68
60
|
</Text>
|
|
69
|
-
<
|
|
61
|
+
<Icon name="chevronBottom" size="sm" color="fg-200" style={styles.copyButton} />
|
|
70
62
|
</AnimatedPressable>
|
|
71
63
|
);
|
|
72
64
|
}
|
|
@@ -11,9 +11,13 @@ export default StyleSheet.create({
|
|
|
11
11
|
alignItems: 'center',
|
|
12
12
|
justifyContent: 'center',
|
|
13
13
|
borderRadius: BorderRadius.full,
|
|
14
|
-
borderWidth:
|
|
14
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
15
15
|
},
|
|
16
16
|
text: {
|
|
17
17
|
marginLeft: Spacing['2xs']
|
|
18
|
+
},
|
|
19
|
+
copyButton: {
|
|
20
|
+
marginLeft: Spacing.xs,
|
|
21
|
+
marginRight: Spacing.s
|
|
18
22
|
}
|
|
19
23
|
});
|
|
@@ -9,13 +9,12 @@ export const getThemedButtonStyle = (
|
|
|
9
9
|
pressed?: boolean
|
|
10
10
|
): StyleProp<any> => {
|
|
11
11
|
const buttonBaseStyle = {
|
|
12
|
-
borderColor: theme['gray-glass-
|
|
12
|
+
borderColor: theme['gray-glass-020']
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
if (disabled) {
|
|
16
16
|
return {
|
|
17
|
-
backgroundColor: variant === 'fill' ? theme['gray-glass-005'] : theme['gray-glass-010']
|
|
18
|
-
borderColor: theme['gray-glass-002']
|
|
17
|
+
backgroundColor: variant === 'fill' ? theme['gray-glass-005'] : theme['gray-glass-010']
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
20
|
|
|
@@ -62,7 +61,7 @@ export default StyleSheet.create({
|
|
|
62
61
|
alignItems: 'center',
|
|
63
62
|
justifyContent: 'center',
|
|
64
63
|
borderRadius: BorderRadius.xs,
|
|
65
|
-
borderWidth:
|
|
64
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
66
65
|
},
|
|
67
66
|
smButton: {
|
|
68
67
|
height: 32,
|
|
@@ -65,11 +65,11 @@ export default StyleSheet.create({
|
|
|
65
65
|
paddingHorizontal: Spacing.xs,
|
|
66
66
|
alignItems: 'center',
|
|
67
67
|
borderRadius: BorderRadius.s,
|
|
68
|
-
borderWidth:
|
|
68
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
69
69
|
},
|
|
70
70
|
image: {
|
|
71
71
|
borderRadius: BorderRadius.full,
|
|
72
|
-
borderWidth:
|
|
72
|
+
borderWidth: StyleSheet.hairlineWidth
|
|
73
73
|
},
|
|
74
74
|
smImage: {
|
|
75
75
|
width: 16,
|
|
@@ -7,7 +7,7 @@ import styles from './styles';
|
|
|
7
7
|
|
|
8
8
|
export interface IconBoxProps {
|
|
9
9
|
icon: IconType;
|
|
10
|
-
size?: Exclude<SizeType, '
|
|
10
|
+
size?: Exclude<SizeType, 'xs' | 'xxs'>;
|
|
11
11
|
iconColor?: ColorType;
|
|
12
12
|
iconSize?: Exclude<SizeType, 'xl'>;
|
|
13
13
|
background?: boolean;
|
|
@@ -33,6 +33,9 @@ export function IconBox({
|
|
|
33
33
|
const Theme = useTheme();
|
|
34
34
|
let _iconSize: SizeType;
|
|
35
35
|
switch (size) {
|
|
36
|
+
case 'xl':
|
|
37
|
+
_iconSize = 'xl';
|
|
38
|
+
break;
|
|
36
39
|
case 'lg':
|
|
37
40
|
_iconSize = 'lg';
|
|
38
41
|
break;
|
|
@@ -48,6 +51,9 @@ export function IconBox({
|
|
|
48
51
|
|
|
49
52
|
let boxSize: number;
|
|
50
53
|
switch (size) {
|
|
54
|
+
case 'xl':
|
|
55
|
+
boxSize = 56;
|
|
56
|
+
break;
|
|
51
57
|
case 'lg':
|
|
52
58
|
boxSize = 40;
|
|
53
59
|
break;
|
|
@@ -58,7 +64,17 @@ export function IconBox({
|
|
|
58
64
|
boxSize = 24;
|
|
59
65
|
}
|
|
60
66
|
|
|
61
|
-
|
|
67
|
+
let borderRadius: keyof typeof BorderRadius;
|
|
68
|
+
switch (size) {
|
|
69
|
+
case 'xl':
|
|
70
|
+
borderRadius = 's';
|
|
71
|
+
break;
|
|
72
|
+
case 'lg':
|
|
73
|
+
borderRadius = 'xxs';
|
|
74
|
+
break;
|
|
75
|
+
default:
|
|
76
|
+
borderRadius = '3xl';
|
|
77
|
+
}
|
|
62
78
|
|
|
63
79
|
const backgroundStyle = {
|
|
64
80
|
backgroundColor:
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import { BorderRadius, WalletImageSize } from '../../utils/ThemeUtil';
|
|
3
|
+
import { useTheme } from '../../hooks/useTheme';
|
|
4
|
+
import { Shimmer } from '../../components/wui-shimmer';
|
|
5
|
+
import { FlexView } from '../../layout/wui-flex';
|
|
6
|
+
import styles from './styles';
|
|
7
|
+
|
|
8
|
+
export interface ListItemLoaderProps {
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function ListItemLoader({ style }: ListItemLoaderProps) {
|
|
13
|
+
const Theme = useTheme();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<FlexView
|
|
17
|
+
alignItems="center"
|
|
18
|
+
flexDirection="row"
|
|
19
|
+
style={[styles.container, { backgroundColor: Theme['gray-glass-002'] }, style]}
|
|
20
|
+
>
|
|
21
|
+
<Shimmer
|
|
22
|
+
height={WalletImageSize.sm}
|
|
23
|
+
width={WalletImageSize.sm}
|
|
24
|
+
borderRadius={BorderRadius.xxs}
|
|
25
|
+
/>
|
|
26
|
+
<Shimmer height={22} width={80} borderRadius={6} style={styles.text} />
|
|
27
|
+
</FlexView>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { BorderRadius, Spacing } from '../../utils/ThemeUtil';
|
|
3
|
+
|
|
4
|
+
export default StyleSheet.create({
|
|
5
|
+
container: {
|
|
6
|
+
borderRadius: BorderRadius.xs,
|
|
7
|
+
padding: Spacing.xs
|
|
8
|
+
},
|
|
9
|
+
text: {
|
|
10
|
+
marginLeft: Spacing.s
|
|
11
|
+
}
|
|
12
|
+
});
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { Pressable } from 'react-native';
|
|
2
1
|
import { Icon } from '../../components/wui-icon';
|
|
3
2
|
import { Image } from '../../components/wui-image';
|
|
4
3
|
import { Text } from '../../components/wui-text';
|
|
4
|
+
import { Pressable } from '../../components/wui-pressable';
|
|
5
5
|
import { useTheme } from '../../hooks/useTheme';
|
|
6
6
|
import { FlexView } from '../../layout/wui-flex';
|
|
7
7
|
import { UiUtil } from '../../utils/UiUtil';
|
|
8
8
|
import styles from './styles';
|
|
9
9
|
|
|
10
|
+
export const ListTokenTotalHeight = 64;
|
|
11
|
+
|
|
10
12
|
export interface ListTokenProps {
|
|
11
13
|
imageSrc: string;
|
|
12
14
|
networkSrc?: string;
|
|
@@ -15,6 +17,8 @@ export interface ListTokenProps {
|
|
|
15
17
|
amount?: string;
|
|
16
18
|
currency: string;
|
|
17
19
|
onPress?: () => void;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
pressable?: boolean;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
export function ListToken({
|
|
@@ -24,17 +28,25 @@ export function ListToken({
|
|
|
24
28
|
value,
|
|
25
29
|
amount,
|
|
26
30
|
currency,
|
|
27
|
-
onPress
|
|
31
|
+
onPress,
|
|
32
|
+
disabled,
|
|
33
|
+
pressable = true
|
|
28
34
|
}: ListTokenProps) {
|
|
29
35
|
const Theme = useTheme();
|
|
30
36
|
|
|
31
37
|
return (
|
|
32
|
-
<Pressable
|
|
38
|
+
<Pressable
|
|
39
|
+
onPress={onPress}
|
|
40
|
+
disabled={disabled || !pressable}
|
|
41
|
+
style={styles.pressable}
|
|
42
|
+
backgroundColor="transparent"
|
|
43
|
+
>
|
|
33
44
|
<FlexView
|
|
34
45
|
flexDirection="row"
|
|
35
46
|
justifyContent="space-between"
|
|
36
47
|
alignItems="center"
|
|
37
|
-
padding={['
|
|
48
|
+
padding={['0', 'm', '0', 'xs']}
|
|
49
|
+
style={{ height: ListTokenTotalHeight }}
|
|
38
50
|
>
|
|
39
51
|
<FlexView flexDirection="row" alignItems="center">
|
|
40
52
|
{imageSrc ? (
|
|
@@ -66,15 +78,26 @@ export function ListToken({
|
|
|
66
78
|
)}
|
|
67
79
|
</FlexView>
|
|
68
80
|
<FlexView padding={['0', 's', '0', 's']}>
|
|
69
|
-
<Text color=
|
|
70
|
-
{
|
|
81
|
+
<Text color={disabled ? 'fg-200' : 'fg-100'} variant="paragraph-500">
|
|
82
|
+
{UiUtil.getTruncateString({
|
|
83
|
+
string: name,
|
|
84
|
+
charsStart: 15,
|
|
85
|
+
charsEnd: 0,
|
|
86
|
+
truncate: 'end'
|
|
87
|
+
})}
|
|
71
88
|
</Text>
|
|
72
89
|
<Text variant="small-400" color="fg-200">
|
|
73
|
-
{UiUtil.formatNumberToLocalString(amount, 4)}
|
|
90
|
+
{UiUtil.formatNumberToLocalString(amount, 4)}{' '}
|
|
91
|
+
{UiUtil.getTruncateString({
|
|
92
|
+
string: currency,
|
|
93
|
+
charsStart: 8,
|
|
94
|
+
charsEnd: 0,
|
|
95
|
+
truncate: 'end'
|
|
96
|
+
})}
|
|
74
97
|
</Text>
|
|
75
98
|
</FlexView>
|
|
76
99
|
</FlexView>
|
|
77
|
-
<Text color=
|
|
100
|
+
<Text color={disabled ? 'fg-200' : 'fg-100'} variant="paragraph-500">
|
|
78
101
|
${value?.toFixed(2) ?? '0.00'}
|
|
79
102
|
</Text>
|
|
80
103
|
</FlexView>
|
|
@@ -2,6 +2,9 @@ import { StyleSheet } from 'react-native';
|
|
|
2
2
|
import { BorderRadius, WalletImageSize } from '../../utils/ThemeUtil';
|
|
3
3
|
|
|
4
4
|
export default StyleSheet.create({
|
|
5
|
+
pressable: {
|
|
6
|
+
borderRadius: BorderRadius.s
|
|
7
|
+
},
|
|
5
8
|
image: {
|
|
6
9
|
height: WalletImageSize.sm,
|
|
7
10
|
width: WalletImageSize.sm,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Animated, Pressable,
|
|
1
|
+
import { Animated, Pressable, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
2
|
import { Text } from '../../components/wui-text';
|
|
3
3
|
import useAnimatedValue from '../../hooks/useAnimatedValue';
|
|
4
4
|
import { useTheme } from '../../hooks/useTheme';
|
|
@@ -6,9 +6,10 @@ import type { IconType, TagType } from '../../utils/TypesUtil';
|
|
|
6
6
|
import { Tag } from '../wui-tag';
|
|
7
7
|
import { WalletImage } from '../wui-wallet-image';
|
|
8
8
|
import { Icon } from '../../components/wui-icon';
|
|
9
|
+
import { LeanView } from '../../components/wui-lean-view';
|
|
10
|
+
import { IconBox } from '../wui-icon-box';
|
|
9
11
|
|
|
10
12
|
import styles from './styles';
|
|
11
|
-
import { IconBox } from '../wui-icon-box';
|
|
12
13
|
|
|
13
14
|
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
14
15
|
|
|
@@ -67,7 +68,7 @@ export function ListWallet({
|
|
|
67
68
|
|
|
68
69
|
function imageTemplate() {
|
|
69
70
|
return (
|
|
70
|
-
<
|
|
71
|
+
<LeanView>
|
|
71
72
|
<WalletImage
|
|
72
73
|
style={[styles.image, disabled && styles.imageDisabled]}
|
|
73
74
|
imageSrc={imageSrc}
|
|
@@ -76,7 +77,7 @@ export function ListWallet({
|
|
|
76
77
|
size="sm"
|
|
77
78
|
/>
|
|
78
79
|
{templateInstalled()}
|
|
79
|
-
</
|
|
80
|
+
</LeanView>
|
|
80
81
|
);
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -116,12 +117,12 @@ export function ListWallet({
|
|
|
116
117
|
onPressOut={setStartValue}
|
|
117
118
|
testID={testID}
|
|
118
119
|
>
|
|
119
|
-
<
|
|
120
|
+
<LeanView style={styles.leftSide}>
|
|
120
121
|
{imageTemplate()}
|
|
121
122
|
<Text variant="paragraph-500" style={styles.name} color={disabled ? 'fg-300' : 'fg-100'}>
|
|
122
123
|
{name}
|
|
123
124
|
</Text>
|
|
124
|
-
</
|
|
125
|
+
</LeanView>
|
|
125
126
|
{iconTemplate()}
|
|
126
127
|
</AnimatedPressable>
|
|
127
128
|
);
|
|
@@ -21,6 +21,8 @@ export interface QrCodeProps {
|
|
|
21
21
|
style?: StyleProp<ViewStyle>;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
const LABEL_HEIGHT = 18;
|
|
25
|
+
|
|
24
26
|
export function QrCode({ size, uri, imageSrc, testID, arenaClear, icon, style }: QrCodeProps) {
|
|
25
27
|
const Theme = LightTheme;
|
|
26
28
|
const containerPadding = Spacing.l;
|
|
@@ -75,7 +77,7 @@ export function QrCode({ size, uri, imageSrc, testID, arenaClear, icon, style }:
|
|
|
75
77
|
</Svg>
|
|
76
78
|
{logoTemplate()}
|
|
77
79
|
</FlexView>
|
|
78
|
-
<Text variant="small-500" color="fg-150" style={styles.label}>
|
|
80
|
+
<Text variant="small-500" color="fg-150" style={[styles.label, { height: LABEL_HEIGHT }]}>
|
|
79
81
|
UX by{' '}
|
|
80
82
|
<Text variant="small-500" color="inverse-000">
|
|
81
83
|
Reown
|
|
@@ -83,6 +85,6 @@ export function QrCode({ size, uri, imageSrc, testID, arenaClear, icon, style }:
|
|
|
83
85
|
</Text>
|
|
84
86
|
</View>
|
|
85
87
|
) : (
|
|
86
|
-
<Shimmer width={size} height={size} borderRadius={BorderRadius.l} />
|
|
88
|
+
<Shimmer width={size} height={size + LABEL_HEIGHT} borderRadius={BorderRadius.l} />
|
|
87
89
|
);
|
|
88
90
|
}
|
|
@@ -4,11 +4,12 @@ import { useTheme } from '../../hooks/useTheme';
|
|
|
4
4
|
import type { ColorType, IconType } from '../../utils/TypesUtil';
|
|
5
5
|
import { IconBox } from '../wui-icon-box';
|
|
6
6
|
import styles from './styles';
|
|
7
|
+
import { LoadingSpinner } from '../../components/wui-loading-spinner';
|
|
7
8
|
|
|
8
9
|
export interface SnackbarProps {
|
|
9
10
|
message: string;
|
|
10
11
|
iconColor: ColorType;
|
|
11
|
-
icon: IconType;
|
|
12
|
+
icon: IconType | 'loading';
|
|
12
13
|
style?: StyleProp<ViewStyle>;
|
|
13
14
|
}
|
|
14
15
|
|
|
@@ -24,7 +25,11 @@ export function Snackbar({ message, iconColor, icon, style }: SnackbarProps) {
|
|
|
24
25
|
style
|
|
25
26
|
]}
|
|
26
27
|
>
|
|
27
|
-
|
|
28
|
+
{icon === 'loading' ? (
|
|
29
|
+
<LoadingSpinner size="md" />
|
|
30
|
+
) : (
|
|
31
|
+
<IconBox icon={icon} iconColor={iconColor} size="sm" background />
|
|
32
|
+
)}
|
|
28
33
|
<Text variant="paragraph-500" color="fg-100" style={styles.text}>
|
|
29
34
|
{message}
|
|
30
35
|
</Text>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { useState, useRef } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Animated,
|
|
4
|
+
type LayoutChangeEvent,
|
|
5
|
+
type StyleProp,
|
|
6
|
+
type ViewStyle,
|
|
7
|
+
Pressable
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
|
|
10
|
+
import { IconBox } from '../wui-icon-box';
|
|
11
|
+
import { FlexView } from '../../layout/wui-flex';
|
|
12
|
+
import { Text } from '../../components/wui-text';
|
|
13
|
+
import styles from './styles';
|
|
14
|
+
|
|
15
|
+
export interface ToggleProps {
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
title?: string | React.ReactNode;
|
|
18
|
+
style?: StyleProp<ViewStyle>;
|
|
19
|
+
initialOpen?: boolean;
|
|
20
|
+
canClose?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function Toggle({
|
|
24
|
+
children,
|
|
25
|
+
style,
|
|
26
|
+
title = 'Details',
|
|
27
|
+
initialOpen = false,
|
|
28
|
+
canClose = true
|
|
29
|
+
}: ToggleProps) {
|
|
30
|
+
const [isOpen, setIsOpen] = useState(initialOpen);
|
|
31
|
+
const animatedHeight = useRef(new Animated.Value(0)).current;
|
|
32
|
+
const contentHeight = useRef(0);
|
|
33
|
+
const hasInitialized = useRef(false);
|
|
34
|
+
|
|
35
|
+
const toggleDetails = () => {
|
|
36
|
+
if (canClose) {
|
|
37
|
+
const toValue = isOpen ? 0 : contentHeight.current;
|
|
38
|
+
|
|
39
|
+
Animated.spring(animatedHeight, {
|
|
40
|
+
toValue,
|
|
41
|
+
useNativeDriver: false,
|
|
42
|
+
bounciness: 0
|
|
43
|
+
}).start();
|
|
44
|
+
|
|
45
|
+
setIsOpen(!isOpen);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const measureContent = (event: LayoutChangeEvent) => {
|
|
50
|
+
const height = event.nativeEvent.layout.height;
|
|
51
|
+
contentHeight.current = height;
|
|
52
|
+
|
|
53
|
+
if (!hasInitialized.current && initialOpen) {
|
|
54
|
+
hasInitialized.current = true;
|
|
55
|
+
animatedHeight.setValue(height);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<FlexView style={[styles.container, style]}>
|
|
61
|
+
<Pressable onPress={toggleDetails} style={styles.header}>
|
|
62
|
+
{typeof title === 'string' ? (
|
|
63
|
+
<Text variant="small-400" color="fg-100">
|
|
64
|
+
{title}
|
|
65
|
+
</Text>
|
|
66
|
+
) : (
|
|
67
|
+
title
|
|
68
|
+
)}
|
|
69
|
+
{canClose && (
|
|
70
|
+
<IconBox icon={isOpen ? 'chevronTop' : 'chevronBottom'} size="sm" iconColor="fg-200" />
|
|
71
|
+
)}
|
|
72
|
+
</Pressable>
|
|
73
|
+
|
|
74
|
+
<Animated.View style={[styles.contentWrapper, { height: animatedHeight }]}>
|
|
75
|
+
<FlexView style={styles.content} onLayout={measureContent}>
|
|
76
|
+
{children}
|
|
77
|
+
</FlexView>
|
|
78
|
+
</Animated.View>
|
|
79
|
+
</FlexView>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { Spacing } from '../../utils/ThemeUtil';
|
|
3
|
+
|
|
4
|
+
export default StyleSheet.create({
|
|
5
|
+
container: {
|
|
6
|
+
overflow: 'hidden'
|
|
7
|
+
},
|
|
8
|
+
header: {
|
|
9
|
+
flexDirection: 'row',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
justifyContent: 'space-between',
|
|
12
|
+
paddingVertical: Spacing.s,
|
|
13
|
+
paddingHorizontal: Spacing.l
|
|
14
|
+
},
|
|
15
|
+
content: {
|
|
16
|
+
paddingHorizontal: Spacing.l,
|
|
17
|
+
paddingBottom: Spacing.l,
|
|
18
|
+
position: 'absolute',
|
|
19
|
+
width: '100%'
|
|
20
|
+
},
|
|
21
|
+
contentWrapper: {
|
|
22
|
+
overflow: 'hidden'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
2
|
import { Image } from '../../components/wui-image';
|
|
3
3
|
import { Text } from '../../components/wui-text';
|
|
4
4
|
import { Button } from '../wui-button';
|
|
@@ -6,13 +6,30 @@ import styles from './styles';
|
|
|
6
6
|
|
|
7
7
|
export interface TokenButtonProps {
|
|
8
8
|
onPress?: () => void;
|
|
9
|
-
|
|
9
|
+
imageUrl?: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
inverse?: boolean;
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
|
+
disabled?: boolean;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
|
-
export function TokenButton({
|
|
13
|
-
|
|
16
|
+
export function TokenButton({
|
|
17
|
+
imageUrl,
|
|
18
|
+
text,
|
|
19
|
+
inverse,
|
|
20
|
+
onPress,
|
|
21
|
+
style,
|
|
22
|
+
disabled = false
|
|
23
|
+
}: TokenButtonProps) {
|
|
24
|
+
if (!text) {
|
|
14
25
|
return (
|
|
15
|
-
<Button
|
|
26
|
+
<Button
|
|
27
|
+
variant="accent"
|
|
28
|
+
style={[styles.selectButton, style]}
|
|
29
|
+
size="sm"
|
|
30
|
+
onPress={onPress}
|
|
31
|
+
disabled={disabled}
|
|
32
|
+
>
|
|
16
33
|
<Text variant="small-600" color="accent-100">
|
|
17
34
|
Select token
|
|
18
35
|
</Text>
|
|
@@ -20,10 +37,22 @@ export function TokenButton({ token, onPress }: TokenButtonProps) {
|
|
|
20
37
|
);
|
|
21
38
|
}
|
|
22
39
|
|
|
40
|
+
const content = [
|
|
41
|
+
imageUrl && (
|
|
42
|
+
<Image key="image" source={imageUrl} style={[styles.image, inverse && styles.imageInverse]} />
|
|
43
|
+
),
|
|
44
|
+
<Text key="text">{text}</Text>
|
|
45
|
+
];
|
|
46
|
+
|
|
23
47
|
return (
|
|
24
|
-
<Button
|
|
25
|
-
|
|
26
|
-
{
|
|
48
|
+
<Button
|
|
49
|
+
variant="shade"
|
|
50
|
+
style={[styles.container, style]}
|
|
51
|
+
size="sm"
|
|
52
|
+
onPress={onPress}
|
|
53
|
+
disabled={disabled}
|
|
54
|
+
>
|
|
55
|
+
{inverse ? content.reverse() : content}
|
|
27
56
|
</Button>
|
|
28
57
|
);
|
|
29
58
|
}
|