@kiosinc/commons-rn 0.1.100 → 0.1.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/assets/icons/placeholderImage.svg +16 -8
- package/lib/commonjs/components/Alert.js +6 -3
- package/lib/commonjs/components/Alert.js.map +1 -1
- package/lib/commonjs/components/FirebaseMedia.js +13 -7
- package/lib/commonjs/components/FirebaseMedia.js.map +1 -1
- package/lib/commonjs/components/Header.js +85 -33
- package/lib/commonjs/components/Header.js.map +1 -1
- package/lib/commonjs/components/Image.js +23 -5
- package/lib/commonjs/components/Image.js.map +1 -1
- package/lib/commonjs/components/Modal.js +39 -0
- package/lib/commonjs/components/Modal.js.map +1 -0
- package/lib/commonjs/components/ModalHeader.js +83 -0
- package/lib/commonjs/components/ModalHeader.js.map +1 -0
- package/lib/commonjs/components/RippleCard.js +26 -0
- package/lib/commonjs/components/RippleCard.js.map +1 -0
- package/lib/commonjs/components/Searchbar.js +26 -3
- package/lib/commonjs/components/Searchbar.js.map +1 -1
- package/lib/commonjs/components/index.js +21 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/helpers/getVectorIcon.js +42 -0
- package/lib/commonjs/helpers/getVectorIcon.js.map +1 -0
- package/lib/commonjs/screens/SavedCards/CardRow.js +9 -2
- package/lib/commonjs/screens/SavedCards/CardRow.js.map +1 -1
- package/lib/commonjs/screens/SelectBusiness/SelectBusiness.js +30 -15
- package/lib/commonjs/screens/SelectBusiness/SelectBusiness.js.map +1 -1
- package/lib/commonjs/utils/analytics.js +2 -0
- package/lib/commonjs/utils/analytics.js.map +1 -1
- package/lib/commonjs/utils/index.js +12 -1
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/useMultiSnapModal.js +28 -0
- package/lib/commonjs/utils/useMultiSnapModal.js.map +1 -0
- package/lib/module/assets/icons/placeholderImage.svg +16 -8
- package/lib/module/components/Alert.js +6 -3
- package/lib/module/components/Alert.js.map +1 -1
- package/lib/module/components/FirebaseMedia.js +13 -7
- package/lib/module/components/FirebaseMedia.js.map +1 -1
- package/lib/module/components/Header.js +87 -34
- package/lib/module/components/Header.js.map +1 -1
- package/lib/module/components/Image.js +24 -5
- package/lib/module/components/Image.js.map +1 -1
- package/lib/module/components/Modal.js +31 -0
- package/lib/module/components/Modal.js.map +1 -0
- package/lib/module/components/ModalHeader.js +76 -0
- package/lib/module/components/ModalHeader.js.map +1 -0
- package/lib/module/components/RippleCard.js +18 -0
- package/lib/module/components/RippleCard.js.map +1 -0
- package/lib/module/components/Searchbar.js +24 -2
- package/lib/module/components/Searchbar.js.map +1 -1
- package/lib/module/components/index.js +3 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/helpers/getVectorIcon.js +34 -0
- package/lib/module/helpers/getVectorIcon.js.map +1 -0
- package/lib/module/screens/SavedCards/CardRow.js +9 -2
- package/lib/module/screens/SavedCards/CardRow.js.map +1 -1
- package/lib/module/screens/SelectBusiness/SelectBusiness.js +33 -17
- package/lib/module/screens/SelectBusiness/SelectBusiness.js.map +1 -1
- package/lib/module/utils/analytics.js +2 -0
- package/lib/module/utils/analytics.js.map +1 -1
- package/lib/module/utils/index.js +4 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/useMultiSnapModal.js +21 -0
- package/lib/module/utils/useMultiSnapModal.js.map +1 -0
- package/lib/typescript/src/components/Alert.d.ts.map +1 -1
- package/lib/typescript/src/components/FirebaseMedia.d.ts.map +1 -1
- package/lib/typescript/src/components/Header.d.ts +7 -2
- package/lib/typescript/src/components/Header.d.ts.map +1 -1
- package/lib/typescript/src/components/Image.d.ts +4 -2
- package/lib/typescript/src/components/Image.d.ts.map +1 -1
- package/lib/typescript/src/components/Modal.d.ts +4 -0
- package/lib/typescript/src/components/Modal.d.ts.map +1 -0
- package/lib/typescript/src/components/ModalHeader.d.ts +16 -0
- package/lib/typescript/src/components/ModalHeader.d.ts.map +1 -0
- package/lib/typescript/src/components/OtpInputs.d.ts +1 -1
- package/lib/typescript/src/components/RippleCard.d.ts +4 -0
- package/lib/typescript/src/components/RippleCard.d.ts.map +1 -0
- package/lib/typescript/src/components/Searchbar.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts +3 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/helpers/getVectorIcon.d.ts +8857 -0
- package/lib/typescript/src/helpers/getVectorIcon.d.ts.map +1 -0
- package/lib/typescript/src/screens/SavedCards/CardRow.d.ts.map +1 -1
- package/lib/typescript/src/screens/SelectBusiness/SelectBusiness.d.ts.map +1 -1
- package/lib/typescript/src/utils/analytics.d.ts +5 -0
- package/lib/typescript/src/utils/analytics.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +2 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/useMultiSnapModal.d.ts +15 -0
- package/lib/typescript/src/utils/useMultiSnapModal.d.ts.map +1 -0
- package/package.json +8 -2
- package/src/assets/icons/placeholderImage.svg +16 -8
- package/src/components/Alert.tsx +6 -3
- package/src/components/FirebaseMedia.tsx +11 -3
- package/src/components/Header.tsx +127 -39
- package/src/components/Image.tsx +29 -8
- package/src/components/Modal.tsx +33 -0
- package/src/components/ModalHeader.tsx +129 -0
- package/src/components/RippleCard.tsx +16 -0
- package/src/components/Searchbar.tsx +31 -2
- package/src/components/index.ts +3 -0
- package/src/helpers/getVectorIcon.tsx +44 -0
- package/src/screens/SavedCards/CardRow.tsx +9 -2
- package/src/screens/SelectBusiness/SelectBusiness.tsx +42 -25
- package/src/utils/analytics.ts +5 -1
- package/src/utils/index.ts +5 -0
- package/src/utils/useMultiSnapModal.ts +30 -0
- package/lib/commonjs/assets/icons/tick.svg +0 -3
- package/lib/module/assets/icons/tick.svg +0 -3
- package/src/assets/icons/tick.svg +0 -3
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Text } from '../components';
|
|
3
|
+
import { Appbar, Menu, useTheme } from 'react-native-paper';
|
|
4
|
+
import { IconButton } from '../components';
|
|
5
|
+
import { View } from '../components';
|
|
6
|
+
import { type GestureResponderEvent, type ViewProps } from 'react-native';
|
|
7
|
+
import {
|
|
8
|
+
useRestyle,
|
|
9
|
+
spacing,
|
|
10
|
+
border,
|
|
11
|
+
backgroundColor,
|
|
12
|
+
backgroundColorShorthand,
|
|
13
|
+
type SpacingProps,
|
|
14
|
+
type BorderProps,
|
|
15
|
+
type BackgroundColorProps,
|
|
16
|
+
composeRestyleFunctions,
|
|
17
|
+
type SpacingShorthandProps,
|
|
18
|
+
type LayoutProps,
|
|
19
|
+
type PositionProps,
|
|
20
|
+
spacingShorthand,
|
|
21
|
+
layout,
|
|
22
|
+
position,
|
|
23
|
+
type BackgroundColorShorthandProps,
|
|
24
|
+
} from '@shopify/restyle';
|
|
25
|
+
import { type ThemeType } from '../theme';
|
|
26
|
+
import { MenuItemProps } from 'react-native-paper';
|
|
27
|
+
import { Keyboard } from 'react-native';
|
|
28
|
+
type RestyleProps = SpacingProps<ThemeType> &
|
|
29
|
+
SpacingShorthandProps<ThemeType> &
|
|
30
|
+
LayoutProps<ThemeType> &
|
|
31
|
+
PositionProps<ThemeType> &
|
|
32
|
+
BorderProps<ThemeType> &
|
|
33
|
+
BackgroundColorProps<ThemeType> &
|
|
34
|
+
BackgroundColorShorthandProps<ThemeType>;
|
|
35
|
+
|
|
36
|
+
const restyleFunctions = composeRestyleFunctions<ThemeType, RestyleProps>([
|
|
37
|
+
spacing,
|
|
38
|
+
spacingShorthand,
|
|
39
|
+
layout,
|
|
40
|
+
position,
|
|
41
|
+
border,
|
|
42
|
+
backgroundColor,
|
|
43
|
+
backgroundColorShorthand,
|
|
44
|
+
]);
|
|
45
|
+
|
|
46
|
+
type Props = RestyleProps &
|
|
47
|
+
ViewProps & {
|
|
48
|
+
handleClose?: () => void;
|
|
49
|
+
handleBack?: () => void;
|
|
50
|
+
title?: string;
|
|
51
|
+
customRightOptions?: React.ReactNode;
|
|
52
|
+
menuOptions?: Array<MenuItemProps>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const ModalHeader: React.FC<Props> = ({
|
|
56
|
+
handleBack,
|
|
57
|
+
handleClose,
|
|
58
|
+
title,
|
|
59
|
+
menuOptions,
|
|
60
|
+
customRightOptions = null,
|
|
61
|
+
...rest
|
|
62
|
+
}) => {
|
|
63
|
+
const props = useRestyle(restyleFunctions, rest);
|
|
64
|
+
const [visible, setVisible] = React.useState(false);
|
|
65
|
+
const theme = useTheme();
|
|
66
|
+
|
|
67
|
+
const openMenu = () => {
|
|
68
|
+
Keyboard.dismiss();
|
|
69
|
+
setVisible(true);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const closeMenu = () => setVisible(false);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<View height={60} flexDirection="row" {...(props as ViewProps)}>
|
|
76
|
+
{handleBack ? (
|
|
77
|
+
<IconButton icon="arrow-left" onPress={handleBack} />
|
|
78
|
+
) : (
|
|
79
|
+
<View px={'8'} />
|
|
80
|
+
)}
|
|
81
|
+
<View flexDirection="row" flex={1}>
|
|
82
|
+
<Text
|
|
83
|
+
flex={1}
|
|
84
|
+
pt={'12'}
|
|
85
|
+
variant="titleMedium"
|
|
86
|
+
color="onSurface"
|
|
87
|
+
flexShrink={1}
|
|
88
|
+
>
|
|
89
|
+
{title}
|
|
90
|
+
</Text>
|
|
91
|
+
</View>
|
|
92
|
+
{menuOptions && (
|
|
93
|
+
<Menu
|
|
94
|
+
style={{
|
|
95
|
+
backgroundColor: theme.colors.background,
|
|
96
|
+
}}
|
|
97
|
+
contentStyle={{
|
|
98
|
+
backgroundColor: theme.colors.background,
|
|
99
|
+
}}
|
|
100
|
+
visible={visible}
|
|
101
|
+
onDismiss={closeMenu}
|
|
102
|
+
anchor={<Appbar.Action icon="dots-vertical" onPress={openMenu} />}
|
|
103
|
+
>
|
|
104
|
+
{menuOptions.map((menuOption, index) => {
|
|
105
|
+
const onPress = (e: GestureResponderEvent) => {
|
|
106
|
+
closeMenu();
|
|
107
|
+
menuOption?.onPress?.(e);
|
|
108
|
+
};
|
|
109
|
+
return (
|
|
110
|
+
<Menu.Item
|
|
111
|
+
key={String(index)}
|
|
112
|
+
style={{
|
|
113
|
+
backgroundColor: theme.colors.background,
|
|
114
|
+
}}
|
|
115
|
+
{...menuOption}
|
|
116
|
+
onPress={onPress}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
})}
|
|
120
|
+
</Menu>
|
|
121
|
+
)}
|
|
122
|
+
{customRightOptions}
|
|
123
|
+
{!menuOptions && !customRightOptions && <View width={40} />}
|
|
124
|
+
{Boolean(handleClose) && (
|
|
125
|
+
<IconButton icon="close" onPress={handleClose} />
|
|
126
|
+
)}
|
|
127
|
+
</View>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Ripple, { RippleProps } from 'react-native-material-ripple';
|
|
3
|
+
|
|
4
|
+
export const RippleCard = ({ children, ...rest }: RippleProps) => {
|
|
5
|
+
return (
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
<Ripple
|
|
8
|
+
{...rest}
|
|
9
|
+
rippleSize={244}
|
|
10
|
+
rippleContainerBorderRadius={8}
|
|
11
|
+
rippleOpacity={0.2}
|
|
12
|
+
>
|
|
13
|
+
{children}
|
|
14
|
+
</Ripple>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
2
|
import { Searchbar as S, type SearchbarProps } from 'react-native-paper';
|
|
3
3
|
import {
|
|
4
4
|
useRestyle,
|
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
type BackgroundColorShorthandProps,
|
|
20
20
|
} from '@shopify/restyle';
|
|
21
21
|
import { type ThemeType } from '../theme';
|
|
22
|
+
import { View, IconButton } from '../components';
|
|
23
|
+
import { StyleSheet } from 'react-native';
|
|
22
24
|
|
|
23
25
|
type RestyleProps = SpacingProps<ThemeType> &
|
|
24
26
|
SpacingShorthandProps<ThemeType> &
|
|
@@ -42,6 +44,33 @@ type Props = RestyleProps & SearchbarProps;
|
|
|
42
44
|
|
|
43
45
|
export const Searchbar = ({ ...rest }: Props) => {
|
|
44
46
|
const props = useRestyle(restyleFunctions as any, rest);
|
|
47
|
+
const ref = useRef<any>();
|
|
48
|
+
const icon = () => (
|
|
49
|
+
<View backgroundColor="inverseOnSurface">
|
|
50
|
+
<IconButton
|
|
51
|
+
icon="magnify"
|
|
52
|
+
backgroundColor={'inverseOnSurface'}
|
|
53
|
+
onPress={() => {
|
|
54
|
+
ref.current?.focus();
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
</View>
|
|
58
|
+
);
|
|
45
59
|
|
|
46
|
-
return
|
|
60
|
+
return (
|
|
61
|
+
<S
|
|
62
|
+
inputStyle={styles.inputStyle}
|
|
63
|
+
px="16"
|
|
64
|
+
ref={ref}
|
|
65
|
+
icon={icon}
|
|
66
|
+
{...props}
|
|
67
|
+
right={null as any}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
47
70
|
};
|
|
71
|
+
|
|
72
|
+
const styles = StyleSheet.create({
|
|
73
|
+
inputStyle: {
|
|
74
|
+
paddingRight: 16,
|
|
75
|
+
},
|
|
76
|
+
});
|
package/src/components/index.ts
CHANGED
|
@@ -30,3 +30,6 @@ export { FirebaseMedia } from './FirebaseMedia';
|
|
|
30
30
|
export { PhoneInput, type PCountry } from './PhoneInput';
|
|
31
31
|
export { DelayedRender } from './DelayedRender';
|
|
32
32
|
export { OfflineStrip } from './OfflineStrip';
|
|
33
|
+
export { ModalHeader } from './ModalHeader';
|
|
34
|
+
export { Modal } from './Modal';
|
|
35
|
+
export { RippleCard } from './RippleCard';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import IconFromMaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
3
|
+
import IconFromMaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
4
|
+
import IconFromMaterialIconsGlyphMap from 'react-native-vector-icons/glyphmaps/MaterialIcons.json';
|
|
5
|
+
import IconFromMaterialCommunityIconsGlyphMap from 'react-native-vector-icons/glyphmaps/MaterialCommunityIcons.json';
|
|
6
|
+
|
|
7
|
+
const IconMapping = {
|
|
8
|
+
material: {
|
|
9
|
+
Icon: IconFromMaterialIcons,
|
|
10
|
+
names: IconFromMaterialIconsGlyphMap,
|
|
11
|
+
},
|
|
12
|
+
materialCommunity: {
|
|
13
|
+
Icon: IconFromMaterialCommunityIcons,
|
|
14
|
+
names: IconFromMaterialCommunityIconsGlyphMap,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type IconMappingType = typeof IconMapping;
|
|
19
|
+
|
|
20
|
+
export const getVectorIcon =
|
|
21
|
+
({
|
|
22
|
+
type,
|
|
23
|
+
name,
|
|
24
|
+
}:
|
|
25
|
+
| {
|
|
26
|
+
type: 'material';
|
|
27
|
+
name: keyof IconMappingType['material']['names'];
|
|
28
|
+
}
|
|
29
|
+
| {
|
|
30
|
+
type: 'materialCommunity';
|
|
31
|
+
name: keyof IconMappingType['materialCommunity']['names'];
|
|
32
|
+
}) =>
|
|
33
|
+
({
|
|
34
|
+
size = 24,
|
|
35
|
+
color = 'onBackground',
|
|
36
|
+
}: {
|
|
37
|
+
size?: number;
|
|
38
|
+
color?: string;
|
|
39
|
+
}) => {
|
|
40
|
+
const { Icon } = IconMapping[type as keyof typeof IconMapping];
|
|
41
|
+
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
return <Icon name={name as string} size={size} color={color} />;
|
|
44
|
+
};
|
|
@@ -5,6 +5,7 @@ import { RadioButton, useTheme } from 'react-native-paper';
|
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { getCardName } from '../../utils/checkout';
|
|
7
7
|
import { CustomerCardPayment } from '@kiosinc/commons-types';
|
|
8
|
+
import { getVectorIcon } from '../../helpers/getVectorIcon';
|
|
8
9
|
|
|
9
10
|
export const CardRow = ({
|
|
10
11
|
card,
|
|
@@ -48,6 +49,10 @@ export const CardRow = ({
|
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
51
|
|
|
52
|
+
const PaymentIcon = getVectorIcon({
|
|
53
|
+
name: 'payment',
|
|
54
|
+
type: 'material',
|
|
55
|
+
});
|
|
51
56
|
const cardName = isApplePay ? 'Apple Pay' : getCardName(card!);
|
|
52
57
|
|
|
53
58
|
return (
|
|
@@ -89,14 +94,16 @@ export const CardRow = ({
|
|
|
89
94
|
justifyContent="space-between"
|
|
90
95
|
>
|
|
91
96
|
<View flexDirection="row" alignItems="center">
|
|
92
|
-
{isApplePay
|
|
97
|
+
{isApplePay ? (
|
|
93
98
|
<ApplePayIcon
|
|
94
99
|
height={24}
|
|
95
100
|
width={24}
|
|
96
101
|
color={theme.colors.onBackground}
|
|
97
102
|
/>
|
|
103
|
+
) : (
|
|
104
|
+
<PaymentIcon color={theme.colors.onSurface} />
|
|
98
105
|
)}
|
|
99
|
-
<Text ps={
|
|
106
|
+
<Text ps={'8'} variant="bodyMedium">
|
|
100
107
|
{cardName}
|
|
101
108
|
</Text>
|
|
102
109
|
</View>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import {
|
|
3
|
-
Card,
|
|
4
3
|
FAB,
|
|
5
4
|
Header,
|
|
6
5
|
LineLoader,
|
|
@@ -10,18 +9,23 @@ import {
|
|
|
10
9
|
Text,
|
|
11
10
|
View,
|
|
12
11
|
LinkButton,
|
|
12
|
+
RippleCard,
|
|
13
13
|
} from '../../components';
|
|
14
14
|
import { FlashList } from '@shopify/flash-list';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
ActivityIndicator,
|
|
18
|
+
Avatar,
|
|
19
|
+
Checkbox,
|
|
20
|
+
useTheme,
|
|
21
|
+
} from 'react-native-paper';
|
|
17
22
|
import { useMMKVString } from 'react-native-mmkv';
|
|
18
23
|
import { type NavigationProp, useNavigation } from '@react-navigation/native';
|
|
19
24
|
import { useQueryClient } from '@tanstack/react-query';
|
|
20
25
|
import { CreateBusinessBottomSheet } from './CreateBusinessBottomSheet';
|
|
21
26
|
import { useBusinesses, useLogout } from '../../hooks';
|
|
22
27
|
import { MMKV_KEYS } from '../../constants';
|
|
23
|
-
import { useSingleSnapBottomSheetRef } from '../../utils';
|
|
24
|
-
import Tick from '../../assets/icons/tick.svg';
|
|
28
|
+
import { getAvatarLetter, useSingleSnapBottomSheetRef } from '../../utils';
|
|
25
29
|
|
|
26
30
|
const BusinessCard = ({
|
|
27
31
|
business,
|
|
@@ -34,27 +38,38 @@ const BusinessCard = ({
|
|
|
34
38
|
}) => {
|
|
35
39
|
const theme = useTheme();
|
|
36
40
|
return (
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
41
|
+
<View mb="12" mt="2">
|
|
42
|
+
<RippleCard onPress={onSelect}>
|
|
43
|
+
<View p="16" height={56}>
|
|
44
|
+
<View height="100%" flexDirection="row" alignItems={'center'}>
|
|
45
|
+
<Avatar.Text
|
|
46
|
+
labelStyle={{
|
|
47
|
+
color: theme.colors.inverseSurface,
|
|
48
|
+
...theme.fonts.titleSmall,
|
|
49
|
+
}}
|
|
50
|
+
style={{
|
|
51
|
+
backgroundColor: theme.colors.inverseOnSurface,
|
|
52
|
+
}}
|
|
53
|
+
size={40}
|
|
54
|
+
label={getAvatarLetter(business.name)}
|
|
55
|
+
/>
|
|
56
|
+
<View
|
|
57
|
+
alignItems={'center'}
|
|
58
|
+
flexDirection="row"
|
|
59
|
+
justifyContent={'space-between'}
|
|
60
|
+
flex={1}
|
|
61
|
+
height={40}
|
|
62
|
+
pl="16"
|
|
63
|
+
>
|
|
64
|
+
<Text variant="bodyLarge">{business.name}</Text>
|
|
65
|
+
{isSelectedBusiness && (
|
|
66
|
+
<Checkbox.IOS onPress={onSelect} status={'checked'} />
|
|
67
|
+
)}
|
|
68
|
+
</View>
|
|
69
|
+
</View>
|
|
70
|
+
</View>
|
|
71
|
+
</RippleCard>
|
|
72
|
+
</View>
|
|
58
73
|
);
|
|
59
74
|
};
|
|
60
75
|
|
|
@@ -130,6 +145,7 @@ export const SelectBusiness = () => {
|
|
|
130
145
|
<View px="16" flex={1}>
|
|
131
146
|
<LineLoader isLoading={isFetching} />
|
|
132
147
|
<Searchbar
|
|
148
|
+
autoCorrect={false}
|
|
133
149
|
mb="12"
|
|
134
150
|
bg="inverseOnSurface"
|
|
135
151
|
value={searchText}
|
|
@@ -138,6 +154,7 @@ export const SelectBusiness = () => {
|
|
|
138
154
|
/>
|
|
139
155
|
{!isFetching && (
|
|
140
156
|
<FlashList
|
|
157
|
+
keyboardShouldPersistTaps={'always'}
|
|
141
158
|
refreshControl={
|
|
142
159
|
<RefreshControl refreshing={isRefetching} onRefresh={refetch} />
|
|
143
160
|
}
|
package/src/utils/analytics.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mixpanel } from 'mixpanel-react-native';
|
|
1
|
+
import { Mixpanel, MixpanelProperties } from 'mixpanel-react-native';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
import Config from 'react-native-config';
|
|
4
4
|
import auth from '@react-native-firebase/auth';
|
|
@@ -62,6 +62,10 @@ export const Analytics = {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
return {
|
|
65
|
+
registerSuperProperties: (properties: MixpanelProperties) =>
|
|
66
|
+
mixpanel.registerSuperProperties(properties),
|
|
67
|
+
unregisterSuperProperty: (propertyName: string) =>
|
|
68
|
+
mixpanel.unregisterSuperProperty(propertyName),
|
|
65
69
|
track: createTrackFunction<CommonEventTypes | T>(),
|
|
66
70
|
identify,
|
|
67
71
|
profile: {
|
package/src/utils/index.ts
CHANGED
|
@@ -29,3 +29,8 @@ export {
|
|
|
29
29
|
type TSingleSnapBottomSheetRef,
|
|
30
30
|
useSingleSnapBottomSheetRef,
|
|
31
31
|
} from './useSingleSnapBottomSheetRef';
|
|
32
|
+
export { type TMultiSnapModal, useMultiSnapModal } from './useMultiSnapModal';
|
|
33
|
+
|
|
34
|
+
export const getAvatarLetter = (string: any) => {
|
|
35
|
+
return string?.charAt(0)?.toUpperCase() ?? '';
|
|
36
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
export type TMultiSnapModal<T extends string> = {
|
|
4
|
+
selectedSnap?: T;
|
|
5
|
+
expand: (snap: T) => void;
|
|
6
|
+
close: () => any;
|
|
7
|
+
isVisible: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const useMultiSnapModal = <T extends string>({
|
|
11
|
+
initialSnap,
|
|
12
|
+
}: {
|
|
13
|
+
initialSnap?: T;
|
|
14
|
+
} = {}) => {
|
|
15
|
+
const [selectedSnap, setSelectedSnap] = useState(initialSnap);
|
|
16
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
17
|
+
const expand = (snap: T) => {
|
|
18
|
+
setSelectedSnap(snap);
|
|
19
|
+
setIsVisible(true);
|
|
20
|
+
};
|
|
21
|
+
const close = () => {
|
|
22
|
+
setIsVisible(false);
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
isVisible,
|
|
26
|
+
selectedSnap,
|
|
27
|
+
expand,
|
|
28
|
+
close,
|
|
29
|
+
};
|
|
30
|
+
};
|