@planningcenter/chat-react-native 3.14.0-rc.3 → 3.14.0-rc.5
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/build/components/conversation/empty_conversation_blank_state.d.ts.map +1 -1
- package/build/components/conversation/empty_conversation_blank_state.js +10 -2
- package/build/components/conversation/empty_conversation_blank_state.js.map +1 -1
- package/build/components/conversations/conversation_actions.js +3 -3
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/conversations.js +7 -2
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/conversations/{action_toggle_button.d.ts → swipeable_toggle_button.d.ts} +3 -3
- package/build/components/conversations/swipeable_toggle_button.d.ts.map +1 -0
- package/build/components/conversations/{action_toggle_button.js → swipeable_toggle_button.js} +7 -3
- package/build/components/conversations/swipeable_toggle_button.js.map +1 -0
- package/build/components/display/index.d.ts +0 -1
- package/build/components/display/index.d.ts.map +1 -1
- package/build/components/display/index.js +0 -1
- package/build/components/display/index.js.map +1 -1
- package/build/components/primitive/blank_state_primitive.d.ts +38 -0
- package/build/components/primitive/blank_state_primitive.d.ts.map +1 -0
- package/build/components/primitive/blank_state_primitive.js +88 -0
- package/build/components/primitive/blank_state_primitive.js.map +1 -0
- package/build/hooks/use_conversation.d.ts.map +1 -1
- package/build/hooks/use_conversation.js +2 -0
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_message_create_or_update.d.ts.map +1 -1
- package/build/hooks/use_message_create_or_update.js +2 -1
- package/build/hooks/use_message_create_or_update.js.map +1 -1
- package/build/screens/attachment_actions/hooks/useDeleteAttachment.d.ts.map +1 -1
- package/build/screens/attachment_actions/hooks/useDeleteAttachment.js +2 -0
- package/build/screens/attachment_actions/hooks/useDeleteAttachment.js.map +1 -1
- package/build/screens/bug_report_screen.d.ts.map +1 -1
- package/build/screens/bug_report_screen.js +13 -7
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +8 -2
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +2 -0
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +3 -0
- package/build/screens/conversation_new/components/services_form.js.map +1 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +8 -7
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js +13 -3
- package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +2 -0
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/design_system_screen.js +13 -8
- package/build/screens/design_system_screen.js.map +1 -1
- package/build/screens/message_actions_screen.d.ts.map +1 -1
- package/build/screens/message_actions_screen.js +1 -0
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/send_giphy_screen.d.ts.map +1 -1
- package/build/screens/send_giphy_screen.js +10 -5
- package/build/screens/send_giphy_screen.js.map +1 -1
- package/package.json +2 -2
- package/src/components/conversation/empty_conversation_blank_state.tsx +10 -6
- package/src/components/conversations/conversation_actions.tsx +3 -3
- package/src/components/conversations/conversations.tsx +7 -2
- package/src/components/conversations/{action_toggle_button.tsx → swipeable_toggle_button.tsx} +9 -5
- package/src/components/display/index.ts +0 -1
- package/src/components/primitive/blank_state_primitive.tsx +194 -0
- package/src/hooks/use_conversation.ts +2 -0
- package/src/hooks/use_message_create_or_update.ts +3 -0
- package/src/screens/attachment_actions/hooks/useDeleteAttachment.tsx +2 -0
- package/src/screens/bug_report_screen.tsx +17 -15
- package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +11 -2
- package/src/screens/conversation_new/components/groups_form.tsx +2 -0
- package/src/screens/conversation_new/components/services_form.tsx +2 -0
- package/src/screens/conversation_screen.tsx +13 -11
- package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx +17 -6
- package/src/screens/conversations/components/list_header_component.tsx +2 -0
- package/src/screens/design_system_screen.tsx +17 -13
- package/src/screens/message_actions_screen.tsx +1 -0
- package/src/screens/send_giphy_screen.tsx +10 -11
- package/build/components/conversations/action_toggle_button.d.ts.map +0 -1
- package/build/components/conversations/action_toggle_button.js.map +0 -1
- package/build/components/display/blank_state.d.ts +0 -18
- package/build/components/display/blank_state.d.ts.map +0 -1
- package/build/components/display/blank_state.js +0 -47
- package/build/components/display/blank_state.js.map +0 -1
- package/src/components/display/blank_state.tsx +0 -76
package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useNavigation } from '@react-navigation/native'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import { ScrollView, StyleSheet, View } from 'react-native'
|
|
4
|
-
import {
|
|
4
|
+
import { Button, Heading } from '../../components'
|
|
5
|
+
import BlankState from '../../components/primitive/blank_state_primitive'
|
|
5
6
|
import { GroupsGroupResource } from '../../types'
|
|
6
7
|
import { useGroupsGroups } from '../../hooks/use_groups_groups'
|
|
7
8
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
@@ -95,10 +96,7 @@ export const ConversationSelectRecipientsScreen = ({
|
|
|
95
96
|
{isGroupsFetching ? (
|
|
96
97
|
<DefaultLoading />
|
|
97
98
|
) : groupsWithCreatePermission.length === 0 ? (
|
|
98
|
-
<
|
|
99
|
-
subtitle="Join a group with chat enabled and permissions to start a new conversation."
|
|
100
|
-
style={styles.blankState}
|
|
101
|
-
/>
|
|
99
|
+
<RecipientsBlankState subtitle="Join a group with chat enabled and permissions to start a new conversation." />
|
|
102
100
|
) : (
|
|
103
101
|
<>
|
|
104
102
|
{visibleGroups.map(group => {
|
|
@@ -167,7 +165,7 @@ export const ConversationSelectRecipientsScreen = ({
|
|
|
167
165
|
)}
|
|
168
166
|
</>
|
|
169
167
|
) : (
|
|
170
|
-
<
|
|
168
|
+
<RecipientsBlankState subtitle="You don't lead any teams." />
|
|
171
169
|
)}
|
|
172
170
|
</View>
|
|
173
171
|
</View>
|
|
@@ -176,6 +174,19 @@ export const ConversationSelectRecipientsScreen = ({
|
|
|
176
174
|
)
|
|
177
175
|
}
|
|
178
176
|
|
|
177
|
+
const RecipientsBlankState = ({ subtitle }: { subtitle: string }) => {
|
|
178
|
+
const styles = useStyles()
|
|
179
|
+
|
|
180
|
+
return (
|
|
181
|
+
<BlankState.Root style={styles.blankState}>
|
|
182
|
+
<BlankState.Imagery name="general.outlinedTextMessage" />
|
|
183
|
+
<BlankState.Content>
|
|
184
|
+
<BlankState.Text>{subtitle}</BlankState.Text>
|
|
185
|
+
</BlankState.Content>
|
|
186
|
+
</BlankState.Root>
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
|
|
179
190
|
const useStyles = () => {
|
|
180
191
|
const { bottom } = useSafeAreaInsets()
|
|
181
192
|
|
|
@@ -7,6 +7,7 @@ import { useMarkAllRead } from '../../../hooks/use_conversations_actions'
|
|
|
7
7
|
import { useCanDisplayGroups } from '../../../hooks/use_groups'
|
|
8
8
|
import { ConversationsScreenProps } from '../conversations_screen'
|
|
9
9
|
import { ChatGroupBadge } from './chat_group_badge'
|
|
10
|
+
import { Haptic } from '../../../utils/native_adapters'
|
|
10
11
|
|
|
11
12
|
const ROW_PADDING_HORIZONTAL = 16
|
|
12
13
|
|
|
@@ -41,6 +42,7 @@ export const ListHeaderComponent = () => {
|
|
|
41
42
|
|
|
42
43
|
const handleMarkAllRead = useCallback(() => {
|
|
43
44
|
currentPersonCache.update({ unreadCount: 0 })
|
|
45
|
+
Haptic.notificationSuccess()
|
|
44
46
|
markAllRead()
|
|
45
47
|
}, [currentPersonCache, markAllRead])
|
|
46
48
|
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
Badge,
|
|
9
9
|
Banner,
|
|
10
10
|
BannerCollapsible,
|
|
11
|
-
BlankState,
|
|
12
11
|
Button,
|
|
13
12
|
ToggleButton,
|
|
14
13
|
Heading,
|
|
@@ -23,6 +22,7 @@ import {
|
|
|
23
22
|
TextInlineButton,
|
|
24
23
|
ImageAttachmentPreview,
|
|
25
24
|
} from '../components/display'
|
|
25
|
+
import BlankState from '../components/primitive/blank_state_primitive'
|
|
26
26
|
import {
|
|
27
27
|
MAX_FONT_SIZE_MULTIPLIER,
|
|
28
28
|
platformPressedOpacityStyle,
|
|
@@ -1056,20 +1056,24 @@ function MiscComponentsSection({ isLast }: SectionProps) {
|
|
|
1056
1056
|
</Group>
|
|
1057
1057
|
<Group
|
|
1058
1058
|
title="BlankState"
|
|
1059
|
-
description="
|
|
1059
|
+
description="Compound component with primitives to display imagary, heading, title, and a button."
|
|
1060
1060
|
>
|
|
1061
1061
|
<Column>
|
|
1062
|
-
<BlankState
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1062
|
+
<BlankState.Root>
|
|
1063
|
+
<BlankState.Imagery name="general.outlinedTextMessage" />
|
|
1064
|
+
<BlankState.Content>
|
|
1065
|
+
<BlankState.Heading>No messages</BlankState.Heading>
|
|
1066
|
+
<BlankState.Text>
|
|
1067
|
+
Conversation is hidden from everyone until you send a message.
|
|
1068
|
+
</BlankState.Text>
|
|
1069
|
+
</BlankState.Content>
|
|
1070
|
+
<BlankState.Button
|
|
1071
|
+
onPress={buttonPress}
|
|
1072
|
+
title="Go back"
|
|
1073
|
+
accessibilityHint="Navigates back to the conversations list"
|
|
1074
|
+
accessibilityRole="link"
|
|
1075
|
+
/>
|
|
1076
|
+
</BlankState.Root>
|
|
1073
1077
|
</Column>
|
|
1074
1078
|
</Group>
|
|
1075
1079
|
</CollapsableSection>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import { Image as NativeImage, Platform, StyleSheet, useWindowDimensions, View } from 'react-native'
|
|
4
|
-
import {
|
|
4
|
+
import { Button, IconButton, IconString, TextButton } from '../components'
|
|
5
|
+
import BlankState from '../components/primitive/blank_state_primitive'
|
|
5
6
|
import { DefaultLoading } from '../components/page/loading'
|
|
6
7
|
import FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'
|
|
7
8
|
import { useCreateAndroidRippleColor, useTheme } from '../hooks'
|
|
@@ -36,16 +37,14 @@ export function SendGiphyScreen({ route }: SendGiphyScreenProps) {
|
|
|
36
37
|
if (!result)
|
|
37
38
|
return (
|
|
38
39
|
<FormSheet.Root contentStyle={styles.blankStateContainer}>
|
|
39
|
-
<BlankState
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}}
|
|
48
|
-
/>
|
|
40
|
+
<BlankState.Root style={styles.blankState}>
|
|
41
|
+
<BlankState.Imagery name="general.bolt" />
|
|
42
|
+
<BlankState.Content>
|
|
43
|
+
<BlankState.Heading>No Giphys found</BlankState.Heading>
|
|
44
|
+
<BlankState.Text>Try a different search term.</BlankState.Text>
|
|
45
|
+
</BlankState.Content>
|
|
46
|
+
<BlankState.Button onPress={() => navigation.goBack()} title="Close" />
|
|
47
|
+
</BlankState.Root>
|
|
49
48
|
</FormSheet.Root>
|
|
50
49
|
)
|
|
51
50
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action_toggle_button.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/action_toggle_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7E,OAAO,EAAQ,UAAU,EAAiB,MAAM,YAAY,CAAA;AAK5D,UAAU,uBAAwB,SAAQ,cAAc;IACtD,eAAe,EAAE,MAAM,CAAA;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE;QACb,IAAI,EAAE;YAAE,QAAQ,EAAE,UAAU,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;QAC7C,KAAK,EAAE;YAAE,QAAQ,EAAE,UAAU,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;KAC/C,CAAA;IACD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,eAAe,EACf,OAAO,EACP,aAAa,EACb,QAAgB,EAChB,OAAO,EACP,OAAe,EACf,GAAG,KAAK,EACT,EAAE,uBAAuB,qBA8BzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action_toggle_button.js","sourceRoot":"","sources":["../../../src/components/conversations/action_toggle_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,SAAS,EAAuB,MAAM,8BAA8B,CAAA;AAC7E,OAAO,EAAE,IAAI,EAAc,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,2BAA2B,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAYrD,MAAM,U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,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1C;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,IAAI,CACR;QAAA,GAAG,CACJ,CACH;IAAA,EAAE,SAAS,CAAC,CACb,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,EAAE,eAAe,EAAE,QAAQ,EAAoC,EAAE,EAAE;IACpF,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAA;IAC1F,MAAM,qBAAqB,GAAG,QAAQ;QACpC,CAAC,CAAC,MAAM,CAAC,mCAAmC;QAC5C,CAAC,CAAC,eAAe,CAAA;IAEnB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,MAAM,EAAE;YACN,IAAI,EAAE,CAAC;YACP,aAAa,EAAE,QAAQ;YACvB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,GAAG,EAAE,CAAC;YACN,MAAM,EAAE,MAAM;YACd,eAAe,EAAE,qBAAqB;SACvC;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,CAAC;SACb;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,wBAAwB;SACrC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet } from 'react-native'\nimport { Pressable, type PressableProps } from 'react-native-gesture-handler'\nimport { Icon, IconString, Spinner, Text } from '../display'\nimport { useCreateAndroidRippleColor, useTheme } from '../../hooks'\nimport { platformFontWeightMedium, platformPressedOpacityStyle } from '../../utils/styles'\nimport { tokens } from '../../vendor/tapestry/tokens'\n\ninterface ActionToggleButtonProps extends PressableProps {\n backgroundColor: string\n toggled: boolean\n toggleContent: {\n true: { iconName: IconString; label: string }\n false: { iconName: IconString; label: string }\n }\n loading?: boolean\n}\n\nexport function ActionToggleButton({\n backgroundColor,\n onPress,\n toggleContent,\n disabled = false,\n toggled,\n loading = false,\n ...props\n}: ActionToggleButtonProps) {\n const styles = useStyles({ backgroundColor, disabled })\n const androidRippleColor = useCreateAndroidRippleColor({\n color: backgroundColor,\n })\n\n const { iconName, label } = toggleContent[toggled ? 'true' : 'false']\n\n return (\n <Pressable\n onPress={onPress}\n style={({ pressed }) => [styles.button, pressed && platformPressedOpacityStyle]}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n disabled={disabled || loading}\n accessibilityRole=\"togglebutton\"\n accessibilityState={{ checked: toggled }}\n {...props}\n >\n {loading ? (\n <Spinner size={20} />\n ) : (\n <>\n <Icon name={iconName} style={styles.icon} size={20} />\n <Text variant=\"footnote\" style={styles.text}>\n {label}\n </Text>\n </>\n )}\n </Pressable>\n )\n}\n\nconst useStyles = ({ backgroundColor, disabled }: Partial<ActionToggleButtonProps>) => {\n const { colors } = useTheme()\n const fillColor = disabled ? colors.textColorDefaultDisabled : tokens.colorNeutral100White\n const buttonBackgroundColor = disabled\n ? colors.fillColorButtonNeutralSolidDisabled\n : backgroundColor\n\n return StyleSheet.create({\n button: {\n flex: 1,\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n height: '100%',\n backgroundColor: buttonBackgroundColor,\n },\n icon: {\n color: fillColor,\n marginTop: 4,\n },\n text: {\n color: fillColor,\n fontWeight: platformFontWeightMedium,\n },\n })\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type ViewStyle } from 'react-native';
|
|
2
|
-
import { type HeadingProps } from './heading';
|
|
3
|
-
import { type IconString, type IconStyle } from './icon';
|
|
4
|
-
import { type TextProps } from './text';
|
|
5
|
-
import { type ButtonProps } from './button';
|
|
6
|
-
interface BlankStateProps {
|
|
7
|
-
iconName?: IconString;
|
|
8
|
-
iconStyle?: IconStyle;
|
|
9
|
-
title?: string;
|
|
10
|
-
titleStyle?: HeadingProps['style'];
|
|
11
|
-
subtitle?: string;
|
|
12
|
-
subtitleStyle?: TextProps['style'];
|
|
13
|
-
style?: ViewStyle;
|
|
14
|
-
buttonProps?: ButtonProps;
|
|
15
|
-
}
|
|
16
|
-
export declare const BlankState: ({ iconName, title, titleStyle, subtitle, subtitleStyle, style, iconStyle, buttonProps, }: BlankStateProps) => import("react").JSX.Element;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=blank_state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blank_state.d.ts","sourceRoot":"","sources":["../../../src/components/display/blank_state.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAc,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC9D,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAEnD,UAAU,eAAe;IACvB,QAAQ,CAAC,EAAE,UAAU,CAAA;IACrB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAA;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAClC,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED,eAAO,MAAM,UAAU,6FASpB,eAAe,gCAsBjB,CAAA"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { View, StyleSheet } from 'react-native';
|
|
2
|
-
import { Heading } from './heading';
|
|
3
|
-
import { Icon } from './icon';
|
|
4
|
-
import { Text } from './text';
|
|
5
|
-
import { useTheme } from '../../hooks';
|
|
6
|
-
import { Button } from './button';
|
|
7
|
-
export const BlankState = ({ iconName, title, titleStyle, subtitle, subtitleStyle, style, iconStyle, buttonProps, }) => {
|
|
8
|
-
const styles = useStyles();
|
|
9
|
-
return (<View style={[styles.container, style]}>
|
|
10
|
-
{iconName && <Icon name={iconName} size={32} style={[styles.icon, iconStyle]}/>}
|
|
11
|
-
|
|
12
|
-
<View style={styles.content}>
|
|
13
|
-
{title && (<Heading variant="h3" style={[styles.baseText, titleStyle]}>
|
|
14
|
-
{title}
|
|
15
|
-
</Heading>)}
|
|
16
|
-
{subtitle && (<Text variant="tertiary" style={[styles.baseText, subtitleStyle]}>
|
|
17
|
-
{subtitle}
|
|
18
|
-
</Text>)}
|
|
19
|
-
</View>
|
|
20
|
-
{buttonProps && <Button variant="outline" size="sm" {...buttonProps}/>}
|
|
21
|
-
</View>);
|
|
22
|
-
};
|
|
23
|
-
const useStyles = () => {
|
|
24
|
-
const { colors } = useTheme();
|
|
25
|
-
return StyleSheet.create({
|
|
26
|
-
container: {
|
|
27
|
-
flex: 1,
|
|
28
|
-
alignItems: 'center',
|
|
29
|
-
justifyContent: 'center',
|
|
30
|
-
gap: 16,
|
|
31
|
-
padding: 16,
|
|
32
|
-
},
|
|
33
|
-
icon: {
|
|
34
|
-
color: colors.iconColorDefaultDisabled,
|
|
35
|
-
},
|
|
36
|
-
content: {
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
gap: 4,
|
|
39
|
-
maxWidth: 250,
|
|
40
|
-
},
|
|
41
|
-
baseText: {
|
|
42
|
-
textAlign: 'center',
|
|
43
|
-
color: colors.textColorDefaultSecondary,
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=blank_state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blank_state.js","sourceRoot":"","sources":["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AQ,EAAE,aAAa,CAAC,CAAC,CAC/D;YAAA,CAAC,QAAQ,CACX;UAAA,EAAE,IAAI,CAAC,CACR,CACH;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,EAAG,CACzE;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,IAAI,EAAE,CAAC;YACP,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,GAAG,EAAE,EAAE;YACP,OAAO,EAAE,EAAE;SACZ;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM,CAAC,wBAAwB;SACvC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;YACN,QAAQ,EAAE,GAAG;SACd;QACD,QAAQ,EAAE;YACR,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,MAAM,CAAC,yBAAyB;SACxC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { View, type ViewStyle, StyleSheet } from 'react-native'\nimport { Heading, type HeadingProps } from './heading'\nimport { Icon, type IconString, type IconStyle } from './icon'\nimport { Text, type TextProps } from './text'\nimport { useTheme } from '../../hooks'\nimport { Button, type ButtonProps } from './button'\n\ninterface BlankStateProps {\n iconName?: IconString\n iconStyle?: IconStyle\n title?: string\n titleStyle?: HeadingProps['style']\n subtitle?: string\n subtitleStyle?: TextProps['style']\n style?: ViewStyle\n buttonProps?: ButtonProps\n}\n\nexport const BlankState = ({\n iconName,\n title,\n titleStyle,\n subtitle,\n subtitleStyle,\n style,\n iconStyle,\n buttonProps,\n}: BlankStateProps) => {\n const styles = useStyles()\n\n return (\n <View style={[styles.container, style]}>\n {iconName && <Icon name={iconName} size={32} style={[styles.icon, iconStyle]} />}\n\n <View style={styles.content}>\n {title && (\n <Heading variant=\"h3\" style={[styles.baseText, titleStyle]}>\n {title}\n </Heading>\n )}\n {subtitle && (\n <Text variant=\"tertiary\" style={[styles.baseText, subtitleStyle]}>\n {subtitle}\n </Text>\n )}\n </View>\n {buttonProps && <Button variant=\"outline\" size=\"sm\" {...buttonProps} />}\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n gap: 16,\n padding: 16,\n },\n icon: {\n color: colors.iconColorDefaultDisabled,\n },\n content: {\n alignItems: 'center',\n gap: 4,\n maxWidth: 250,\n },\n baseText: {\n textAlign: 'center',\n color: colors.textColorDefaultSecondary,\n },\n })\n}\n"]}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { View, type ViewStyle, StyleSheet } from 'react-native'
|
|
2
|
-
import { Heading, type HeadingProps } from './heading'
|
|
3
|
-
import { Icon, type IconString, type IconStyle } from './icon'
|
|
4
|
-
import { Text, type TextProps } from './text'
|
|
5
|
-
import { useTheme } from '../../hooks'
|
|
6
|
-
import { Button, type ButtonProps } from './button'
|
|
7
|
-
|
|
8
|
-
interface BlankStateProps {
|
|
9
|
-
iconName?: IconString
|
|
10
|
-
iconStyle?: IconStyle
|
|
11
|
-
title?: string
|
|
12
|
-
titleStyle?: HeadingProps['style']
|
|
13
|
-
subtitle?: string
|
|
14
|
-
subtitleStyle?: TextProps['style']
|
|
15
|
-
style?: ViewStyle
|
|
16
|
-
buttonProps?: ButtonProps
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const BlankState = ({
|
|
20
|
-
iconName,
|
|
21
|
-
title,
|
|
22
|
-
titleStyle,
|
|
23
|
-
subtitle,
|
|
24
|
-
subtitleStyle,
|
|
25
|
-
style,
|
|
26
|
-
iconStyle,
|
|
27
|
-
buttonProps,
|
|
28
|
-
}: BlankStateProps) => {
|
|
29
|
-
const styles = useStyles()
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<View style={[styles.container, style]}>
|
|
33
|
-
{iconName && <Icon name={iconName} size={32} style={[styles.icon, iconStyle]} />}
|
|
34
|
-
|
|
35
|
-
<View style={styles.content}>
|
|
36
|
-
{title && (
|
|
37
|
-
<Heading variant="h3" style={[styles.baseText, titleStyle]}>
|
|
38
|
-
{title}
|
|
39
|
-
</Heading>
|
|
40
|
-
)}
|
|
41
|
-
{subtitle && (
|
|
42
|
-
<Text variant="tertiary" style={[styles.baseText, subtitleStyle]}>
|
|
43
|
-
{subtitle}
|
|
44
|
-
</Text>
|
|
45
|
-
)}
|
|
46
|
-
</View>
|
|
47
|
-
{buttonProps && <Button variant="outline" size="sm" {...buttonProps} />}
|
|
48
|
-
</View>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const useStyles = () => {
|
|
53
|
-
const { colors } = useTheme()
|
|
54
|
-
|
|
55
|
-
return StyleSheet.create({
|
|
56
|
-
container: {
|
|
57
|
-
flex: 1,
|
|
58
|
-
alignItems: 'center',
|
|
59
|
-
justifyContent: 'center',
|
|
60
|
-
gap: 16,
|
|
61
|
-
padding: 16,
|
|
62
|
-
},
|
|
63
|
-
icon: {
|
|
64
|
-
color: colors.iconColorDefaultDisabled,
|
|
65
|
-
},
|
|
66
|
-
content: {
|
|
67
|
-
alignItems: 'center',
|
|
68
|
-
gap: 4,
|
|
69
|
-
maxWidth: 250,
|
|
70
|
-
},
|
|
71
|
-
baseText: {
|
|
72
|
-
textAlign: 'center',
|
|
73
|
-
color: colors.textColorDefaultSecondary,
|
|
74
|
-
},
|
|
75
|
-
})
|
|
76
|
-
}
|