@oxy.so/services 1.0.0 → 1.0.2
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/README.md +0 -1
- package/lib/commonjs/index.js +11 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/client.js +7 -0
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/OxyPayButton.js +8 -60
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
- package/lib/commonjs/ui/components/PeableButton.js +66 -0
- package/lib/commonjs/ui/components/PeableButton.js.map +1 -0
- package/lib/commonjs/ui/components/ProfileButton.js +9 -8
- package/lib/commonjs/ui/components/ProfileButton.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +10 -10
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +1 -1
- package/lib/commonjs/ui/components/payment/constants.js +2 -2
- package/lib/commonjs/ui/components/payment/constants.js.map +1 -1
- package/lib/commonjs/ui/components/payment/paymentStyles.js +9 -9
- package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/commonjs/ui/index.js +7 -0
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/server.js +4 -2
- package/lib/commonjs/ui/server.js.map +1 -1
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/client.js +3 -0
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/OxyPayButton.js +5 -56
- package/lib/module/ui/components/OxyPayButton.js.map +1 -1
- package/lib/module/ui/components/PeableButton.js +62 -0
- package/lib/module/ui/components/PeableButton.js.map +1 -0
- package/lib/module/ui/components/ProfileButton.js +9 -8
- package/lib/module/ui/components/ProfileButton.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +10 -10
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentReviewStep.js +1 -1
- package/lib/module/ui/components/payment/constants.js +2 -2
- package/lib/module/ui/components/payment/constants.js.map +1 -1
- package/lib/module/ui/components/payment/paymentStyles.js +9 -9
- package/lib/module/ui/components/payment/paymentStyles.js.map +1 -1
- package/lib/module/ui/index.js +4 -0
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/server.js +3 -1
- package/lib/module/ui/server.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +5 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +5 -0
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyPayButton.d.ts +6 -26
- package/lib/typescript/commonjs/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/PeableButton.d.ts +29 -0
- package/lib/typescript/commonjs/ui/components/PeableButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/payment/paymentStyles.d.ts +8 -8
- package/lib/typescript/commonjs/ui/index.d.ts +5 -0
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/server.d.ts +2 -0
- package/lib/typescript/commonjs/ui/server.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +5 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +5 -0
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyPayButton.d.ts +6 -26
- package/lib/typescript/module/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/PeableButton.d.ts +29 -0
- package/lib/typescript/module/ui/components/PeableButton.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ProfileButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/payment/paymentStyles.d.ts +8 -8
- package/lib/typescript/module/ui/index.d.ts +5 -0
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/server.d.ts +2 -0
- package/lib/typescript/module/ui/server.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +5 -0
- package/src/ui/client.ts +5 -0
- package/src/ui/components/OxyPayButton.tsx +6 -71
- package/src/ui/components/PeableButton.tsx +74 -0
- package/src/ui/components/ProfileButton.tsx +8 -10
- package/src/ui/components/payment/PaymentDetailsStep.tsx +9 -9
- package/src/ui/components/payment/PaymentReviewStep.tsx +1 -1
- package/src/ui/components/payment/constants.ts +1 -1
- package/src/ui/components/payment/paymentStyles.ts +9 -9
- package/src/ui/index.ts +5 -0
- package/src/ui/server.ts +3 -1
|
@@ -20,7 +20,12 @@ export { LogoText } from './components/logo/LogoText.js';
|
|
|
20
20
|
export { RequireOxyAuth } from './components/RequireOxyAuth.js';
|
|
21
21
|
export type { RequireOxyAuthProps, RequireOxyAuthPrompt } from './components/RequireOxyAuth.js';
|
|
22
22
|
export { default as FollowButton } from './components/FollowButton.js';
|
|
23
|
+
export { default as PeableButton } from './components/PeableButton.js';
|
|
24
|
+
export type { PeableButtonProps } from './components/PeableButton.js';
|
|
25
|
+
/** @deprecated Use `PeableButton` instead. */
|
|
23
26
|
export { default as OxyPayButton } from './components/OxyPayButton.js';
|
|
27
|
+
/** @deprecated Use `PeableButtonProps` instead. */
|
|
28
|
+
export type { OxyPayButtonProps } from './components/OxyPayButton.js';
|
|
24
29
|
export { default as ProfileButton } from './components/ProfileButton.js';
|
|
25
30
|
export { useOxy, useOptionalOxy, OxyProviderMissingError } from './context/OxyContext.js';
|
|
26
31
|
export { useAuth } from './hooks/useAuth.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,EAAE,OAAO,IAAI,WA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rE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAoB,CAAC;AAChD,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAoB,CAAC;AAM9E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAoB,CAAC;AAGlD,OAAO,EACH,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACtB,MAAM,0BAAuB,CAAC;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAAuB,CAAC"}
|
|
@@ -12,6 +12,8 @@ export declare const OxySignInButton: () => null;
|
|
|
12
12
|
export declare const LogoIcon: () => null;
|
|
13
13
|
export declare const LogoText: () => null;
|
|
14
14
|
export declare const FollowButton: () => null;
|
|
15
|
+
export declare const PeableButton: () => null;
|
|
16
|
+
/** @deprecated Use `PeableButton` instead. */
|
|
15
17
|
export declare const OxyPayButton: () => null;
|
|
16
18
|
export declare const useOxy: () => {};
|
|
17
19
|
export declare const useAuth: () => {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/ui/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,eAAO,MAAM,WAAW,YAAgB,CAAC;AACzC,eAAO,MAAM,eAAe,YAAgB,CAAC;AAC7C,eAAO,MAAM,QAAQ,YAAgB,CAAC;AACtC,eAAO,MAAM,QAAQ,YAAgB,CAAC;AACtC,eAAO,MAAM,YAAY,YAAgB,CAAC;AAC1C,eAAO,MAAM,YAAY,YAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/ui/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,eAAO,MAAM,WAAW,YAAgB,CAAC;AACzC,eAAO,MAAM,eAAe,YAAgB,CAAC;AAC7C,eAAO,MAAM,QAAQ,YAAgB,CAAC;AACtC,eAAO,MAAM,QAAQ,YAAgB,CAAC;AACtC,eAAO,MAAM,YAAY,YAAgB,CAAC;AAC1C,eAAO,MAAM,YAAY,YAAgB,CAAC;AAC1C,8CAA8C;AAC9C,eAAO,MAAM,YAAY,YAAe,CAAC;AAGzC,eAAO,MAAM,MAAM,UAAW,CAAC;AAG/B,eAAO,MAAM,OAAO,UAAW,CAAC;AAChC,eAAO,MAAM,SAAS,UAAW,CAAC;AAClC,eAAO,MAAM,UAAU;;;CAA0B,CAAC;AAGlD,eAAO,MAAM,aAAa,YAAgB,CAAC;AAG3C,eAAO,MAAM,YAAY,UAAW,CAAC;AAGrC,eAAO,MAAM,KAAK;;;;;;;CAUjB,CAAC;AAGF,OAAO,EACH,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACtB,MAAM,0BAAuB,CAAC;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/services",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "OxyHQ Expo/React Native SDK — UI components, screens, and native features",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"@commitlint/cli": "^21.2.1",
|
|
164
164
|
"@commitlint/config-conventional": "^21.2.0",
|
|
165
165
|
"@expo/vector-icons": "^15.0.3",
|
|
166
|
-
"@oxy.so/core": "1.0.
|
|
166
|
+
"@oxy.so/core": "1.0.1",
|
|
167
167
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
168
168
|
"@react-native-community/netinfo": "^12.0.1",
|
|
169
169
|
"@react-native/babel-preset": "^0.86.2",
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
"peerDependencies": {
|
|
216
216
|
"@expo/vector-icons": "^15.0.3",
|
|
217
217
|
"@oxy.so/bloom": "^1.0.0",
|
|
218
|
-
"@oxy.so/core": "1.0.
|
|
218
|
+
"@oxy.so/core": "^1.0.1",
|
|
219
219
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
220
220
|
"@react-native-community/netinfo": ">=11.4.1",
|
|
221
221
|
"@tanstack/query-async-storage-persister": "^5.101",
|
package/src/index.ts
CHANGED
|
@@ -342,7 +342,12 @@ export {
|
|
|
342
342
|
followRecordToStatus,
|
|
343
343
|
followRecordsToStatusMap,
|
|
344
344
|
} from './ui/stores/followTargetStore';
|
|
345
|
+
export { default as PeableButton } from './ui/components/PeableButton';
|
|
346
|
+
export type { PeableButtonProps } from './ui/components/PeableButton';
|
|
347
|
+
/** @deprecated Use `PeableButton` instead. */
|
|
345
348
|
export { default as OxyPayButton } from './ui/components/OxyPayButton';
|
|
349
|
+
/** @deprecated Use `PeableButtonProps` instead. */
|
|
350
|
+
export type { OxyPayButtonProps } from './ui/components/OxyPayButton';
|
|
346
351
|
export { LogoIcon } from './ui/components/logo/LogoIcon';
|
|
347
352
|
export { LogoText } from './ui/components/logo/LogoText';
|
|
348
353
|
|
package/src/ui/client.ts
CHANGED
|
@@ -16,7 +16,12 @@ export type { OxyAuthPromptProps } from './components/OxyAuthPrompt';
|
|
|
16
16
|
export { LogoIcon } from './components/logo/LogoIcon';
|
|
17
17
|
export { LogoText } from './components/logo/LogoText';
|
|
18
18
|
export { default as FollowButton } from './components/FollowButton';
|
|
19
|
+
export { default as PeableButton } from './components/PeableButton';
|
|
20
|
+
export type { PeableButtonProps } from './components/PeableButton';
|
|
21
|
+
/** @deprecated Use `PeableButton` instead. */
|
|
19
22
|
export { default as OxyPayButton } from './components/OxyPayButton';
|
|
23
|
+
/** @deprecated Use `PeableButtonProps` instead. */
|
|
24
|
+
export type { OxyPayButtonProps } from './components/OxyPayButton';
|
|
20
25
|
|
|
21
26
|
// Context
|
|
22
27
|
export { useOxy, useOptionalOxy, OxyProviderMissingError } from './context/OxyContext';
|
|
@@ -1,74 +1,9 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
import type { ViewStyle, TextStyle, StyleProp } from 'react-native';
|
|
3
|
-
import { useTheme } from '@oxy.so/bloom/theme';
|
|
4
|
-
import { Button } from '@oxy.so/bloom/button';
|
|
5
|
-
import type { PaymentItem, PaymentGatewayResult } from '../screens/PaymentGatewayScreen';
|
|
6
|
-
import { LogoIcon } from './logo/LogoIcon';
|
|
7
|
-
|
|
8
|
-
export interface OxyPayButtonProps {
|
|
9
|
-
style?: StyleProp<ViewStyle>;
|
|
10
|
-
textStyle?: StyleProp<TextStyle>;
|
|
11
|
-
text?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
amount: number | string;
|
|
14
|
-
currency?: string;
|
|
15
|
-
paymentItems?: PaymentItem[];
|
|
16
|
-
description?: string;
|
|
17
|
-
onPaymentResult?: (result: PaymentGatewayResult) => void;
|
|
18
|
-
/**
|
|
19
|
-
* Button background color. If not provided, uses variant ('white' or 'black').
|
|
20
|
-
*/
|
|
21
|
-
color?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Button color variant: 'white' (default) or 'black'. Ignored if color is set.
|
|
24
|
-
*/
|
|
25
|
-
variant?: 'white' | 'black';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
1
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
2
|
+
* @deprecated Use `PeableButton` from `@oxy.so/services` or
|
|
3
|
+
* `@oxy.so/services/ui` instead. This compatibility export preserves the
|
|
4
|
+
* pre-Peable public component name for existing consumers.
|
|
31
5
|
*/
|
|
32
|
-
|
|
33
|
-
style,
|
|
34
|
-
textStyle,
|
|
35
|
-
text = 'Pay',
|
|
36
|
-
disabled = false,
|
|
37
|
-
color,
|
|
38
|
-
variant = 'white',
|
|
39
|
-
}) => {
|
|
40
|
-
const theme = useTheme();
|
|
41
|
-
const handlePress = () => {
|
|
42
|
-
console.warn('OxyPayButton: The bottom sheet payment flow has been removed. Provide a custom onPress handler.');
|
|
43
|
-
};
|
|
44
|
-
// Determine background and text color
|
|
45
|
-
const backgroundColor = color || (variant === 'black' ? theme.colors.text : theme.colors.background);
|
|
46
|
-
const textColor = variant === 'black' || (color && isColorDark(color)) ? theme.colors.background : '#1b1f0a';
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<Button
|
|
50
|
-
variant="inverse"
|
|
51
|
-
onPress={handlePress}
|
|
52
|
-
disabled={disabled}
|
|
53
|
-
style={[{ backgroundColor, borderColor: textColor, borderWidth: 1 }, style]}
|
|
54
|
-
textStyle={[{ color: textColor, fontWeight: '700' }, textStyle]}
|
|
55
|
-
icon={<LogoIcon height={16} color={textColor} style={{ marginRight: 6 }} />}
|
|
56
|
-
>
|
|
57
|
-
{text}
|
|
58
|
-
</Button>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
// Helper to determine if a color is dark (simple luminance check)
|
|
63
|
-
function isColorDark(hex: string) {
|
|
64
|
-
let c = hex.replace('#', '');
|
|
65
|
-
if (c.length === 3) c = c.split('').map(x => x + x).join('');
|
|
66
|
-
if (c.length !== 6) return false;
|
|
67
|
-
const r = Number.parseInt(c.substr(0, 2), 16);
|
|
68
|
-
const g = Number.parseInt(c.substr(2, 2), 16);
|
|
69
|
-
const b = Number.parseInt(c.substr(4, 2), 16);
|
|
70
|
-
// Perceived luminance
|
|
71
|
-
return (0.299 * r + 0.587 * g + 0.114 * b) < 150;
|
|
72
|
-
}
|
|
6
|
+
export { default } from './PeableButton';
|
|
73
7
|
|
|
74
|
-
|
|
8
|
+
/** @deprecated Use `PeableButtonProps` instead. */
|
|
9
|
+
export type { PeableButtonProps as OxyPayButtonProps } from './PeableButton';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ViewStyle, TextStyle, StyleProp } from 'react-native';
|
|
3
|
+
import { useTheme } from '@oxy.so/bloom/theme';
|
|
4
|
+
import { Button } from '@oxy.so/bloom/button';
|
|
5
|
+
import type { PaymentItem, PaymentGatewayResult } from '../screens/PaymentGatewayScreen';
|
|
6
|
+
import { LogoIcon } from './logo/LogoIcon';
|
|
7
|
+
|
|
8
|
+
export interface PeableButtonProps {
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
textStyle?: StyleProp<TextStyle>;
|
|
11
|
+
text?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
amount: number | string;
|
|
14
|
+
currency?: string;
|
|
15
|
+
paymentItems?: PaymentItem[];
|
|
16
|
+
description?: string;
|
|
17
|
+
onPaymentResult?: (result: PaymentGatewayResult) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Button background color. If not provided, uses variant ('white' or 'black').
|
|
20
|
+
*/
|
|
21
|
+
color?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Button color variant: 'white' (default) or 'black'. Ignored if color is set.
|
|
24
|
+
*/
|
|
25
|
+
variant?: 'white' | 'black';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A pre-styled button for Peable payments that opens the Payment Gateway
|
|
30
|
+
* - Only black or white by default, but can be customized with the color prop.
|
|
31
|
+
*/
|
|
32
|
+
const PeableButton: React.FC<PeableButtonProps> = ({
|
|
33
|
+
style,
|
|
34
|
+
textStyle,
|
|
35
|
+
text = 'Pay',
|
|
36
|
+
disabled = false,
|
|
37
|
+
color,
|
|
38
|
+
variant = 'white',
|
|
39
|
+
}) => {
|
|
40
|
+
const theme = useTheme();
|
|
41
|
+
const handlePress = () => {
|
|
42
|
+
console.warn('PeableButton: The bottom sheet payment flow has been removed. Provide a custom onPress handler.');
|
|
43
|
+
};
|
|
44
|
+
// Determine background and text color
|
|
45
|
+
const backgroundColor = color || (variant === 'black' ? theme.colors.text : theme.colors.background);
|
|
46
|
+
const textColor = variant === 'black' || (color && isColorDark(color)) ? theme.colors.background : '#1b1f0a';
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Button
|
|
50
|
+
variant="inverse"
|
|
51
|
+
onPress={handlePress}
|
|
52
|
+
disabled={disabled}
|
|
53
|
+
style={[{ backgroundColor, borderColor: textColor, borderWidth: 1 }, style]}
|
|
54
|
+
textStyle={[{ color: textColor, fontWeight: '700' }, textStyle]}
|
|
55
|
+
icon={<LogoIcon height={16} color={textColor} style={{ marginRight: 6 }} />}
|
|
56
|
+
>
|
|
57
|
+
{text}
|
|
58
|
+
</Button>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// Helper to determine if a color is dark (simple luminance check)
|
|
63
|
+
function isColorDark(hex: string) {
|
|
64
|
+
let c = hex.replace('#', '');
|
|
65
|
+
if (c.length === 3) c = c.split('').map(x => x + x).join('');
|
|
66
|
+
if (c.length !== 6) return false;
|
|
67
|
+
const r = Number.parseInt(c.substr(0, 2), 16);
|
|
68
|
+
const g = Number.parseInt(c.substr(2, 2), 16);
|
|
69
|
+
const b = Number.parseInt(c.substr(4, 2), 16);
|
|
70
|
+
// Perceived luminance
|
|
71
|
+
return (0.299 * r + 0.587 * g + 0.114 * b) < 150;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default PeableButton;
|
|
@@ -266,10 +266,13 @@ const ProfileButton: React.FC<ProfileButtonProps> = ({
|
|
|
266
266
|
|
|
267
267
|
// ── Expanded row animation ──────────────────────────────────────────────
|
|
268
268
|
// On native everything is statically visible (no hover exists). On web we
|
|
269
|
-
// reproduce Bluesky's reveal: the row fills with a subtle contrast bg
|
|
270
|
-
// avatar shrinks + slides left
|
|
271
|
-
//
|
|
272
|
-
//
|
|
269
|
+
// reproduce Bluesky's reveal: the row fills with a subtle contrast bg and
|
|
270
|
+
// the avatar shrinks + slides left. Bluesky also tucks the identity block
|
|
271
|
+
// under the avatar with a negative margin, because there the name is
|
|
272
|
+
// revealed only on hover and slides out from behind the shrinking avatar.
|
|
273
|
+
// Here the identity is ALWAYS visible in the expanded row, so that tuck
|
|
274
|
+
// was a permanent overlap: at the default 40px avatar the name started 8px
|
|
275
|
+
// under it (OxyHQ/Alia#546). The row's own gap is the whole spacing now.
|
|
273
276
|
const reducedMotion = isWeb && prefersReducedMotion();
|
|
274
277
|
|
|
275
278
|
// Slide the shrunk avatar left so its visual left edge stays put as it
|
|
@@ -306,11 +309,6 @@ const ProfileButton: React.FC<ProfileButtonProps> = ({
|
|
|
306
309
|
|
|
307
310
|
// Expanded mode always shows identity + chevron (console/inbox wide sidebar).
|
|
308
311
|
// Hover only animates the row background and avatar shrink — not text visibility.
|
|
309
|
-
const identityStyle: ViewStyle | undefined = isWeb
|
|
310
|
-
? {
|
|
311
|
-
marginLeft: -resolvedAvatarSize / 2,
|
|
312
|
-
}
|
|
313
|
-
: undefined;
|
|
314
312
|
|
|
315
313
|
return (
|
|
316
314
|
<View className={className} style={[styles.fullWidth, style]}>
|
|
@@ -322,7 +320,7 @@ const ProfileButton: React.FC<ProfileButtonProps> = ({
|
|
|
322
320
|
{...webInteractionProps}
|
|
323
321
|
>
|
|
324
322
|
<View style={avatarWrapperStyle}>{avatarNode}</View>
|
|
325
|
-
<View style={
|
|
323
|
+
<View style={styles.identity}>
|
|
326
324
|
<Text
|
|
327
325
|
style={[styles.displayName, { color: colors.text }]}
|
|
328
326
|
numberOfLines={1}
|
|
@@ -71,7 +71,7 @@ const PaymentDetailsStep: React.FC<PaymentDetailsStepProps> = ({
|
|
|
71
71
|
<View style={styles.section}>
|
|
72
72
|
<Text style={styles.sectionTitle}>
|
|
73
73
|
{paymentMethod === 'card' ? t('payment.details.cardDetails') :
|
|
74
|
-
paymentMethod === 'oxy' ? t('payment.details.
|
|
74
|
+
paymentMethod === 'oxy' ? t('payment.details.peable') :
|
|
75
75
|
paymentMethod === 'faircoin' ? t('payment.details.faircoinPayment') : t('payment.details.paymentDetails')}
|
|
76
76
|
</Text>
|
|
77
77
|
|
|
@@ -149,16 +149,16 @@ const PaymentDetailsStep: React.FC<PaymentDetailsStepProps> = ({
|
|
|
149
149
|
)}
|
|
150
150
|
|
|
151
151
|
{paymentMethod === 'oxy' && (
|
|
152
|
-
<View style={styles.
|
|
153
|
-
<View style={styles.
|
|
154
|
-
<Ionicons name="wallet-outline" size={64} color={colors.primary} style={styles.
|
|
155
|
-
<Text style={styles.
|
|
156
|
-
<Text style={styles.
|
|
157
|
-
<View style={styles.
|
|
158
|
-
<Text style={styles.
|
|
152
|
+
<View style={styles.peableCard}>
|
|
153
|
+
<View style={styles.peableContent}>
|
|
154
|
+
<Ionicons name="wallet-outline" size={64} color={colors.primary} style={styles.peableIcon} />
|
|
155
|
+
<Text style={styles.peableMainTitle}>{t('payment.details.peable')}</Text>
|
|
156
|
+
<Text style={styles.peableSubtitle}>{t('payment.details.payWithWallet')}</Text>
|
|
157
|
+
<View style={styles.peableBalanceBox}>
|
|
158
|
+
<Text style={styles.peableBalanceText}>{t('payment.details.balance', { balance: '⊜ 123.45' })}</Text>
|
|
159
159
|
</View>
|
|
160
160
|
<View style={{ height: 18 }} />
|
|
161
|
-
<Text style={styles.
|
|
161
|
+
<Text style={styles.peableWaiting}>{t('payment.details.readyToProcess')}</Text>
|
|
162
162
|
</View>
|
|
163
163
|
</View>
|
|
164
164
|
)}
|
|
@@ -87,7 +87,7 @@ const PaymentReviewStep: React.FC<PaymentReviewStepProps> = ({
|
|
|
87
87
|
{paymentMethod === 'oxy' ? (
|
|
88
88
|
<SettingsListItem
|
|
89
89
|
icon={<Ionicons name="wallet-outline" size={20} color={colors.primary} />}
|
|
90
|
-
title={t('payment.review.
|
|
90
|
+
title={t('payment.review.peableAccount')}
|
|
91
91
|
description={t('payment.details.balance', { balance: '⊜ 123.45' })}
|
|
92
92
|
showChevron={false}
|
|
93
93
|
/>
|
|
@@ -2,7 +2,7 @@ import type { PaymentMethod } from './types';
|
|
|
2
2
|
|
|
3
3
|
export const PAYMENT_METHODS: PaymentMethod[] = [
|
|
4
4
|
{ key: 'card', label: 'Credit/Debit Card', icon: 'card-outline', description: 'Pay securely with your credit or debit card.' },
|
|
5
|
-
{ key: 'oxy', label: '
|
|
5
|
+
{ key: 'oxy', label: 'Peable', icon: 'wallet-outline', description: 'Use your Peable in-app balance.' },
|
|
6
6
|
{ key: 'faircoin', label: 'FAIRWallet', icon: 'qr-code-outline', description: 'Pay with FairCoin by scanning a QR code.' },
|
|
7
7
|
];
|
|
8
8
|
|
|
@@ -193,8 +193,8 @@ export const createPaymentStyles = (colors: PaymentColors) => StyleSheet.create(
|
|
|
193
193
|
flex: 1,
|
|
194
194
|
marginLeft: 6,
|
|
195
195
|
},
|
|
196
|
-
//
|
|
197
|
-
|
|
196
|
+
// Peable styles
|
|
197
|
+
peableCard: {
|
|
198
198
|
backgroundColor: colors.card ?? colors.background ?? '#fff',
|
|
199
199
|
borderRadius: 16,
|
|
200
200
|
padding: 24,
|
|
@@ -202,14 +202,14 @@ export const createPaymentStyles = (colors: PaymentColors) => StyleSheet.create(
|
|
|
202
202
|
alignItems: 'center',
|
|
203
203
|
width: '100%',
|
|
204
204
|
},
|
|
205
|
-
|
|
205
|
+
peableContent: {
|
|
206
206
|
alignItems: 'center',
|
|
207
207
|
width: '100%',
|
|
208
208
|
},
|
|
209
|
-
|
|
209
|
+
peableIcon: {
|
|
210
210
|
marginBottom: 8,
|
|
211
211
|
},
|
|
212
|
-
|
|
212
|
+
peableMainTitle: {
|
|
213
213
|
fontWeight: 'bold',
|
|
214
214
|
fontSize: 28,
|
|
215
215
|
color: colors.text,
|
|
@@ -217,23 +217,23 @@ export const createPaymentStyles = (colors: PaymentColors) => StyleSheet.create(
|
|
|
217
217
|
textAlign: 'center',
|
|
218
218
|
letterSpacing: 0.5,
|
|
219
219
|
},
|
|
220
|
-
|
|
220
|
+
peableSubtitle: {
|
|
221
221
|
fontSize: 16,
|
|
222
222
|
color: colors.textSecondary,
|
|
223
223
|
textAlign: 'center',
|
|
224
224
|
marginBottom: 8,
|
|
225
225
|
},
|
|
226
|
-
|
|
226
|
+
peableBalanceBox: {
|
|
227
227
|
backgroundColor: `${colors.primary}22`,
|
|
228
228
|
borderRadius: 12,
|
|
229
229
|
padding: 8,
|
|
230
230
|
marginTop: 8,
|
|
231
231
|
},
|
|
232
|
-
|
|
232
|
+
peableBalanceText: {
|
|
233
233
|
color: colors.primary,
|
|
234
234
|
fontWeight: '600',
|
|
235
235
|
},
|
|
236
|
-
|
|
236
|
+
peableWaiting: {
|
|
237
237
|
fontSize: 14,
|
|
238
238
|
color: colors.textSecondary,
|
|
239
239
|
textAlign: 'center',
|
package/src/ui/index.ts
CHANGED
|
@@ -25,7 +25,12 @@ export { LogoText } from './components/logo/LogoText';
|
|
|
25
25
|
export { RequireOxyAuth } from './components/RequireOxyAuth';
|
|
26
26
|
export type { RequireOxyAuthProps, RequireOxyAuthPrompt } from './components/RequireOxyAuth';
|
|
27
27
|
export { default as FollowButton } from './components/FollowButton';
|
|
28
|
+
export { default as PeableButton } from './components/PeableButton';
|
|
29
|
+
export type { PeableButtonProps } from './components/PeableButton';
|
|
30
|
+
/** @deprecated Use `PeableButton` instead. */
|
|
28
31
|
export { default as OxyPayButton } from './components/OxyPayButton';
|
|
32
|
+
/** @deprecated Use `PeableButtonProps` instead. */
|
|
33
|
+
export type { OxyPayButtonProps } from './components/OxyPayButton';
|
|
29
34
|
export { default as ProfileButton } from './components/ProfileButton';
|
|
30
35
|
|
|
31
36
|
// Context + hooks
|
package/src/ui/server.ts
CHANGED
|
@@ -19,7 +19,9 @@ export const OxySignInButton = noopComponent;
|
|
|
19
19
|
export const LogoIcon = noopComponent;
|
|
20
20
|
export const LogoText = noopComponent;
|
|
21
21
|
export const FollowButton = noopComponent;
|
|
22
|
-
export const
|
|
22
|
+
export const PeableButton = noopComponent;
|
|
23
|
+
/** @deprecated Use `PeableButton` instead. */
|
|
24
|
+
export const OxyPayButton = PeableButton;
|
|
23
25
|
|
|
24
26
|
// Context
|
|
25
27
|
export const useOxy = noopHook;
|