convex-feedback-ui 0.1.7 → 0.1.8
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 +4 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/native/expo/FeedbackCreateStackLayout.d.ts.map +1 -1
- package/dist/native/expo/FeedbackCreateStackLayout.js +1 -0
- package/dist/native/expo/FeedbackCreateStackLayout.js.map +1 -1
- package/dist/native/expo/FeedbackRoutes.d.ts.map +1 -1
- package/dist/native/expo/FeedbackRoutes.js +4 -4
- package/dist/native/expo/FeedbackRoutes.js.map +1 -1
- package/dist/native/expo/FeedbackScreen.d.ts +1 -1
- package/dist/native/expo/FeedbackScreen.d.ts.map +1 -1
- package/dist/native/expo/FeedbackScreen.js +2 -2
- package/dist/native/expo/FeedbackScreen.js.map +1 -1
- package/dist/native/expo/FeedbackStack.d.ts.map +1 -1
- package/dist/native/expo/FeedbackStack.js +5 -4
- package/dist/native/expo/FeedbackStack.js.map +1 -1
- package/dist/native/expo/FeedbackStackLayout.d.ts +1 -1
- package/dist/native/expo/FeedbackStackLayout.d.ts.map +1 -1
- package/dist/native/expo/FeedbackStackLayout.js +3 -2
- package/dist/native/expo/FeedbackStackLayout.js.map +1 -1
- package/dist/native/native/FeedbackScreen.d.ts +1 -1
- package/dist/native/native/FeedbackScreen.d.ts.map +1 -1
- package/dist/native/native/FeedbackScreen.js +2 -2
- package/dist/native/native/FeedbackScreen.js.map +1 -1
- package/dist/native/shared/ui/FeedbackScreenList.d.ts.map +1 -1
- package/dist/native/shared/ui/FeedbackScreenList.js +3 -3
- package/dist/native/shared/ui/FeedbackScreenList.js.map +1 -1
- package/dist/react/screen.d.ts +1 -1
- package/dist/react/screen.d.ts.map +1 -1
- package/dist/react/screen.js +5 -5
- package/dist/react/screen.js.map +1 -1
- package/dist/shared/context/FeedbackBodyProvider.d.ts +1 -1
- package/dist/shared/context/FeedbackBodyProvider.d.ts.map +1 -1
- package/dist/shared/context/FeedbackBodyProvider.js +2 -1
- package/dist/shared/context/FeedbackBodyProvider.js.map +1 -1
- package/dist/shared/types/screen.d.ts +4 -1
- package/dist/shared/types/screen.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/native/expo/FeedbackCreateStackLayout.tsx +1 -0
- package/src/native/expo/FeedbackRoutes.tsx +5 -1
- package/src/native/expo/FeedbackScreen.tsx +2 -0
- package/src/native/expo/FeedbackStack.tsx +4 -5
- package/src/native/expo/FeedbackStackLayout.tsx +3 -0
- package/src/native/native/FeedbackScreen.tsx +2 -0
- package/src/native/shared/ui/FeedbackScreenList.tsx +5 -4
- package/src/react/screen.tsx +8 -3
- package/src/shared/context/FeedbackBodyProvider.tsx +2 -0
- package/src/shared/types/screen.ts +10 -1
|
@@ -85,6 +85,7 @@ export function FeedbackBoardScreen() {
|
|
|
85
85
|
}
|
|
86
86
|
accessibilityLabel={messages.entry.back}
|
|
87
87
|
onPress={() => router.back()}
|
|
88
|
+
tintColor={theme.colors.text}
|
|
88
89
|
>
|
|
89
90
|
{messages.entry.back}
|
|
90
91
|
</Stack.Toolbar.Button>
|
|
@@ -102,6 +103,7 @@ export function FeedbackBoardScreen() {
|
|
|
102
103
|
/>
|
|
103
104
|
<Stack.Toolbar placement="bottom">
|
|
104
105
|
<Stack.Toolbar.SearchBarSlot />
|
|
106
|
+
<Stack.Toolbar.Spacer />
|
|
105
107
|
<Stack.Toolbar.Menu
|
|
106
108
|
icon={
|
|
107
109
|
process.env.EXPO_OS === "ios"
|
|
@@ -110,7 +112,7 @@ export function FeedbackBoardScreen() {
|
|
|
110
112
|
}
|
|
111
113
|
title={messages.board.statusFilter}
|
|
112
114
|
accessibilityLabel={messages.board.statusFilter}
|
|
113
|
-
tintColor={theme.colors.
|
|
115
|
+
tintColor={theme.colors.text}
|
|
114
116
|
>
|
|
115
117
|
{entryStatusChoices(messages).map(({ value, label }) => (
|
|
116
118
|
<Stack.Toolbar.MenuAction
|
|
@@ -174,6 +176,7 @@ function FeedbackEntryRouteContent({ entryId }: { entryId: string }) {
|
|
|
174
176
|
}
|
|
175
177
|
accessibilityLabel={messages.form.cancel}
|
|
176
178
|
onPress={modal.dismiss}
|
|
179
|
+
tintColor={theme.colors.text}
|
|
177
180
|
>
|
|
178
181
|
{messages.form.cancel}
|
|
179
182
|
</Stack.Toolbar.Button>
|
|
@@ -229,6 +232,7 @@ export function CreateFeedbackScreen() {
|
|
|
229
232
|
}
|
|
230
233
|
accessibilityLabel={messages.form.cancel}
|
|
231
234
|
onPress={() => (modal ? modal.dismiss() : router.dismiss())}
|
|
235
|
+
tintColor={theme.colors.text}
|
|
232
236
|
>
|
|
233
237
|
{messages.form.cancel}
|
|
234
238
|
</Stack.Toolbar.Button>
|
|
@@ -17,6 +17,7 @@ export function FeedbackScreen({
|
|
|
17
17
|
debounceDuration = 300,
|
|
18
18
|
collectMetadata,
|
|
19
19
|
emptyState,
|
|
20
|
+
loading,
|
|
20
21
|
transformComments,
|
|
21
22
|
renderActor,
|
|
22
23
|
...props
|
|
@@ -32,6 +33,7 @@ export function FeedbackScreen({
|
|
|
32
33
|
debounceDuration={debounceDuration}
|
|
33
34
|
collectMetadata={collectMetadata}
|
|
34
35
|
emptyState={emptyState}
|
|
36
|
+
loading={loading}
|
|
35
37
|
collectStandardMetadata={collectExpoMetadata}
|
|
36
38
|
transformComments={transformComments}
|
|
37
39
|
renderActor={renderActor}
|
|
@@ -52,6 +52,7 @@ export function FeedbackStack({
|
|
|
52
52
|
headerTransparent: true,
|
|
53
53
|
headerShadowVisible: true,
|
|
54
54
|
headerBackVisible: false,
|
|
55
|
+
headerTintColor: theme.colors.text,
|
|
55
56
|
contentStyle: { backgroundColor: theme.colors.background },
|
|
56
57
|
...stackOptions,
|
|
57
58
|
}}
|
|
@@ -79,6 +80,7 @@ export function FeedbackStack({
|
|
|
79
80
|
}
|
|
80
81
|
accessibilityLabel={messages.entry.back}
|
|
81
82
|
onPress={handleBackPress}
|
|
83
|
+
tintColor={theme.colors.text}
|
|
82
84
|
>
|
|
83
85
|
{messages.entry.back}
|
|
84
86
|
</Stack.Toolbar.Button>
|
|
@@ -91,10 +93,6 @@ export function FeedbackStack({
|
|
|
91
93
|
if (selectedEntryId) setSelectedEntryId(null);
|
|
92
94
|
setQuery(q.nativeEvent.text);
|
|
93
95
|
}}
|
|
94
|
-
onOpen={() => console.log("opened")}
|
|
95
|
-
onClose={() => console.log("closed")}
|
|
96
|
-
onSearchButtonPress={() => console.log("search button pressed")}
|
|
97
|
-
onCancelButtonPress={() => console.log("cancel button pressed")}
|
|
98
96
|
onFocus={() => {
|
|
99
97
|
if (selectedEntryId) setSelectedEntryId(null);
|
|
100
98
|
setIsSearching(true);
|
|
@@ -108,6 +106,7 @@ export function FeedbackStack({
|
|
|
108
106
|
/>
|
|
109
107
|
<Stack.Toolbar placement="bottom">
|
|
110
108
|
<Stack.Toolbar.SearchBarSlot />
|
|
109
|
+
<Stack.Toolbar.Spacer />
|
|
111
110
|
<Stack.Toolbar.Menu
|
|
112
111
|
icon={
|
|
113
112
|
process.env.EXPO_OS === "ios"
|
|
@@ -116,7 +115,7 @@ export function FeedbackStack({
|
|
|
116
115
|
}
|
|
117
116
|
title={messages.board.statusFilter}
|
|
118
117
|
accessibilityLabel={messages.board.statusFilter}
|
|
119
|
-
tintColor={theme.colors.
|
|
118
|
+
tintColor={theme.colors.text}
|
|
120
119
|
>
|
|
121
120
|
{entryStatusChoices(messages).map(({ value, label }) => (
|
|
122
121
|
<Stack.Toolbar.MenuAction
|
|
@@ -22,6 +22,7 @@ export function FeedbackStackLayout({
|
|
|
22
22
|
debounceDuration = 300,
|
|
23
23
|
collectMetadata,
|
|
24
24
|
emptyState,
|
|
25
|
+
loading,
|
|
25
26
|
transformComments,
|
|
26
27
|
renderActor,
|
|
27
28
|
routes: routeOverrides,
|
|
@@ -60,6 +61,7 @@ export function FeedbackStackLayout({
|
|
|
60
61
|
const defaults: NativeStackNavigationOptions = {
|
|
61
62
|
headerShown: true,
|
|
62
63
|
headerBackButtonDisplayMode: "minimal",
|
|
64
|
+
headerTintColor: textColor ?? resolvedTheme.colors.text,
|
|
63
65
|
contentStyle: { backgroundColor: background },
|
|
64
66
|
};
|
|
65
67
|
|
|
@@ -74,6 +76,7 @@ export function FeedbackStackLayout({
|
|
|
74
76
|
debounceDuration={debounceDuration}
|
|
75
77
|
collectMetadata={collectMetadata}
|
|
76
78
|
emptyState={emptyState}
|
|
79
|
+
loading={loading}
|
|
77
80
|
collectStandardMetadata={collectExpoMetadata}
|
|
78
81
|
transformComments={transformComments}
|
|
79
82
|
renderActor={renderActor}
|
|
@@ -17,6 +17,7 @@ export function FeedbackScreen({
|
|
|
17
17
|
debounceDuration = 300,
|
|
18
18
|
collectMetadata,
|
|
19
19
|
emptyState,
|
|
20
|
+
loading,
|
|
20
21
|
transformComments,
|
|
21
22
|
renderActor,
|
|
22
23
|
...props
|
|
@@ -32,6 +33,7 @@ export function FeedbackScreen({
|
|
|
32
33
|
debounceDuration={debounceDuration}
|
|
33
34
|
collectMetadata={collectMetadata}
|
|
34
35
|
emptyState={emptyState}
|
|
36
|
+
loading={loading}
|
|
35
37
|
collectStandardMetadata={collectNativeMetadata}
|
|
36
38
|
transformComments={transformComments}
|
|
37
39
|
renderActor={renderActor}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Text } from "react-native";
|
|
1
|
+
import { ActivityIndicator, Text } from "react-native";
|
|
2
2
|
|
|
3
3
|
import { useFeedbackBody } from "../../../shared/context/FeedbackBodyProvider.js";
|
|
4
4
|
import { useFeedbackUi } from "../../../shared/context/FeedbackProvider.js";
|
|
@@ -26,6 +26,7 @@ export function FeedbackScreenList({
|
|
|
26
26
|
setSelectedEntryId,
|
|
27
27
|
setShowForm,
|
|
28
28
|
emptyState,
|
|
29
|
+
loading: loadingIndicator,
|
|
29
30
|
} = useFeedbackBody();
|
|
30
31
|
const { messages, theme } = useFeedbackUi();
|
|
31
32
|
|
|
@@ -59,9 +60,9 @@ export function FeedbackScreenList({
|
|
|
59
60
|
</FeedbackBoard.List>
|
|
60
61
|
) : loading ? (
|
|
61
62
|
<FeedbackBoard.State>
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
|
|
63
|
+
{loadingIndicator ?? (
|
|
64
|
+
<ActivityIndicator size="large" color={theme.colors.primary} />
|
|
65
|
+
)}
|
|
65
66
|
</FeedbackBoard.State>
|
|
66
67
|
) : entries !== undefined && entries.length === 0 ? (
|
|
67
68
|
<FeedbackBoard.State>
|
package/src/react/screen.tsx
CHANGED
|
@@ -55,6 +55,7 @@ export function FeedbackScreen({
|
|
|
55
55
|
debounceDuration = 300,
|
|
56
56
|
collectMetadata,
|
|
57
57
|
emptyState,
|
|
58
|
+
loading,
|
|
58
59
|
...props
|
|
59
60
|
}: FeedbackScreenProps) {
|
|
60
61
|
return (
|
|
@@ -68,6 +69,7 @@ export function FeedbackScreen({
|
|
|
68
69
|
debounceDuration={debounceDuration}
|
|
69
70
|
collectMetadata={collectMetadata}
|
|
70
71
|
emptyState={emptyState}
|
|
72
|
+
loading={loading}
|
|
71
73
|
collectStandardMetadata={collectWebMetadata}
|
|
72
74
|
transformComments={transformComments}
|
|
73
75
|
renderActor={renderActor}
|
|
@@ -100,6 +102,7 @@ function FeedbackScreenInner({
|
|
|
100
102
|
setQuery,
|
|
101
103
|
debouncedQuery,
|
|
102
104
|
emptyState,
|
|
105
|
+
loading: loadingIndicator,
|
|
103
106
|
} = useFeedbackBody();
|
|
104
107
|
const { messages } = useFeedbackUi();
|
|
105
108
|
|
|
@@ -127,7 +130,7 @@ function FeedbackScreenInner({
|
|
|
127
130
|
|
|
128
131
|
const searching = query.trim().length > 0;
|
|
129
132
|
const entries = searching ? searchResults : list.results;
|
|
130
|
-
const
|
|
133
|
+
const isLoading = searching
|
|
131
134
|
? searchResults === undefined
|
|
132
135
|
: list.status === "LoadingFirstPage";
|
|
133
136
|
|
|
@@ -166,9 +169,11 @@ function FeedbackScreenInner({
|
|
|
166
169
|
|
|
167
170
|
<FeedbackBoard.Search value={query} onValueChange={setQuery} />
|
|
168
171
|
|
|
169
|
-
{
|
|
172
|
+
{isLoading ? (
|
|
170
173
|
<FeedbackBoard.State>
|
|
171
|
-
|
|
174
|
+
{loadingIndicator ?? (
|
|
175
|
+
<span className="cf-state__message">{messages.board.loading}</span>
|
|
176
|
+
)}
|
|
172
177
|
</FeedbackBoard.State>
|
|
173
178
|
) : entries !== undefined && entries.length === 0 ? (
|
|
174
179
|
<FeedbackBoard.State>
|
|
@@ -25,6 +25,7 @@ export function FeedbackBodyProvider({
|
|
|
25
25
|
debounceDuration,
|
|
26
26
|
collectMetadata,
|
|
27
27
|
emptyState,
|
|
28
|
+
loading,
|
|
28
29
|
collectStandardMetadata,
|
|
29
30
|
transformComments,
|
|
30
31
|
renderActor,
|
|
@@ -71,6 +72,7 @@ export function FeedbackBodyProvider({
|
|
|
71
72
|
debounceDuration,
|
|
72
73
|
collectMetadata,
|
|
73
74
|
emptyState,
|
|
75
|
+
loading,
|
|
74
76
|
collectStandardMetadata,
|
|
75
77
|
transformComments,
|
|
76
78
|
renderActor,
|
|
@@ -99,6 +99,9 @@ export interface FeedbackScreenBaseProps {
|
|
|
99
99
|
|
|
100
100
|
/** Optional host-owned content rendered above the empty-state message. */
|
|
101
101
|
emptyState?: ReactNode;
|
|
102
|
+
|
|
103
|
+
/** Optional host-owned loading indicator rendered during board loading. */
|
|
104
|
+
loading?: ReactNode;
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
export interface FeedbackScreenRootProps
|
|
@@ -110,10 +113,16 @@ export interface FeedbackScreenRootProps
|
|
|
110
113
|
|
|
111
114
|
export interface FeedbackScreenProviderProps
|
|
112
115
|
extends
|
|
113
|
-
Required<
|
|
116
|
+
Required<
|
|
117
|
+
Omit<
|
|
118
|
+
FeedbackScreenBaseProps,
|
|
119
|
+
"collectMetadata" | "emptyState" | "loading"
|
|
120
|
+
>
|
|
121
|
+
>,
|
|
114
122
|
FeedbackScreenTransformationProps {
|
|
115
123
|
collectMetadata?: CollectMetadata;
|
|
116
124
|
emptyState?: ReactNode;
|
|
125
|
+
loading?: ReactNode;
|
|
117
126
|
collectStandardMetadata: StandardMetadataCollector;
|
|
118
127
|
}
|
|
119
128
|
|