@reown/appkit-ui-react-native 0.0.0-chore-solflare-20250730210452 → 0.0.0-chore-spring-effect-20250909214820
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/Reown.js +47 -0
- package/lib/commonjs/assets/svg/Reown.js.map +1 -0
- package/lib/commonjs/components/wui-card/index.js +1 -3
- package/lib/commonjs/components/wui-card/index.js.map +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-modal/index.js +32 -35
- package/lib/commonjs/components/wui-modal/index.js.map +1 -1
- package/lib/commonjs/components/wui-modal/styles.js +7 -9
- package/lib/commonjs/components/wui-modal/styles.js.map +1 -1
- package/lib/commonjs/components/wui-shimmer/index.js +92 -32
- package/lib/commonjs/components/wui-shimmer/index.js.map +1 -1
- package/lib/commonjs/composites/wui-account-button/index.js +2 -2
- package/lib/commonjs/composites/wui-account-button/index.js.map +1 -1
- package/lib/commonjs/composites/wui-button/index.js +5 -5
- package/lib/commonjs/composites/wui-button/index.js.map +1 -1
- package/lib/commonjs/composites/wui-card-select/index.js +46 -44
- package/lib/commonjs/composites/wui-card-select/index.js.map +1 -1
- package/lib/commonjs/composites/wui-card-select-loader/index.js +7 -3
- package/lib/commonjs/composites/wui-card-select-loader/index.js.map +1 -1
- package/lib/commonjs/composites/wui-chip/index.js +5 -5
- package/lib/commonjs/composites/wui-chip/index.js.map +1 -1
- package/lib/commonjs/composites/wui-email-input/index.js +3 -3
- package/lib/commonjs/composites/wui-email-input/index.js.map +1 -1
- package/lib/commonjs/composites/wui-input-text/index.js +2 -2
- package/lib/commonjs/composites/wui-input-text/index.js.map +1 -1
- package/lib/commonjs/composites/wui-link/index.js +4 -4
- package/lib/commonjs/composites/wui-link/index.js.map +1 -1
- package/lib/commonjs/composites/wui-list-transaction/index.js +2 -2
- package/lib/commonjs/composites/wui-list-transaction/index.js.map +1 -1
- package/lib/commonjs/composites/wui-logo-select/index.js +1 -1
- package/lib/commonjs/composites/wui-logo-select/index.js.map +1 -1
- package/lib/commonjs/composites/wui-otp/index.js +1 -1
- package/lib/commonjs/composites/wui-otp/index.js.map +1 -1
- package/lib/commonjs/composites/wui-qr-code/index.js +7 -25
- package/lib/commonjs/composites/wui-qr-code/index.js.map +1 -1
- package/lib/commonjs/composites/wui-qr-code/styles.js +0 -3
- package/lib/commonjs/composites/wui-qr-code/styles.js.map +1 -1
- package/lib/commonjs/composites/wui-search-bar/index.js +2 -2
- package/lib/commonjs/composites/wui-search-bar/index.js.map +1 -1
- package/lib/commonjs/composites/wui-tabs/index.js +2 -2
- package/lib/commonjs/composites/wui-tabs/index.js.map +1 -1
- package/lib/commonjs/composites/wui-toggle/index.js +2 -2
- package/lib/commonjs/composites/wui-toggle/index.js.map +1 -1
- package/lib/commonjs/composites/wui-token-button/index.js +5 -5
- package/lib/commonjs/composites/wui-token-button/index.js.map +1 -1
- package/lib/commonjs/composites/wui-transaction-visual/index.js +3 -3
- package/lib/commonjs/composites/wui-transaction-visual/index.js.map +1 -1
- package/lib/commonjs/composites/wui-wallet-image/index.js +2 -2
- package/lib/commonjs/composites/wui-wallet-image/index.js.map +1 -1
- package/lib/commonjs/hooks/useCustomDimensions.js +42 -0
- package/lib/commonjs/hooks/useCustomDimensions.js.map +1 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/layout/wui-flex/index.js +3 -0
- package/lib/commonjs/layout/wui-flex/index.js.map +1 -1
- package/lib/commonjs/utils/QRCodeUtil.js +2 -2
- package/lib/commonjs/utils/QRCodeUtil.js.map +1 -1
- package/lib/commonjs/utils/UiUtil.js +1 -1
- package/lib/commonjs/utils/UiUtil.js.map +1 -1
- package/lib/module/assets/svg/Reown.js +42 -0
- package/lib/module/assets/svg/Reown.js.map +1 -0
- package/lib/module/components/wui-card/index.js +2 -4
- package/lib/module/components/wui-card/index.js.map +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-modal/index.js +34 -37
- package/lib/module/components/wui-modal/index.js.map +1 -1
- package/lib/module/components/wui-modal/styles.js +7 -9
- package/lib/module/components/wui-modal/styles.js.map +1 -1
- package/lib/module/components/wui-shimmer/index.js +93 -32
- package/lib/module/components/wui-shimmer/index.js.map +1 -1
- package/lib/module/composites/wui-account-button/index.js +2 -2
- package/lib/module/composites/wui-account-button/index.js.map +1 -1
- package/lib/module/composites/wui-button/index.js +5 -5
- package/lib/module/composites/wui-button/index.js.map +1 -1
- package/lib/module/composites/wui-card-select/index.js +47 -45
- package/lib/module/composites/wui-card-select/index.js.map +1 -1
- package/lib/module/composites/wui-card-select-loader/index.js +5 -1
- package/lib/module/composites/wui-card-select-loader/index.js.map +1 -1
- package/lib/module/composites/wui-chip/index.js +5 -5
- package/lib/module/composites/wui-chip/index.js.map +1 -1
- package/lib/module/composites/wui-email-input/index.js +3 -3
- package/lib/module/composites/wui-email-input/index.js.map +1 -1
- package/lib/module/composites/wui-input-text/index.js +2 -2
- package/lib/module/composites/wui-input-text/index.js.map +1 -1
- package/lib/module/composites/wui-link/index.js +4 -4
- package/lib/module/composites/wui-link/index.js.map +1 -1
- package/lib/module/composites/wui-list-transaction/index.js +2 -2
- package/lib/module/composites/wui-list-transaction/index.js.map +1 -1
- package/lib/module/composites/wui-logo-select/index.js +1 -1
- package/lib/module/composites/wui-logo-select/index.js.map +1 -1
- package/lib/module/composites/wui-otp/index.js +1 -1
- package/lib/module/composites/wui-otp/index.js.map +1 -1
- package/lib/module/composites/wui-qr-code/index.js +7 -25
- package/lib/module/composites/wui-qr-code/index.js.map +1 -1
- package/lib/module/composites/wui-qr-code/styles.js +0 -3
- package/lib/module/composites/wui-qr-code/styles.js.map +1 -1
- package/lib/module/composites/wui-search-bar/index.js +2 -2
- package/lib/module/composites/wui-search-bar/index.js.map +1 -1
- package/lib/module/composites/wui-tabs/index.js +2 -2
- package/lib/module/composites/wui-tabs/index.js.map +1 -1
- package/lib/module/composites/wui-toggle/index.js +2 -2
- package/lib/module/composites/wui-toggle/index.js.map +1 -1
- package/lib/module/composites/wui-token-button/index.js +5 -5
- package/lib/module/composites/wui-token-button/index.js.map +1 -1
- package/lib/module/composites/wui-transaction-visual/index.js +3 -3
- package/lib/module/composites/wui-transaction-visual/index.js.map +1 -1
- package/lib/module/composites/wui-wallet-image/index.js +2 -2
- package/lib/module/composites/wui-wallet-image/index.js.map +1 -1
- package/lib/module/hooks/useCustomDimensions.js +39 -0
- package/lib/module/hooks/useCustomDimensions.js.map +1 -0
- package/lib/module/index.js +10 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/layout/wui-flex/index.js +3 -0
- package/lib/module/layout/wui-flex/index.js.map +1 -1
- package/lib/module/utils/QRCodeUtil.js +3 -3
- package/lib/module/utils/QRCodeUtil.js.map +1 -1
- package/lib/module/utils/UiUtil.js +1 -1
- package/lib/module/utils/UiUtil.js.map +1 -1
- package/lib/typescript/assets/svg/Reown.d.ts +4 -0
- package/lib/typescript/assets/svg/Reown.d.ts.map +1 -0
- package/lib/typescript/components/wui-card/index.d.ts.map +1 -1
- package/lib/typescript/components/wui-icon/index.d.ts.map +1 -1
- package/lib/typescript/components/wui-modal/index.d.ts.map +1 -1
- package/lib/typescript/components/wui-modal/styles.d.ts +7 -9
- package/lib/typescript/components/wui-modal/styles.d.ts.map +1 -1
- package/lib/typescript/components/wui-shimmer/index.d.ts +11 -3
- package/lib/typescript/components/wui-shimmer/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-card-select/index.d.ts +2 -2
- package/lib/typescript/composites/wui-card-select/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-card-select-loader/index.d.ts +3 -1
- package/lib/typescript/composites/wui-card-select-loader/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-qr-code/index.d.ts.map +1 -1
- package/lib/typescript/composites/wui-qr-code/styles.d.ts +0 -3
- package/lib/typescript/composites/wui-qr-code/styles.d.ts.map +1 -1
- package/lib/typescript/composites/wui-token-button/index.d.ts.map +1 -1
- package/lib/typescript/hooks/useCustomDimensions.d.ts +13 -0
- package/lib/typescript/hooks/useCustomDimensions.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +6 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/layout/wui-flex/index.d.ts +3 -0
- package/lib/typescript/layout/wui-flex/index.d.ts.map +1 -1
- package/lib/typescript/utils/TypesUtil.d.ts +1 -1
- package/lib/typescript/utils/TypesUtil.d.ts.map +1 -1
- package/lib/typescript/utils/UiUtil.d.ts +1 -1
- package/lib/typescript/utils/UiUtil.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/assets/svg/Reown.tsx +40 -0
- package/src/components/wui-card/index.tsx +3 -5
- package/src/components/wui-card/styles.ts +1 -1
- package/src/components/wui-icon/index.tsx +2 -0
- package/src/components/wui-modal/index.tsx +32 -38
- package/src/components/wui-modal/styles.ts +7 -9
- package/src/components/wui-shimmer/index.tsx +105 -39
- package/src/composites/wui-account-button/index.tsx +2 -2
- package/src/composites/wui-button/index.tsx +5 -5
- package/src/composites/wui-card-select/index.tsx +48 -48
- package/src/composites/wui-card-select-loader/index.tsx +5 -1
- package/src/composites/wui-chip/index.tsx +5 -5
- package/src/composites/wui-email-input/index.tsx +3 -3
- package/src/composites/wui-input-text/index.tsx +1 -1
- package/src/composites/wui-link/index.tsx +4 -4
- package/src/composites/wui-list-transaction/index.tsx +2 -2
- package/src/composites/wui-logo-select/index.tsx +1 -1
- package/src/composites/wui-otp/index.tsx +1 -1
- package/src/composites/wui-qr-code/index.tsx +6 -18
- package/src/composites/wui-qr-code/styles.ts +0 -3
- package/src/composites/wui-search-bar/index.tsx +2 -2
- package/src/composites/wui-tabs/index.tsx +2 -2
- package/src/composites/wui-toggle/index.tsx +2 -2
- package/src/composites/wui-token-button/index.tsx +5 -3
- package/src/composites/wui-transaction-visual/index.tsx +4 -4
- package/src/composites/wui-wallet-image/index.tsx +2 -2
- package/src/hooks/useCustomDimensions.ts +41 -0
- package/src/index.ts +7 -0
- package/src/layout/wui-flex/index.tsx +6 -0
- package/src/utils/QRCodeUtil.tsx +3 -3
- package/src/utils/TypesUtil.ts +1 -0
- package/src/utils/UiUtil.ts +2 -2
|
@@ -84,7 +84,7 @@ export function EmailInput({
|
|
|
84
84
|
return (
|
|
85
85
|
<RightIcon
|
|
86
86
|
loading={loading}
|
|
87
|
-
showChevron={submitEnabled
|
|
87
|
+
showChevron={submitEnabled ? !errorMessage : false}
|
|
88
88
|
onPress={handleChevronPress}
|
|
89
89
|
/>
|
|
90
90
|
);
|
|
@@ -107,11 +107,11 @@ export function EmailInput({
|
|
|
107
107
|
>
|
|
108
108
|
{rightIconTemplate()}
|
|
109
109
|
</InputText>
|
|
110
|
-
{errorMessage
|
|
110
|
+
{errorMessage ? (
|
|
111
111
|
<Text color="error-100" variant="tiny-500" style={styles.text}>
|
|
112
112
|
{errorMessage}
|
|
113
113
|
</Text>
|
|
114
|
-
)}
|
|
114
|
+
) : null}
|
|
115
115
|
</View>
|
|
116
116
|
);
|
|
117
117
|
}
|
|
@@ -113,7 +113,7 @@ export const InputText = forwardRef<InputRef, InputTextProps>(
|
|
|
113
113
|
disabled && { backgroundColor: Theme['gray-glass-002'] }
|
|
114
114
|
]}
|
|
115
115
|
>
|
|
116
|
-
{icon
|
|
116
|
+
{icon ? <Icon name={icon} size="md" color="fg-275" style={styles.icon} /> : null}
|
|
117
117
|
<TextInput
|
|
118
118
|
ref={inputRef}
|
|
119
119
|
onFocus={handleFocus}
|
|
@@ -54,15 +54,15 @@ export function Link({
|
|
|
54
54
|
{...rest}
|
|
55
55
|
>
|
|
56
56
|
<FlexView flexDirection="row" alignItems="center" justifyContent="center">
|
|
57
|
-
{iconLeft
|
|
57
|
+
{iconLeft ? (
|
|
58
58
|
<Icon color={_color} name={iconLeft} size={iconSize} style={styles.iconLeft} />
|
|
59
|
-
)}
|
|
59
|
+
) : null}
|
|
60
60
|
<Text variant={size === 'md' ? 'paragraph-600' : 'small-600'} color={_color}>
|
|
61
61
|
{children}
|
|
62
62
|
</Text>
|
|
63
|
-
{iconRight
|
|
63
|
+
{iconRight ? (
|
|
64
64
|
<Icon color={_color} name={iconRight} size={iconSize} style={styles.iconRight} />
|
|
65
|
-
)}
|
|
65
|
+
) : null}
|
|
66
66
|
</FlexView>
|
|
67
67
|
</AnimatedPressable>
|
|
68
68
|
);
|
|
@@ -38,7 +38,7 @@ export function ListTransaction({
|
|
|
38
38
|
<FlexView flexDirection="row" alignItems="center" style={styles.middleContainer}>
|
|
39
39
|
<FlexView justifyContent="center" alignItems="flex-start">
|
|
40
40
|
<FlexView flexDirection="row" alignItems="center">
|
|
41
|
-
{type
|
|
41
|
+
{type ? (
|
|
42
42
|
<IconBox
|
|
43
43
|
icon={getIcon(type)}
|
|
44
44
|
size="sm"
|
|
@@ -47,7 +47,7 @@ export function ListTransaction({
|
|
|
47
47
|
border
|
|
48
48
|
borderColor="bg-100"
|
|
49
49
|
/>
|
|
50
|
-
)}
|
|
50
|
+
) : null}
|
|
51
51
|
<Text variant="paragraph-500" color="fg-100">
|
|
52
52
|
{getTypeLabel(type)}
|
|
53
53
|
</Text>
|
|
@@ -29,7 +29,7 @@ export function LogoSelect({ logo, disabled, style, onPress }: LogoSelectProps)
|
|
|
29
29
|
style={[styles.box, { backgroundColor: animatedValue }, style]}
|
|
30
30
|
disabled={disabled}
|
|
31
31
|
>
|
|
32
|
-
<Logo logo={logo} style={disabled
|
|
32
|
+
<Logo logo={logo} style={disabled ? styles.disabled : null} />
|
|
33
33
|
</AnimatedPressable>
|
|
34
34
|
);
|
|
35
35
|
}
|
|
@@ -82,7 +82,7 @@ export function Otp({ length, style, onChangeText, autoFocus }: OtpProps) {
|
|
|
82
82
|
<View style={styles.container}>
|
|
83
83
|
{Array.from({ length }).map((_, index) => (
|
|
84
84
|
<InputNumeric
|
|
85
|
-
autoFocus={autoFocus
|
|
85
|
+
autoFocus={autoFocus ? index === 0 : undefined}
|
|
86
86
|
key={index}
|
|
87
87
|
style={style}
|
|
88
88
|
value={value[index] || ''}
|
|
@@ -4,8 +4,6 @@ import Svg from 'react-native-svg';
|
|
|
4
4
|
import { Icon } from '../../components/wui-icon';
|
|
5
5
|
import { Image } from '../../components/wui-image';
|
|
6
6
|
import { Shimmer } from '../../components/wui-shimmer';
|
|
7
|
-
import { Text } from '../../components/wui-text';
|
|
8
|
-
import { FlexView } from '../../layout/wui-flex';
|
|
9
7
|
import { QRCodeUtil } from '../../utils/QRCodeUtil';
|
|
10
8
|
import { BorderRadius, LightTheme, Spacing } from '../../utils/ThemeUtil';
|
|
11
9
|
import type { IconType } from '../../utils/TypesUtil';
|
|
@@ -21,8 +19,6 @@ export interface QrCodeProps {
|
|
|
21
19
|
style?: StyleProp<ViewStyle>;
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
const LABEL_HEIGHT = 18;
|
|
25
|
-
|
|
26
22
|
export function QrCode({ size, uri, imageSrc, testID, arenaClear, icon, style }: QrCodeProps) {
|
|
27
23
|
const Theme = LightTheme;
|
|
28
24
|
const containerPadding = Spacing.l;
|
|
@@ -66,25 +62,17 @@ export function QrCode({ size, uri, imageSrc, testID, arenaClear, icon, style }:
|
|
|
66
62
|
<View
|
|
67
63
|
style={[
|
|
68
64
|
styles.container,
|
|
69
|
-
{ width: size, backgroundColor: Theme['
|
|
65
|
+
{ width: size, backgroundColor: Theme['inverse-100'], padding: containerPadding },
|
|
70
66
|
style
|
|
71
67
|
]}
|
|
72
68
|
testID={testID}
|
|
73
69
|
>
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
{logoTemplate()}
|
|
79
|
-
</FlexView>
|
|
80
|
-
<Text variant="small-500" color="fg-150" style={[styles.label, { height: LABEL_HEIGHT }]}>
|
|
81
|
-
UX by{' '}
|
|
82
|
-
<Text variant="small-500" color="inverse-000">
|
|
83
|
-
Reown
|
|
84
|
-
</Text>
|
|
85
|
-
</Text>
|
|
70
|
+
<Svg height={qrSize} width={qrSize}>
|
|
71
|
+
{dots}
|
|
72
|
+
</Svg>
|
|
73
|
+
{logoTemplate()}
|
|
86
74
|
</View>
|
|
87
75
|
) : (
|
|
88
|
-
<Shimmer width={size} height={size
|
|
76
|
+
<Shimmer width={size} height={size} borderRadius={BorderRadius.l} />
|
|
89
77
|
);
|
|
90
78
|
}
|
|
@@ -41,7 +41,7 @@ export function SearchBar({
|
|
|
41
41
|
returnKeyType="search"
|
|
42
42
|
disableFullscreenUI
|
|
43
43
|
>
|
|
44
|
-
{showClear
|
|
44
|
+
{showClear ? (
|
|
45
45
|
<InputElement
|
|
46
46
|
icon="close"
|
|
47
47
|
style={{ marginRight: Spacing['4xs'] }}
|
|
@@ -51,7 +51,7 @@ export function SearchBar({
|
|
|
51
51
|
handleChangeText('');
|
|
52
52
|
}}
|
|
53
53
|
/>
|
|
54
|
-
)}
|
|
54
|
+
) : null}
|
|
55
55
|
</InputText>
|
|
56
56
|
</FlexView>
|
|
57
57
|
);
|
|
@@ -72,14 +72,14 @@ export function Tabs({ tabs, onTabChange, style }: TabsProps) {
|
|
|
72
72
|
key={isString ? option : option.label}
|
|
73
73
|
style={[styles.tabItem, { width: tabWidth }]}
|
|
74
74
|
>
|
|
75
|
-
{!isString && option.icon
|
|
75
|
+
{!isString && option.icon ? (
|
|
76
76
|
<Icon
|
|
77
77
|
name={option.icon}
|
|
78
78
|
size="xs"
|
|
79
79
|
color={isActive ? 'fg-100' : 'fg-200'}
|
|
80
80
|
style={styles.tabIcon}
|
|
81
81
|
/>
|
|
82
|
-
)}
|
|
82
|
+
) : null}
|
|
83
83
|
<Text variant="small-600" color={isActive ? 'fg-100' : 'fg-200'}>
|
|
84
84
|
{isString ? option : option.label}
|
|
85
85
|
</Text>
|
|
@@ -74,9 +74,9 @@ export function Toggle({
|
|
|
74
74
|
) : (
|
|
75
75
|
title
|
|
76
76
|
)}
|
|
77
|
-
{canClose
|
|
77
|
+
{canClose ? (
|
|
78
78
|
<IconBox icon={isOpen ? 'chevronTop' : 'chevronBottom'} size="sm" iconColor="fg-200" />
|
|
79
|
-
)}
|
|
79
|
+
) : null}
|
|
80
80
|
</Pressable>
|
|
81
81
|
|
|
82
82
|
<Animated.View style={[styles.contentWrapper, { height: animatedHeight }]}>
|
|
@@ -28,7 +28,7 @@ export function TokenButton({
|
|
|
28
28
|
onPress,
|
|
29
29
|
style,
|
|
30
30
|
disabled = false,
|
|
31
|
-
placeholder = 'Select
|
|
31
|
+
placeholder = 'Select Token',
|
|
32
32
|
chevron,
|
|
33
33
|
renderClip,
|
|
34
34
|
testID
|
|
@@ -59,7 +59,7 @@ export function TokenButton({
|
|
|
59
59
|
source={imageUrl}
|
|
60
60
|
style={[styles.image, { backgroundColor: Theme['inverse-100'] }]}
|
|
61
61
|
/>
|
|
62
|
-
{renderClip
|
|
62
|
+
{renderClip ? <View style={styles.clipContainer}>{renderClip}</View> : null}
|
|
63
63
|
</View>
|
|
64
64
|
),
|
|
65
65
|
<Text key="text">{text}</Text>
|
|
@@ -75,7 +75,9 @@ export function TokenButton({
|
|
|
75
75
|
testID={testID}
|
|
76
76
|
>
|
|
77
77
|
{inverse ? content.reverse() : content}
|
|
78
|
-
{chevron
|
|
78
|
+
{chevron ? (
|
|
79
|
+
<Icon name="chevronBottom" size="xxs" color="fg-150" style={styles.chevron} />
|
|
80
|
+
) : null}
|
|
79
81
|
</Button>
|
|
80
82
|
);
|
|
81
83
|
}
|
|
@@ -32,13 +32,13 @@ export function TransactionVisual({ images, networkSrc, isAllNFT }: TransactionV
|
|
|
32
32
|
<Icon name={isFirstNFT ? 'nftPlaceholder' : 'coinPlaceholder'} size="sm" color="fg-200" />
|
|
33
33
|
</FlexView>
|
|
34
34
|
)}
|
|
35
|
-
{hasOneImage && firstImage?.url
|
|
35
|
+
{hasOneImage && firstImage?.url ? (
|
|
36
36
|
<Image
|
|
37
37
|
source={firstImage.url}
|
|
38
38
|
style={[styles.image, firstImage?.type === 'NFT' && styles.imageNft, { backgroundColor }]}
|
|
39
39
|
/>
|
|
40
|
-
)}
|
|
41
|
-
{hasTwoImages && firstImage?.url && secondImage?.url
|
|
40
|
+
) : null}
|
|
41
|
+
{hasTwoImages && firstImage?.url && secondImage?.url ? (
|
|
42
42
|
<FlexView flexDirection="row" padding={['0', 's', '0', '0']}>
|
|
43
43
|
<FlexView style={styles.halfContainer}>
|
|
44
44
|
<Image
|
|
@@ -58,7 +58,7 @@ export function TransactionVisual({ images, networkSrc, isAllNFT }: TransactionV
|
|
|
58
58
|
/>
|
|
59
59
|
</FlexView>
|
|
60
60
|
</FlexView>
|
|
61
|
-
)}
|
|
61
|
+
) : null}
|
|
62
62
|
<FlexView
|
|
63
63
|
alignItems="center"
|
|
64
64
|
justifyContent="center"
|
|
@@ -66,7 +66,7 @@ export function WalletImage({
|
|
|
66
66
|
return (
|
|
67
67
|
<Animated.View style={style}>
|
|
68
68
|
{templateVisual()}
|
|
69
|
-
{border
|
|
69
|
+
{border ? (
|
|
70
70
|
<View
|
|
71
71
|
style={[
|
|
72
72
|
styles.border,
|
|
@@ -79,7 +79,7 @@ export function WalletImage({
|
|
|
79
79
|
}
|
|
80
80
|
]}
|
|
81
81
|
/>
|
|
82
|
-
)}
|
|
82
|
+
) : null}
|
|
83
83
|
</Animated.View>
|
|
84
84
|
);
|
|
85
85
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { StatusBar, useWindowDimensions } from 'react-native';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Hook used to get the width of the screen and the padding needed to accomplish portrait and landscape modes.
|
|
6
|
+
* @returns { maxHeight: number, isPortrait: boolean, isLandscape: boolean, padding: number }
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
type CustomDimensionsType = {
|
|
10
|
+
maxHeight: number;
|
|
11
|
+
isPortrait: boolean;
|
|
12
|
+
isLandscape: boolean;
|
|
13
|
+
padding: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const MAX_PORTRAIT_PERCENTAGE = 0.9;
|
|
17
|
+
const MAX_LANDSCAPE_PERCENTAGE = 0.85;
|
|
18
|
+
const IOS_STATUS_BAR_HEIGHT = 20;
|
|
19
|
+
|
|
20
|
+
const getMaxHeight = (height: number, isPortrait: boolean) => {
|
|
21
|
+
const percentage = isPortrait ? MAX_PORTRAIT_PERCENTAGE : MAX_LANDSCAPE_PERCENTAGE;
|
|
22
|
+
|
|
23
|
+
return height * percentage - (StatusBar.currentHeight ?? IOS_STATUS_BAR_HEIGHT);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function useCustomDimensions(): CustomDimensionsType {
|
|
27
|
+
const { width, height } = useWindowDimensions();
|
|
28
|
+
const [isPortrait, setIsPortrait] = useState<boolean>(height > width);
|
|
29
|
+
const [maxHeight, setMaxHeight] = useState<number>(getMaxHeight(height, height > width));
|
|
30
|
+
const [padding, setPadding] = useState<number>(0);
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const _isPortrait = height > width;
|
|
34
|
+
|
|
35
|
+
setMaxHeight(getMaxHeight(height, _isPortrait));
|
|
36
|
+
setIsPortrait(_isPortrait);
|
|
37
|
+
setPadding(_isPortrait ? 0 : (width - height) / 2);
|
|
38
|
+
}, [width, height]);
|
|
39
|
+
|
|
40
|
+
return { maxHeight, isPortrait, isLandscape: !isPortrait, padding };
|
|
41
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/********** Components **********/
|
|
1
2
|
export { Card, type CardProps } from './components/wui-card';
|
|
2
3
|
export { Icon, type IconProps } from './components/wui-icon';
|
|
3
4
|
export { Image, type ImageProps } from './components/wui-image';
|
|
@@ -8,6 +9,7 @@ export { Text, type TextProps } from './components/wui-text';
|
|
|
8
9
|
export { Visual, type VisualProps } from './components/wui-visual';
|
|
9
10
|
export { Shimmer, type ShimmerProps } from './components/wui-shimmer';
|
|
10
11
|
|
|
12
|
+
/********** Composites **********/
|
|
11
13
|
export { AccountButton, type AccountButtonProps } from './composites/wui-account-button';
|
|
12
14
|
export { AccountPill, type AccountPillProps } from './composites/wui-account-pill';
|
|
13
15
|
export { ActionEntry, type ActionEntryProps } from './composites/wui-action-entry';
|
|
@@ -68,6 +70,7 @@ export { Overlay, type OverlayProps } from './layout/wui-overlay';
|
|
|
68
70
|
export { FlexView, type FlexViewProps } from './layout/wui-flex';
|
|
69
71
|
export { Separator } from './layout/wui-separator';
|
|
70
72
|
|
|
73
|
+
/********** Types **********/
|
|
71
74
|
export type {
|
|
72
75
|
ButtonType,
|
|
73
76
|
CardSelectType,
|
|
@@ -83,10 +86,14 @@ export type {
|
|
|
83
86
|
VisualType,
|
|
84
87
|
TransactionType
|
|
85
88
|
} from './utils/TypesUtil';
|
|
89
|
+
|
|
90
|
+
/********** Utils **********/
|
|
86
91
|
export { UiUtil } from './utils/UiUtil';
|
|
87
92
|
export { TransactionUtil } from './utils/TransactionUtil';
|
|
88
93
|
export { Spacing, BorderRadius } from './utils/ThemeUtil';
|
|
89
94
|
|
|
95
|
+
/********** Hooks **********/
|
|
90
96
|
export { useTheme } from './hooks/useTheme';
|
|
91
97
|
export { ThemeProvider } from './context/ThemeContext';
|
|
92
98
|
export { useAnimatedValue } from './hooks/useAnimatedValue';
|
|
99
|
+
export { useCustomDimensions } from './hooks/useCustomDimensions';
|
|
@@ -20,6 +20,9 @@ export interface FlexViewProps {
|
|
|
20
20
|
flexShrink?: FlexShrinkType;
|
|
21
21
|
alignItems?: FlexAlignType;
|
|
22
22
|
alignSelf?: FlexAlignType;
|
|
23
|
+
rowGap?: SpacingType;
|
|
24
|
+
gap?: SpacingType;
|
|
25
|
+
columnGap?: SpacingType;
|
|
23
26
|
justifyContent?: FlexJustifyContentType;
|
|
24
27
|
padding?: SpacingType | SpacingType[];
|
|
25
28
|
margin?: SpacingType | SpacingType[];
|
|
@@ -36,6 +39,9 @@ export function FlexView(props: FlexViewProps) {
|
|
|
36
39
|
alignItems: props.alignItems,
|
|
37
40
|
alignSelf: props.alignSelf,
|
|
38
41
|
justifyContent: props.justifyContent,
|
|
42
|
+
rowGap: props.rowGap && UiUtil.getSpacingStyles(props.rowGap),
|
|
43
|
+
gap: props.gap && UiUtil.getSpacingStyles(props.gap),
|
|
44
|
+
columnGap: props.columnGap && UiUtil.getSpacingStyles(props.columnGap),
|
|
39
45
|
paddingTop: props.padding && UiUtil.getSpacingStyles(props.padding, 0),
|
|
40
46
|
paddingRight: props.padding && UiUtil.getSpacingStyles(props.padding, 1),
|
|
41
47
|
paddingBottom: props.padding && UiUtil.getSpacingStyles(props.padding, 2),
|
package/src/utils/QRCodeUtil.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { Line, Rect, Circle } from 'react-native-svg';
|
|
3
3
|
import QRCode from 'qrcode';
|
|
4
|
-
import {
|
|
4
|
+
import { LightTheme } from '../utils/ThemeUtil';
|
|
5
5
|
|
|
6
6
|
type CoordinateMapping = [number, number[]];
|
|
7
7
|
|
|
@@ -34,8 +34,8 @@ function getMatrix(value: string, errorCorrectionLevel: QRCode.QRCodeErrorCorrec
|
|
|
34
34
|
|
|
35
35
|
export const QRCodeUtil = {
|
|
36
36
|
generate(uri: string, size: number, logoSize: number) {
|
|
37
|
-
const dotColor =
|
|
38
|
-
const edgeColor = LightTheme['
|
|
37
|
+
const dotColor = LightTheme['inverse-000'];
|
|
38
|
+
const edgeColor = LightTheme['inverse-100'];
|
|
39
39
|
const dots: ReactNode[] = [];
|
|
40
40
|
const matrix = getMatrix(uri, 'Q');
|
|
41
41
|
const cellSize = size / matrix.length;
|
package/src/utils/TypesUtil.ts
CHANGED
package/src/utils/UiUtil.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { Spacing } from './ThemeUtil';
|
|
|
4
4
|
import type { SpacingType, TruncateOptions } from './TypesUtil';
|
|
5
5
|
|
|
6
6
|
export const UiUtil = {
|
|
7
|
-
getSpacingStyles(spacing: SpacingType | SpacingType[], index
|
|
8
|
-
if (Array.isArray(spacing)) {
|
|
7
|
+
getSpacingStyles(spacing: SpacingType | SpacingType[], index?: number) {
|
|
8
|
+
if (Array.isArray(spacing) && index !== undefined) {
|
|
9
9
|
return spacing[index] ? Spacing[spacing[index] as SpacingType] : undefined;
|
|
10
10
|
} else if (typeof spacing === 'string') {
|
|
11
11
|
return Spacing[spacing];
|