@oxy.so/services 12.5.0 → 12.7.0
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/index.js.map +1 -1
- package/lib/commonjs/ui/client.js +13 -0
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +27 -14
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/FollowTargetButton.js +39 -51
- package/lib/commonjs/ui/components/FollowTargetButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxyConsentScreen.js.map +1 -1
- package/lib/commonjs/ui/components/authChooser/types.js.map +1 -1
- package/lib/commonjs/ui/components/followButtonAccessibility.js +24 -7
- package/lib/commonjs/ui/components/followButtonAccessibility.js.map +1 -1
- package/lib/commonjs/ui/components/followLabels.js +38 -0
- package/lib/commonjs/ui/components/followLabels.js.map +1 -0
- package/lib/commonjs/ui/components/followRules.js +29 -13
- package/lib/commonjs/ui/components/followRules.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAccountColor.js +56 -0
- package/lib/commonjs/ui/hooks/useAccountColor.js.map +1 -0
- package/lib/commonjs/ui/hooks/useI18n.js +2 -0
- package/lib/commonjs/ui/hooks/useI18n.js.map +1 -1
- package/lib/commonjs/ui/utils/deviceSessionTitle.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/client.js +1 -0
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +28 -15
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/FollowTargetButton.js +39 -51
- package/lib/module/ui/components/FollowTargetButton.js.map +1 -1
- package/lib/module/ui/components/OxyConsentScreen.js.map +1 -1
- package/lib/module/ui/components/authChooser/types.js.map +1 -1
- package/lib/module/ui/components/followButtonAccessibility.js +24 -7
- package/lib/module/ui/components/followButtonAccessibility.js.map +1 -1
- package/lib/module/ui/components/followLabels.js +35 -0
- package/lib/module/ui/components/followLabels.js.map +1 -0
- package/lib/module/ui/components/followRules.js +30 -13
- package/lib/module/ui/components/followRules.js.map +1 -1
- package/lib/module/ui/hooks/useAccountColor.js +51 -0
- package/lib/module/ui/hooks/useAccountColor.js.map +1 -0
- package/lib/module/ui/hooks/useI18n.js +2 -0
- package/lib/module/ui/hooks/useI18n.js.map +1 -1
- package/lib/module/ui/utils/deviceSessionTitle.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +4 -1
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FollowButton.d.ts +13 -0
- package/lib/typescript/commonjs/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FollowTargetButton.d.ts +6 -18
- package/lib/typescript/commonjs/ui/components/FollowTargetButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +1 -2
- package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/followButtonAccessibility.d.ts +12 -2
- package/lib/typescript/commonjs/ui/components/followButtonAccessibility.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/followLabels.d.ts +28 -0
- package/lib/typescript/commonjs/ui/components/followLabels.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/followRules.d.ts +20 -9
- package/lib/typescript/commonjs/ui/components/followRules.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAccountColor.d.ts +25 -0
- package/lib/typescript/commonjs/ui/hooks/useAccountColor.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useI18n.d.ts +3 -1
- package/lib/typescript/commonjs/ui/hooks/useI18n.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/deviceSessionTitle.d.ts +1 -2
- package/lib/typescript/commonjs/ui/utils/deviceSessionTitle.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +4 -1
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FollowButton.d.ts +13 -0
- package/lib/typescript/module/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FollowTargetButton.d.ts +6 -18
- package/lib/typescript/module/ui/components/FollowTargetButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/authChooser/types.d.ts +1 -2
- package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/followButtonAccessibility.d.ts +12 -2
- package/lib/typescript/module/ui/components/followButtonAccessibility.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/followLabels.d.ts +28 -0
- package/lib/typescript/module/ui/components/followLabels.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/followRules.d.ts +20 -9
- package/lib/typescript/module/ui/components/followRules.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAccountColor.d.ts +25 -0
- package/lib/typescript/module/ui/hooks/useAccountColor.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useI18n.d.ts +3 -1
- package/lib/typescript/module/ui/hooks/useI18n.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/deviceSessionTitle.d.ts +1 -2
- package/lib/typescript/module/ui/utils/deviceSessionTitle.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/index.ts +2 -5
- package/src/ui/client.ts +8 -5
- package/src/ui/components/FollowButton.tsx +53 -23
- package/src/ui/components/FollowTargetButton.tsx +39 -52
- package/src/ui/components/OxyConsentScreen.tsx +1 -3
- package/src/ui/components/__tests__/followButtonAccessibility.test.tsx +32 -6
- package/src/ui/components/__tests__/followTargetButton.test.ts +7 -1
- package/src/ui/components/authChooser/types.ts +1 -2
- package/src/ui/components/followButtonAccessibility.ts +38 -25
- package/src/ui/components/followLabels.ts +48 -0
- package/src/ui/components/followRules.ts +29 -13
- package/src/ui/hooks/useAccountColor.ts +52 -0
- package/src/ui/hooks/useI18n.ts +5 -3
- package/src/ui/utils/deviceSessionTitle.ts +1 -2
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
* small vocabulary of defaults and a full override, rather than a lookup keyed
|
|
23
23
|
* on kind — a kind→verb table in this package would need a release every time
|
|
24
24
|
* an application invents a kind, which is exactly the coupling #809 removes.
|
|
25
|
+
* The vocabulary and its translated words live in `followLabels`, shared with
|
|
26
|
+
* `FollowButton`.
|
|
25
27
|
*
|
|
26
28
|
* ## Relationship to the legacy `FollowButton`
|
|
27
29
|
*
|
|
@@ -33,27 +35,12 @@
|
|
|
33
35
|
import type { FollowStatus } from '@oxy.so/contracts';
|
|
34
36
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
35
37
|
import { type FollowDuration } from './followRules.js';
|
|
36
|
-
|
|
37
|
-
* The small vocabulary of verbs the ecosystem actually uses. An application
|
|
38
|
-
* whose verb is not here passes `labels` instead — the escape hatch exists so
|
|
39
|
-
* this union never has to grow to accommodate one product's wording.
|
|
40
|
-
*/
|
|
41
|
-
export type FollowVerb = 'follow' | 'subscribe' | 'join' | 'watch';
|
|
42
|
-
export interface FollowLabels {
|
|
43
|
-
/** Not following yet. */
|
|
44
|
-
idle: string;
|
|
45
|
-
/** Following, and this application acts on it. */
|
|
46
|
-
active: string;
|
|
47
|
-
/** Asked, waiting for the other side to accept. */
|
|
48
|
-
pending: string;
|
|
49
|
-
/** Following globally, but switched off in this application. */
|
|
50
|
-
disabled: string;
|
|
51
|
-
}
|
|
38
|
+
import { type FollowLabels, type FollowVerb } from './followLabels.js';
|
|
52
39
|
export interface FollowTargetButtonProps {
|
|
53
40
|
/** The registered target's id. Registration is separate — see the SDK. */
|
|
54
41
|
targetId: string;
|
|
55
42
|
verb?: FollowVerb;
|
|
56
|
-
/** Full override, for a verb the vocabulary
|
|
43
|
+
/** Full override, for a verb the vocabulary does not carry. */
|
|
57
44
|
labels?: Partial<FollowLabels>;
|
|
58
45
|
size?: 'sm' | 'md' | 'lg';
|
|
59
46
|
style?: StyleProp<ViewStyle>;
|
|
@@ -65,7 +52,8 @@ export interface FollowTargetButtonProps {
|
|
|
65
52
|
showOptions?: boolean;
|
|
66
53
|
/**
|
|
67
54
|
* Offer timed follows. Pass `false` where a temporary follow makes no sense —
|
|
68
|
-
* a store you buy from, an account you know.
|
|
55
|
+
* a store you buy from, an account you know. Default: 24 hours, 72 hours and
|
|
56
|
+
* a week, translated.
|
|
69
57
|
*/
|
|
70
58
|
durations?: FollowDuration[] | false;
|
|
71
59
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FollowTargetButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/FollowTargetButton.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"FollowTargetButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/FollowTargetButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAkBzD,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,kBAAe,CAAC;AACvB,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAmB,MAAM,mBAAgB,CAAC;AAiBrF,MAAM,WAAW,uBAAuB;IACtC,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,IAAI,C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rB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,YAAY,EAAE,mBAAmB,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,qBAAqB;IACpC,2CAA2C;IAC3C,WAAW,EAAE,qBAAqB,CAAC;IACnC,wEAAwE;IACxE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,wEAAwE;IACxE,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,kDAAkD;IAClD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,iFAAiF;IACjF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"OxyConsentScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OxyConsentScreen.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAQ7D,oFAAoF;AACpF,MAAM,WAAW,qBAAqB;IACpC,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC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;CACvB;AAmHD,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,MAAM,EACN,IAAY,EACZ,aAAqB,EACrB,KAAY,GACb,EAAE,qBAAqB,+BAmRvB;AAgKD,eAAe,gBAAgB,CAAC"}
|
|
@@ -9,9 +9,8 @@
|
|
|
9
9
|
import type { AccountStorageUsageResponse } from '@oxy.so/core';
|
|
10
10
|
import { type useTheme } from '@oxy.so/bloom/theme';
|
|
11
11
|
import type { AccountDialogMenuSection } from '../../navigation/accountDialogManager.js';
|
|
12
|
-
import type { useI18n } from '../../hooks/useI18n.js';
|
|
13
12
|
export type Theme = ReturnType<typeof useTheme>;
|
|
14
|
-
export type Translate
|
|
13
|
+
export type { Translate } from '../../hooks/useI18n.js';
|
|
15
14
|
/**
|
|
16
15
|
* One SUBORDINATE action on a sign-in surface — an alternative revealed behind
|
|
17
16
|
* "Having trouble?", or a non-competing link under the primary.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/authChooser/types.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/components/authChooser/types.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAAuC,CAAC;AAEtF,MAAM,MAAM,KAAK,GAAG,UA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,IAAI,CAAC;IACvB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,SAAS,wBAAwB,EAAE,CAAC;CAC/C;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,uEAAuE;IACvE,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,uEAAuE;IACvE,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,wCAAwC;IACxC,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAgB/E"}
|
|
@@ -8,9 +8,14 @@
|
|
|
8
8
|
* (OxyHQ/oxy#1375 item 22). The name now says the state, and who it is for
|
|
9
9
|
* when the caller knows the handle.
|
|
10
10
|
*
|
|
11
|
+
* The words follow the button's verb ("Joined @fediverse", hinted "Leaves
|
|
12
|
+
* @fediverse") and its language: every string is `@oxy.so/core`'s `follow.*`.
|
|
13
|
+
*
|
|
11
14
|
* Pure, and kept apart from the components, so every state is pinned by a
|
|
12
15
|
* table test rather than by a render that can only see one state at a time.
|
|
13
16
|
*/
|
|
17
|
+
import type { Translate } from '../hooks/useI18n.js';
|
|
18
|
+
import type { FollowLabels, FollowVerb } from './followLabels.js';
|
|
14
19
|
export interface FollowButtonAccessibility {
|
|
15
20
|
accessibilityLabel: string;
|
|
16
21
|
accessibilityHint?: string;
|
|
@@ -27,13 +32,18 @@ export declare function formatHandle(username: string | undefined): string | und
|
|
|
27
32
|
* because a press does nothing until the write settles.
|
|
28
33
|
* - Following: "Following @nate", hinted "Unfollows @nate", because pressing
|
|
29
34
|
* it unfollows, which the visible "Following" does not say.
|
|
35
|
+
*
|
|
36
|
+
* The name is the visible label (the caller's, when it passed `labels`) beside
|
|
37
|
+
* the handle; the checking line and the hint are the verb's.
|
|
30
38
|
*/
|
|
31
39
|
export declare function describeFollowButton(input: {
|
|
32
40
|
isKnown: boolean;
|
|
33
41
|
isFollowing: boolean;
|
|
34
42
|
isPending: boolean;
|
|
35
43
|
username?: string;
|
|
36
|
-
|
|
44
|
+
verb: FollowVerb;
|
|
45
|
+
labels: Pick<FollowLabels, 'idle' | 'active'>;
|
|
46
|
+
}, t: Translate): FollowButtonAccessibility;
|
|
37
47
|
/**
|
|
38
48
|
* The "Follow all" button. The labels are the caller's, since a starter pack
|
|
39
49
|
* and a feed's member list word it differently; the hint carries the count.
|
|
@@ -44,5 +54,5 @@ export declare function describeFollowAllButton(input: {
|
|
|
44
54
|
count: number;
|
|
45
55
|
followAllLabel: string;
|
|
46
56
|
followedAllLabel: string;
|
|
47
|
-
}): FollowButtonAccessibility;
|
|
57
|
+
}, t: Translate): FollowButtonAccessibility;
|
|
48
58
|
//# sourceMappingURL=followButtonAccessibility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"followButtonAccessibility.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/followButtonAccessibility.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"followButtonAccessibility.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/followButtonAccessibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAgB,CAAC;AAE/D,MAAM,WAAW,yBAAyB;IACxC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAG7E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE;IACL,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC;CAC/C,EACD,CAAC,EAAE,SAAS,GACX,yBAAyB,CAqB3B;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE;IACL,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,EACD,CAAC,EAAE,SAAS,GACX,yBAAyB,CAQ3B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The words on a follow button, for every verb the ecosystem uses.
|
|
3
|
+
*
|
|
4
|
+
* "Follow" is wrong for half the things an Oxy user can follow: you subscribe
|
|
5
|
+
* to a channel, you join a community, you watch a listing. Both follow buttons
|
|
6
|
+
* read their words here, translated through `@oxy.so/core`'s `follow.*`
|
|
7
|
+
* strings, so a verb reads the same — and in the same language — wherever it is
|
|
8
|
+
* drawn.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The small vocabulary of verbs the ecosystem actually uses. An application
|
|
12
|
+
* whose verb is not here passes `labels` instead — the escape hatch exists so
|
|
13
|
+
* this union never has to grow to accommodate one product's wording.
|
|
14
|
+
*/
|
|
15
|
+
export type FollowVerb = 'follow' | 'subscribe' | 'join' | 'watch';
|
|
16
|
+
export interface FollowLabels {
|
|
17
|
+
/** Not following yet. */
|
|
18
|
+
idle: string;
|
|
19
|
+
/** Following, and this application acts on it. */
|
|
20
|
+
active: string;
|
|
21
|
+
/** Asked, waiting for the other side to accept. */
|
|
22
|
+
pending: string;
|
|
23
|
+
/** Following globally, but switched off in this application. */
|
|
24
|
+
disabled: string;
|
|
25
|
+
}
|
|
26
|
+
/** The labels for `verb` in the current language, with the caller's `overrides` on top. */
|
|
27
|
+
export declare function useFollowLabels(verb?: FollowVerb, overrides?: Partial<FollowLabels>): FollowLabels;
|
|
28
|
+
//# sourceMappingURL=followLabels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"followLabels.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/followLabels.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,2FAA2F;AAC3F,wBAAgB,eAAe,CAC7B,IAAI,GAAE,UAAqB,EAC3B,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,YAAY,CAYd"}
|
|
@@ -5,10 +5,16 @@
|
|
|
5
5
|
* application drawing its own affordance (a chip grid, a compact row) imports
|
|
6
6
|
* them from here — through `@oxy.so/services/ui/client` — without paying for the
|
|
7
7
|
* button's dropdown menu.
|
|
8
|
+
*
|
|
9
|
+
* The menu's words are `@oxy.so/core`'s `follow.*` strings, read through the
|
|
10
|
+
* caller's `t`; without one they are English.
|
|
8
11
|
*/
|
|
9
12
|
import type { FollowApplicationMode } from '@oxy.so/contracts';
|
|
13
|
+
import type { Translate } from '../hooks/useI18n.js';
|
|
14
|
+
import type { FollowVerb } from './followLabels.js';
|
|
10
15
|
/** A timed-follow choice offered in the menu. */
|
|
11
16
|
export interface FollowDuration {
|
|
17
|
+
/** The duration as it reads inside a sentence: "24 hours", "a week". */
|
|
12
18
|
label: string;
|
|
13
19
|
seconds: number;
|
|
14
20
|
}
|
|
@@ -39,15 +45,6 @@ export interface FollowMenuItem {
|
|
|
39
45
|
type: 'unfollow';
|
|
40
46
|
};
|
|
41
47
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Which choices exist, given the state.
|
|
44
|
-
*
|
|
45
|
-
* Pure and exported because this is the product decision, not a rendering
|
|
46
|
-
* detail: a timed follow is only offered before following, turning it off here
|
|
47
|
-
* is only offered while following, and NEITHER is offered before the server has
|
|
48
|
-
* answered — every one of them addresses a relationship that does not exist
|
|
49
|
-
* yet, so offering them mid-write would mean sending a guessed id.
|
|
50
|
-
*/
|
|
51
48
|
/**
|
|
52
49
|
* What the main button should do for the current state.
|
|
53
50
|
*
|
|
@@ -59,13 +56,27 @@ export declare function resolveFollowPrimaryAction(input: {
|
|
|
59
56
|
isFollowing: boolean;
|
|
60
57
|
applicationMode: FollowApplicationMode;
|
|
61
58
|
}): 'follow' | 'unfollow' | 'enable-here';
|
|
59
|
+
/**
|
|
60
|
+
* Which choices exist, given the state.
|
|
61
|
+
*
|
|
62
|
+
* Pure and exported because this is the product decision, not a rendering
|
|
63
|
+
* detail: a timed follow is only offered before following, turning it off here
|
|
64
|
+
* is only offered while following, and NEITHER is offered before the server has
|
|
65
|
+
* answered — every one of them addresses a relationship that does not exist
|
|
66
|
+
* yet, so offering them mid-write would mean sending a guessed id.
|
|
67
|
+
*/
|
|
62
68
|
export declare function buildFollowMenuItems(input: {
|
|
63
69
|
following: boolean;
|
|
64
70
|
applicationMode: FollowApplicationMode;
|
|
65
71
|
hasRelationship: boolean;
|
|
66
72
|
isPending: boolean;
|
|
67
73
|
durations: FollowDuration[] | false;
|
|
74
|
+
/** The button's idle label, which a timed choice starts with: "Follow for 24 hours". */
|
|
68
75
|
idleVerb: string;
|
|
69
76
|
applicationName: string;
|
|
77
|
+
/** Words the "everywhere" line with this verb: "Leave everywhere". Default `follow`. */
|
|
78
|
+
verb?: FollowVerb;
|
|
79
|
+
/** `useI18n().t`, for the menu in the app's language. Default English. */
|
|
80
|
+
t?: Translate;
|
|
70
81
|
}): FollowMenuItem[];
|
|
71
82
|
//# sourceMappingURL=followRules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"followRules.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/followRules.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"followRules.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/followRules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAgB,CAAC;AAEjD,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAKD;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAC9C,QAAQ,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,GAAG,UAAU,EACvE,OAAO,CAUR,CAAC;AAEF,uCAAuC;AACvC,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,MAAM,EACF;QAAE,IAAI,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAChE;QAAE,IAAI,EAAE,aAAa,CAAA;KAAE,GACvB;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,GACxB;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,qBAAqB,CAAC;CACxC,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,CAIxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,qBAAqB,CAAC;IACvC,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IACpC,wFAAwF;IACxF,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,wFAAwF;IACxF,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,0EAA0E;IAC1E,CAAC,CAAC,EAAE,SAAS,CAAC;CACf,GAAG,cAAc,EAAE,CAwCnB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAccountColor
|
|
3
|
+
*
|
|
4
|
+
* The account's colour is one value that every Oxy app wears: `users.color`, a
|
|
5
|
+
* Bloom preset NAME the API only stores after its entitlement check (`oxy` and
|
|
6
|
+
* `faircoin` belong to the account with that handle, `mono` to an active
|
|
7
|
+
* benefit). This hook is the single place an app turns that stored name into its
|
|
8
|
+
* Bloom theme, so two apps cannot disagree about which field wins.
|
|
9
|
+
*
|
|
10
|
+
* The portable `themePreference.colorPreset` is the fallback for an account that
|
|
11
|
+
* has no `color` yet. Mode (light/dark) is deliberately out of scope: whether to
|
|
12
|
+
* follow the account's mode is each app's own choice, the colour is not.
|
|
13
|
+
*
|
|
14
|
+
* An app with a stricter rule of its own (a plan the SDK cannot see) passes
|
|
15
|
+
* `canUse`; a name it refuses is simply not applied, so the app keeps its own
|
|
16
|
+
* default instead of a colour the viewer is not entitled to.
|
|
17
|
+
*/
|
|
18
|
+
import type { User } from '@oxy.so/core';
|
|
19
|
+
import { type AppColorName } from '@oxy.so/bloom/theme';
|
|
20
|
+
/** The preset an account wears, or `null` when it has none Bloom knows. */
|
|
21
|
+
export declare function resolveAccountColor(user: Pick<User, 'color' | 'themePreference'> | null | undefined): AppColorName | null;
|
|
22
|
+
export declare function useAccountColor({ canUse, }?: {
|
|
23
|
+
canUse?: (name: AppColorName) => boolean;
|
|
24
|
+
}): void;
|
|
25
|
+
//# sourceMappingURL=useAccountColor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccountColor.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useAccountColor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAS1F,2EAA2E;AAC3E,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,iBAAiB,CAAC,GAAG,IAAI,GAAG,SAAS,GAC/D,YAAY,GAAG,IAAI,CAGrB;AAED,wBAAgB,eAAe,CAAC,EAC9B,MAAM,GACP,GAAE;IACD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC;CACrC,GAAG,IAAI,CAUZ"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** `useI18n().t`: a key and its `{{placeholders}}` in, the current language's text out. */
|
|
2
|
+
export type Translate = (key: string, vars?: Record<string, string | number>) => string;
|
|
1
3
|
/**
|
|
2
4
|
* Display copy for SDK surfaces.
|
|
3
5
|
*
|
|
@@ -12,7 +14,7 @@
|
|
|
12
14
|
* Anything that reads or mutates session state uses `useOxy()`, which throws.
|
|
13
15
|
*/
|
|
14
16
|
export declare function useI18n(): {
|
|
15
|
-
t:
|
|
17
|
+
t: Translate;
|
|
16
18
|
locale: string;
|
|
17
19
|
};
|
|
18
20
|
//# sourceMappingURL=useI18n.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useI18n.ts"],"names":[],"mappings":"AAWA
|
|
1
|
+
{"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useI18n.ts"],"names":[],"mappings":"AAWA,2FAA2F;AAC3F,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;AAExF;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO;;;EActB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DeviceLinkedSession } from '@oxy.so/core';
|
|
2
|
-
type Translate
|
|
2
|
+
import type { Translate } from '../hooks/useI18n.js';
|
|
3
3
|
/**
|
|
4
4
|
* The title of one row in "Sessions & devices".
|
|
5
5
|
*
|
|
@@ -14,5 +14,4 @@ type Translate = (key: string, vars?: Record<string, string | number>) => string
|
|
|
14
14
|
* response does carry. Never the string "undefined".
|
|
15
15
|
*/
|
|
16
16
|
export declare function deviceSessionTitle(session: Pick<DeviceLinkedSession, 'deviceName' | 'isCurrent' | 'user'>, t: Translate): string;
|
|
17
|
-
export {};
|
|
18
17
|
//# sourceMappingURL=deviceSessionTitle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceSessionTitle.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/deviceSessionTitle.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"deviceSessionTitle.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/deviceSessionTitle.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAkB,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,WAAW,GAAG,MAAM,CAAC,EACvE,CAAC,EAAE,SAAS,GACX,MAAM,CAQR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/services",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.7.0",
|
|
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",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"prepublishOnly": "node ../../scripts/assert-bun-publish.mjs && bun run typescript && bun run test && bun run build"
|
|
152
152
|
},
|
|
153
153
|
"dependencies": {
|
|
154
|
-
"@oxy.so/contracts": "^5.
|
|
154
|
+
"@oxy.so/contracts": "^5.4.0",
|
|
155
155
|
"color": "^5.0.3",
|
|
156
156
|
"@peable.to/sdk": "0.4.1"
|
|
157
157
|
},
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"@commitlint/config-conventional": "^21.2.0",
|
|
161
161
|
"@expo/app-integrity": "~58.0.2",
|
|
162
162
|
"@expo/vector-icons": "^15.0.3",
|
|
163
|
-
"@oxy.so/core": "6.3
|
|
163
|
+
"@oxy.so/core": "6.9.3",
|
|
164
164
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
165
165
|
"@react-native-community/netinfo": "^12.0.1",
|
|
166
166
|
"@react-native/babel-preset": "^0.88.0",
|
|
@@ -210,12 +210,12 @@
|
|
|
210
210
|
"expo-video": "~58.0.11"
|
|
211
211
|
},
|
|
212
212
|
"//@oxy.so/bloom": "Bloom 11.1.0 adds the shared grouped sections, usage card, subscription plans, frame appearance and overlay navigation APIs used by this SDK. First-party Bloom peers remain open above this tested minimum.",
|
|
213
|
-
"//@oxy.so/core": "Core 6.
|
|
213
|
+
"//@oxy.so/core": "Core 6.4.0 supplies the `follow.*` strings the follow buttons read for every verb and language; 6.1.0 the `oxy.auth.email.{startChange,change,remove}` and `oxy.auth.password.remove` the sign-in & security panels call. Keep one Core instance per app; raise this floor with the root catalogue when new runtime APIs are required.",
|
|
214
214
|
"peerDependencies": {
|
|
215
215
|
"@expo/app-integrity": ">=56.0.0 <59.0.0",
|
|
216
216
|
"@expo/vector-icons": "^15.0.3",
|
|
217
217
|
"@oxy.so/bloom": ">=11.1.0",
|
|
218
|
-
"@oxy.so/core": "^6.
|
|
218
|
+
"@oxy.so/core": "^6.4.0",
|
|
219
219
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
220
220
|
"@react-native-community/netinfo": ">=11.4.1 <13.0.0",
|
|
221
221
|
"@tanstack/query-async-storage-persister": "^5.101",
|
package/src/index.ts
CHANGED
|
@@ -344,11 +344,8 @@ export {
|
|
|
344
344
|
FOLLOW_ACTION_LEAVES_ACTIVE,
|
|
345
345
|
} from './ui/components/followRules';
|
|
346
346
|
export type { FollowDuration, FollowMenuItem } from './ui/components/followRules';
|
|
347
|
-
export type {
|
|
348
|
-
|
|
349
|
-
FollowVerb,
|
|
350
|
-
FollowLabels,
|
|
351
|
-
} from './ui/components/FollowTargetButton';
|
|
347
|
+
export type { FollowTargetButtonProps } from './ui/components/FollowTargetButton';
|
|
348
|
+
export type { FollowVerb, FollowLabels } from './ui/components/followLabels';
|
|
352
349
|
export { useFollowTarget } from './ui/hooks/useFollowTarget';
|
|
353
350
|
export type { UseFollowTargetResult } from './ui/hooks/useFollowTarget';
|
|
354
351
|
export {
|
package/src/ui/client.ts
CHANGED
|
@@ -23,12 +23,14 @@ export type { OxyAuthPromptProps } from './components/OxyAuthPrompt';
|
|
|
23
23
|
export { LogoIcon } from './components/logo/LogoIcon';
|
|
24
24
|
export { LogoText } from './components/logo/LogoText';
|
|
25
25
|
export { default as FollowButton } from './components/FollowButton';
|
|
26
|
-
export { FollowTargetButton } from './components/FollowTargetButton';
|
|
27
26
|
export type {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} from './components/
|
|
27
|
+
FollowButtonProps,
|
|
28
|
+
SingleFollowButtonProps,
|
|
29
|
+
MultiFollowButtonProps,
|
|
30
|
+
} from './components/FollowButton';
|
|
31
|
+
export { FollowTargetButton } from './components/FollowTargetButton';
|
|
32
|
+
export type { FollowTargetButtonProps } from './components/FollowTargetButton';
|
|
33
|
+
export type { FollowVerb, FollowLabels } from './components/followLabels';
|
|
32
34
|
export { default as ProfileButton } from './components/ProfileButton';
|
|
33
35
|
export type { ProfileButtonProps } from './components/ProfileButton';
|
|
34
36
|
export { default as PeableButton } from './components/PeableButton';
|
|
@@ -43,6 +45,7 @@ export { useOxy, useOptionalOxy, OxyProviderMissingError } from './context/OxyCo
|
|
|
43
45
|
|
|
44
46
|
// Hooks
|
|
45
47
|
export { useAuth } from './hooks/useAuth';
|
|
48
|
+
export { useAccountColor, resolveAccountColor } from './hooks/useAccountColor';
|
|
46
49
|
// This app's Oxy-signed assertion of which app it is (ADR 0045), for an SDK
|
|
47
50
|
// that attaches it to its own requests without pulling in the account screens.
|
|
48
51
|
export {
|
|
@@ -8,10 +8,9 @@ import { useFollow, useFollowForButton } from '../hooks/useFollow';
|
|
|
8
8
|
import { useFollowStore } from '../stores/followStore';
|
|
9
9
|
import type { OxyServices, BulkFollowResult, BulkUnfollowResult } from '@oxy.so/core';
|
|
10
10
|
import { useShallow } from 'zustand/react/shallow';
|
|
11
|
+
import { useI18n } from '../hooks/useI18n';
|
|
11
12
|
import { describeFollowAllButton, describeFollowButton } from './followButtonAccessibility';
|
|
12
|
-
|
|
13
|
-
const DEFAULT_FOLLOW_ALL_LABEL = 'Follow all';
|
|
14
|
-
const DEFAULT_FOLLOWED_ALL_LABEL = 'Following';
|
|
13
|
+
import { type FollowLabels, type FollowVerb, useFollowLabels } from './followLabels';
|
|
15
14
|
|
|
16
15
|
/** Props shared by both single- and multi-user follow modes. */
|
|
17
16
|
interface FollowButtonBaseProps {
|
|
@@ -35,6 +34,16 @@ export interface SingleFollowButtonProps extends FollowButtonBaseProps {
|
|
|
35
34
|
* still follows the state.
|
|
36
35
|
*/
|
|
37
36
|
username?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The word for following this account: a fediverse community reads
|
|
39
|
+
* "Join"/"Joined". Translated, like every default label here.
|
|
40
|
+
*/
|
|
41
|
+
verb?: FollowVerb;
|
|
42
|
+
/**
|
|
43
|
+
* Overrides for a verb the vocabulary does not carry. This button shows
|
|
44
|
+
* `idle` and `active`; a user follow has no pending or switched-off state.
|
|
45
|
+
*/
|
|
46
|
+
labels?: Partial<FollowLabels>;
|
|
38
47
|
userIds?: never;
|
|
39
48
|
}
|
|
40
49
|
|
|
@@ -42,7 +51,9 @@ export interface SingleFollowButtonProps extends FollowButtonBaseProps {
|
|
|
42
51
|
export interface MultiFollowButtonProps extends FollowButtonBaseProps {
|
|
43
52
|
userIds: string[];
|
|
44
53
|
initiallyAllFollowing?: boolean;
|
|
54
|
+
/** Default: "Follow all", translated. */
|
|
45
55
|
followAllLabel?: string;
|
|
56
|
+
/** Default: "Following", translated. */
|
|
46
57
|
followedAllLabel?: string;
|
|
47
58
|
onBulkFollow?: (result: BulkFollowResult) => void;
|
|
48
59
|
onBulkUnfollow?: (result: BulkUnfollowResult) => void;
|
|
@@ -63,6 +74,8 @@ const FollowButtonInner = memo(function FollowButtonInner({
|
|
|
63
74
|
oxyServices,
|
|
64
75
|
initiallyFollowing,
|
|
65
76
|
username,
|
|
77
|
+
verb = 'follow',
|
|
78
|
+
labels,
|
|
66
79
|
size = 'md',
|
|
67
80
|
onFollowChange,
|
|
68
81
|
style,
|
|
@@ -71,6 +84,8 @@ const FollowButtonInner = memo(function FollowButtonInner({
|
|
|
71
84
|
showLoadingState = true,
|
|
72
85
|
preventParentActions = true,
|
|
73
86
|
}: SingleFollowButtonProps & { oxyServices: OxyServices }) {
|
|
87
|
+
const { t } = useI18n();
|
|
88
|
+
const text = useFollowLabels(verb, labels);
|
|
74
89
|
const { isFollowing, isKnown, isLoading, toggleFollow, resolveStatus } = useFollowForButton(
|
|
75
90
|
userId,
|
|
76
91
|
oxyServices,
|
|
@@ -91,10 +106,19 @@ const FollowButtonInner = memo(function FollowButtonInner({
|
|
|
91
106
|
if (accepted) onFollowChange?.(!isFollowing);
|
|
92
107
|
} catch (err: unknown) {
|
|
93
108
|
const error = err instanceof Error ? err : new Error(String(err));
|
|
94
|
-
toast.error(error.message || '
|
|
109
|
+
toast.error(error.message || t('follow.errors.update'));
|
|
95
110
|
}
|
|
96
111
|
},
|
|
97
|
-
[
|
|
112
|
+
[
|
|
113
|
+
disabled,
|
|
114
|
+
isLoading,
|
|
115
|
+
isKnown,
|
|
116
|
+
toggleFollow,
|
|
117
|
+
onFollowChange,
|
|
118
|
+
isFollowing,
|
|
119
|
+
preventParentActions,
|
|
120
|
+
t,
|
|
121
|
+
],
|
|
98
122
|
);
|
|
99
123
|
|
|
100
124
|
// Enqueue a batched status fetch ONLY when the status is genuinely unknown
|
|
@@ -110,12 +134,10 @@ const FollowButtonInner = memo(function FollowButtonInner({
|
|
|
110
134
|
const isBusy = isLoading || !isKnown;
|
|
111
135
|
const showFollowing = isKnown && isFollowing;
|
|
112
136
|
const showSpinner = showLoadingState && isBusy;
|
|
113
|
-
const { accessibilityLabel, accessibilityHint } = describeFollowButton(
|
|
114
|
-
isKnown,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
username,
|
|
118
|
-
});
|
|
137
|
+
const { accessibilityLabel, accessibilityHint } = describeFollowButton(
|
|
138
|
+
{ isKnown, isFollowing: showFollowing, isPending: isLoading, username, verb, labels: text },
|
|
139
|
+
t,
|
|
140
|
+
);
|
|
119
141
|
|
|
120
142
|
return (
|
|
121
143
|
<BloomFollowButton
|
|
@@ -128,7 +150,8 @@ const FollowButtonInner = memo(function FollowButtonInner({
|
|
|
128
150
|
disabled={disabled || isBusy}
|
|
129
151
|
style={style}
|
|
130
152
|
textStyle={textStyle}
|
|
131
|
-
label={isKnown || showSpinner ?
|
|
153
|
+
label={isKnown || showSpinner ? text.idle : ''}
|
|
154
|
+
followingLabel={text.active}
|
|
132
155
|
accessibilityLabel={accessibilityLabel}
|
|
133
156
|
accessibilityHint={accessibilityHint}
|
|
134
157
|
/>
|
|
@@ -139,8 +162,8 @@ const FollowButtonMultiInner = memo(function FollowButtonMultiInner({
|
|
|
139
162
|
userIds,
|
|
140
163
|
initiallyAllFollowing = false,
|
|
141
164
|
size = 'md',
|
|
142
|
-
followAllLabel
|
|
143
|
-
followedAllLabel
|
|
165
|
+
followAllLabel: followAllLabelProp,
|
|
166
|
+
followedAllLabel: followedAllLabelProp,
|
|
144
167
|
onFollowChange,
|
|
145
168
|
onBulkFollow,
|
|
146
169
|
onBulkUnfollow,
|
|
@@ -150,6 +173,9 @@ const FollowButtonMultiInner = memo(function FollowButtonMultiInner({
|
|
|
150
173
|
showLoadingState = true,
|
|
151
174
|
preventParentActions = true,
|
|
152
175
|
}: MultiFollowButtonProps) {
|
|
176
|
+
const { t } = useI18n();
|
|
177
|
+
const followAllLabel = followAllLabelProp ?? t('follow.all.idle');
|
|
178
|
+
const followedAllLabel = followedAllLabelProp ?? t('follow.verbs.follow.active');
|
|
153
179
|
const follow = useFollow(userIds);
|
|
154
180
|
const followAllUsers = 'followAllUsers' in follow ? follow.followAllUsers : undefined;
|
|
155
181
|
const unfollowAllUsers = 'unfollowAllUsers' in follow ? follow.unfollowAllUsers : undefined;
|
|
@@ -209,7 +235,7 @@ const FollowButtonMultiInner = memo(function FollowButtonMultiInner({
|
|
|
209
235
|
onBulkUnfollow?.(result);
|
|
210
236
|
} catch (err: unknown) {
|
|
211
237
|
const error = err instanceof Error ? err : new Error(String(err));
|
|
212
|
-
toast.error(error.message || '
|
|
238
|
+
toast.error(error.message || t('follow.errors.update'));
|
|
213
239
|
} finally {
|
|
214
240
|
setIsSubmitting(false);
|
|
215
241
|
}
|
|
@@ -236,7 +262,7 @@ const FollowButtonMultiInner = memo(function FollowButtonMultiInner({
|
|
|
236
262
|
onBulkFollow?.(result);
|
|
237
263
|
} catch (err: unknown) {
|
|
238
264
|
const error = err instanceof Error ? err : new Error(String(err));
|
|
239
|
-
toast.error(error.message || '
|
|
265
|
+
toast.error(error.message || t('follow.errors.update'));
|
|
240
266
|
} finally {
|
|
241
267
|
setIsSubmitting(false);
|
|
242
268
|
}
|
|
@@ -251,17 +277,21 @@ const FollowButtonMultiInner = memo(function FollowButtonMultiInner({
|
|
|
251
277
|
onBulkFollow,
|
|
252
278
|
onBulkUnfollow,
|
|
253
279
|
preventParentActions,
|
|
280
|
+
t,
|
|
254
281
|
],
|
|
255
282
|
);
|
|
256
283
|
|
|
257
284
|
const showSpinner = showLoadingState && isLoading;
|
|
258
|
-
const { accessibilityLabel, accessibilityHint } = describeFollowAllButton(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
285
|
+
const { accessibilityLabel, accessibilityHint } = describeFollowAllButton(
|
|
286
|
+
{
|
|
287
|
+
allFollowing,
|
|
288
|
+
isPending: Boolean(isLoading),
|
|
289
|
+
count: userIds.length,
|
|
290
|
+
followAllLabel,
|
|
291
|
+
followedAllLabel,
|
|
292
|
+
},
|
|
293
|
+
t,
|
|
294
|
+
);
|
|
265
295
|
|
|
266
296
|
return (
|
|
267
297
|
<BloomFollowButton
|