@sendbird/uikit-react-native-foundation 1.0.0-rc.4 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/Image/index.js.map +1 -1
- package/lib/commonjs/styles/HeaderStyleContext.js.map +1 -1
- package/lib/commonjs/theme/UIKitThemeProvider.js.map +1 -1
- package/lib/commonjs/ui/ActionMenu/index.js.map +1 -1
- package/lib/commonjs/ui/Alert/index.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarGroup.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/commonjs/ui/Avatar/index.js.map +1 -1
- package/lib/commonjs/ui/Badge/index.js.map +1 -1
- package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
- package/lib/commonjs/ui/Button/index.js.map +1 -1
- package/lib/commonjs/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogBox.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/commonjs/ui/Dialog/index.js.map +1 -1
- package/lib/commonjs/ui/Divider/index.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/Header/index.js.map +1 -1
- package/lib/commonjs/ui/Icon/index.js.map +1 -1
- package/lib/commonjs/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/commonjs/ui/MenuBar/index.js.map +1 -1
- package/lib/commonjs/ui/Modal/index.js.map +1 -1
- package/lib/commonjs/ui/Placeholder/index.js.map +1 -1
- package/lib/commonjs/ui/Prompt/index.js.map +1 -1
- package/lib/commonjs/ui/Switch/index.js.map +1 -1
- package/lib/commonjs/ui/Text/index.js.map +1 -1
- package/lib/commonjs/ui/Toast/index.js.map +1 -1
- package/lib/commonjs/ui/URLParsedText/index.js.map +1 -1
- package/lib/module/components/Image/index.js.map +1 -1
- package/lib/module/styles/HeaderStyleContext.js.map +1 -1
- package/lib/module/theme/UIKitThemeProvider.js.map +1 -1
- package/lib/module/ui/ActionMenu/index.js.map +1 -1
- package/lib/module/ui/Alert/index.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarGroup.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/module/ui/Avatar/index.js.map +1 -1
- package/lib/module/ui/Badge/index.js.map +1 -1
- package/lib/module/ui/BottomSheet/index.js.map +1 -1
- package/lib/module/ui/Button/index.js.map +1 -1
- package/lib/module/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/module/ui/Dialog/DialogBox.js.map +1 -1
- package/lib/module/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/module/ui/Dialog/index.js.map +1 -1
- package/lib/module/ui/Divider/index.js.map +1 -1
- package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/module/ui/Header/index.js.map +1 -1
- package/lib/module/ui/Icon/index.js.map +1 -1
- package/lib/module/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/module/ui/MenuBar/index.js.map +1 -1
- package/lib/module/ui/Modal/index.js.map +1 -1
- package/lib/module/ui/Placeholder/index.js.map +1 -1
- package/lib/module/ui/Prompt/index.js.map +1 -1
- package/lib/module/ui/Switch/index.js.map +1 -1
- package/lib/module/ui/Text/index.js.map +1 -1
- package/lib/module/ui/Toast/index.js.map +1 -1
- package/lib/module/ui/URLParsedText/index.js.map +1 -1
- package/lib/typescript/src/components/Image/index.d.ts +1 -2
- package/lib/typescript/src/styles/HeaderStyleContext.d.ts +1 -1
- package/lib/typescript/src/theme/UIKitThemeProvider.d.ts +3 -3
- package/lib/typescript/src/ui/ActionMenu/index.d.ts +1 -2
- package/lib/typescript/src/ui/Alert/index.d.ts +1 -2
- package/lib/typescript/src/ui/Avatar/AvatarGroup.d.ts +3 -3
- package/lib/typescript/src/ui/Avatar/AvatarIcon.d.ts +1 -2
- package/lib/typescript/src/ui/Avatar/index.d.ts +1 -2
- package/lib/typescript/src/ui/Badge/index.d.ts +1 -2
- package/lib/typescript/src/ui/BottomSheet/index.d.ts +1 -2
- package/lib/typescript/src/ui/Button/index.d.ts +3 -3
- package/lib/typescript/src/ui/ChannelFrozenBanner/index.d.ts +1 -2
- package/lib/typescript/src/ui/Dialog/DialogBox.d.ts +3 -3
- package/lib/typescript/src/ui/Dialog/DialogSheet.d.ts +4 -4
- package/lib/typescript/src/ui/Dialog/index.d.ts +3 -3
- package/lib/typescript/src/ui/Divider/index.d.ts +1 -2
- package/lib/typescript/src/ui/GroupChannelPreview/index.d.ts +1 -1
- package/lib/typescript/src/ui/Header/index.d.ts +6 -10
- package/lib/typescript/src/ui/Icon/index.d.ts +1 -2
- package/lib/typescript/src/ui/LoadingSpinner/index.d.ts +1 -2
- package/lib/typescript/src/ui/MenuBar/index.d.ts +1 -1
- package/lib/typescript/src/ui/Modal/index.d.ts +1 -2
- package/lib/typescript/src/ui/Placeholder/index.d.ts +1 -2
- package/lib/typescript/src/ui/Prompt/index.d.ts +1 -2
- package/lib/typescript/src/ui/Switch/index.d.ts +3 -3
- package/lib/typescript/src/ui/Text/index.d.ts +1 -2
- package/lib/typescript/src/ui/Toast/index.d.ts +5 -5
- package/lib/typescript/src/ui/URLParsedText/index.d.ts +1 -2
- package/package.json +5 -5
- package/src/components/Image/index.ts +1 -2
- package/src/styles/HeaderStyleContext.tsx +2 -2
- package/src/theme/UIKitThemeProvider.tsx +4 -2
- package/src/ui/ActionMenu/index.tsx +1 -1
- package/src/ui/Alert/index.tsx +1 -8
- package/src/ui/Avatar/AvatarGroup.tsx +5 -2
- package/src/ui/Avatar/AvatarIcon.tsx +1 -1
- package/src/ui/Avatar/index.tsx +12 -3
- package/src/ui/Badge/index.tsx +1 -1
- package/src/ui/BottomSheet/index.tsx +1 -1
- package/src/ui/Button/index.tsx +4 -4
- package/src/ui/ChannelFrozenBanner/index.tsx +1 -1
- package/src/ui/Dialog/DialogBox.tsx +3 -3
- package/src/ui/Dialog/DialogSheet.tsx +4 -4
- package/src/ui/Dialog/index.tsx +3 -3
- package/src/ui/Divider/index.tsx +1 -1
- package/src/ui/GroupChannelPreview/index.tsx +2 -2
- package/src/ui/Header/index.tsx +6 -12
- package/src/ui/Icon/index.tsx +7 -2
- package/src/ui/LoadingSpinner/index.tsx +2 -2
- package/src/ui/MenuBar/index.tsx +2 -2
- package/src/ui/Modal/index.tsx +2 -2
- package/src/ui/Placeholder/index.tsx +1 -1
- package/src/ui/Prompt/index.tsx +2 -2
- package/src/ui/Switch/index.tsx +4 -4
- package/src/ui/Text/index.tsx +1 -1
- package/src/ui/Toast/index.tsx +8 -4
- package/src/ui/URLParsedText/index.tsx +1 -1
|
@@ -6,10 +6,10 @@ import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
|
6
6
|
import Icon from '../Icon';
|
|
7
7
|
import Text from '../Text';
|
|
8
8
|
|
|
9
|
-
type Props = {
|
|
9
|
+
type Props = React.PropsWithChildren<{
|
|
10
10
|
style?: StyleProp<ViewStyle>;
|
|
11
|
-
}
|
|
12
|
-
const DialogSheet:
|
|
11
|
+
}>;
|
|
12
|
+
const DialogSheet: ((props: Props) => JSX.Element) & { Item: typeof SheetItem } = ({ style, children }) => {
|
|
13
13
|
const { colors } = useUIKitTheme();
|
|
14
14
|
return (
|
|
15
15
|
<View style={[styles.container, { backgroundColor: colors.ui.dialog.default.none.background }, style]}>
|
|
@@ -24,7 +24,7 @@ export type SheetItemProps = {
|
|
|
24
24
|
title: string;
|
|
25
25
|
titleColor?: string;
|
|
26
26
|
};
|
|
27
|
-
const SheetItem
|
|
27
|
+
const SheetItem = ({ icon, title, iconColor, titleColor }: SheetItemProps) => {
|
|
28
28
|
const { colors } = useUIKitTheme();
|
|
29
29
|
return (
|
|
30
30
|
<View style={[styles.sheetItemContainer, { backgroundColor: colors.ui.dialog.default.none.background }]}>
|
package/src/ui/Dialog/index.tsx
CHANGED
|
@@ -45,14 +45,14 @@ const ActionMenuContext = React.createContext<Pick<DialogContextType, 'openMenu'
|
|
|
45
45
|
const PromptContext = React.createContext<Pick<DialogContextType, 'openPrompt'> | null>(null);
|
|
46
46
|
const BottomSheetContext = React.createContext<Pick<DialogContextType, 'openSheet'> | null>(null);
|
|
47
47
|
|
|
48
|
-
type Props = {
|
|
48
|
+
type Props = React.PropsWithChildren<{
|
|
49
49
|
defaultLabels?: {
|
|
50
50
|
alert?: { ok?: string };
|
|
51
51
|
prompt?: { placeholder?: string; ok?: string; cancel?: string };
|
|
52
52
|
};
|
|
53
|
-
}
|
|
53
|
+
}>;
|
|
54
54
|
const DISMISS_TIMEOUT = 3000;
|
|
55
|
-
export const DialogProvider
|
|
55
|
+
export const DialogProvider = ({ defaultLabels, children }: Props) => {
|
|
56
56
|
const waitDismissTimeout = useRef<NodeJS.Timeout>();
|
|
57
57
|
const waitDismissPromise = useRef<() => void>();
|
|
58
58
|
const waitDismiss = useCallback((resolver: () => void) => {
|
package/src/ui/Divider/index.tsx
CHANGED
|
@@ -9,7 +9,7 @@ type Props = {
|
|
|
9
9
|
space?: number;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const Divider
|
|
12
|
+
const Divider = ({ style, space }: Props) => {
|
|
13
13
|
const { colors } = useUIKitTheme();
|
|
14
14
|
return (
|
|
15
15
|
<View style={[style, styles.divider, { paddingHorizontal: space }]}>
|
|
@@ -27,7 +27,7 @@ type Props = {
|
|
|
27
27
|
notificationOff?: boolean;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const GroupChannelPreview
|
|
30
|
+
const GroupChannelPreview = ({
|
|
31
31
|
customCover,
|
|
32
32
|
coverUrl,
|
|
33
33
|
memberCount,
|
|
@@ -39,7 +39,7 @@ const GroupChannelPreview: React.FC<Props> = ({
|
|
|
39
39
|
titleCaption,
|
|
40
40
|
frozen,
|
|
41
41
|
notificationOff,
|
|
42
|
-
}) => {
|
|
42
|
+
}: Props) => {
|
|
43
43
|
const { colors } = useUIKitTheme();
|
|
44
44
|
const color = colors.ui.groupChannelPreview;
|
|
45
45
|
|
package/src/ui/Header/index.tsx
CHANGED
|
@@ -24,7 +24,7 @@ type HeaderProps = BaseHeaderProps<
|
|
|
24
24
|
>;
|
|
25
25
|
|
|
26
26
|
const AlignMapper = { left: 'flex-start', center: 'center', right: 'flex-end' } as const;
|
|
27
|
-
const Header:
|
|
27
|
+
const Header: ((props: HeaderProps) => JSX.Element) & {
|
|
28
28
|
Button: typeof HeaderButton;
|
|
29
29
|
Title: typeof HeaderTitle;
|
|
30
30
|
Subtitle: typeof HeaderSubtitle;
|
|
@@ -82,7 +82,7 @@ const Header: React.FC<HeaderProps> & {
|
|
|
82
82
|
);
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
const LeftSide
|
|
85
|
+
const LeftSide = ({ titleAlign, onPressLeft, left }: HeaderProps) => {
|
|
86
86
|
if (titleAlign === 'center') {
|
|
87
87
|
return <View style={styles.left}>{left && <HeaderButton onPress={onPressLeft}>{left}</HeaderButton>}</View>;
|
|
88
88
|
}
|
|
@@ -94,7 +94,7 @@ const LeftSide: React.FC<HeaderProps> = ({ titleAlign, onPressLeft, left }) => {
|
|
|
94
94
|
);
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
const RightSide
|
|
97
|
+
const RightSide = ({ titleAlign, onPressRight, right }: HeaderProps) => {
|
|
98
98
|
if (titleAlign === 'center') {
|
|
99
99
|
return <View style={styles.right}>{right && <HeaderButton onPress={onPressRight}>{right}</HeaderButton>}</View>;
|
|
100
100
|
}
|
|
@@ -106,14 +106,14 @@ const RightSide: React.FC<HeaderProps> = ({ titleAlign, onPressRight, right }) =
|
|
|
106
106
|
);
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
const HeaderTitle
|
|
109
|
+
const HeaderTitle = ({ children, style, ...props }: TextProps) => {
|
|
110
110
|
return (
|
|
111
111
|
<Text {...props} h1 numberOfLines={1} style={style}>
|
|
112
112
|
{children}
|
|
113
113
|
</Text>
|
|
114
114
|
);
|
|
115
115
|
};
|
|
116
|
-
const HeaderSubtitle
|
|
116
|
+
const HeaderSubtitle = ({ children, style, ...props }: TextProps) => {
|
|
117
117
|
const { colors } = useUIKitTheme();
|
|
118
118
|
return (
|
|
119
119
|
<Text color={colors.onBackground03} {...props} caption2 numberOfLines={1} style={style}>
|
|
@@ -121,13 +121,7 @@ const HeaderSubtitle: React.FC<{ children: string } & TextProps> = ({ children,
|
|
|
121
121
|
</Text>
|
|
122
122
|
);
|
|
123
123
|
};
|
|
124
|
-
const HeaderButton:
|
|
125
|
-
children,
|
|
126
|
-
disabled,
|
|
127
|
-
onPress,
|
|
128
|
-
color,
|
|
129
|
-
...props
|
|
130
|
-
}) => {
|
|
124
|
+
const HeaderButton = ({ children, disabled, onPress, color, ...props }: TouchableOpacityProps & { color?: string }) => {
|
|
131
125
|
return (
|
|
132
126
|
<TouchableOpacity
|
|
133
127
|
style={styles.button}
|
package/src/ui/Icon/index.tsx
CHANGED
|
@@ -15,8 +15,13 @@ type Props = {
|
|
|
15
15
|
style?: StyleProp<ImageStyle>;
|
|
16
16
|
containerStyle?: StyleProp<ViewStyle>;
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const Icon: ((props: Props) => JSX.Element) & { Assets: typeof IconAssets } = ({
|
|
19
|
+
icon,
|
|
20
|
+
color,
|
|
21
|
+
size = 24,
|
|
22
|
+
containerStyle,
|
|
23
|
+
style,
|
|
24
|
+
}) => {
|
|
20
25
|
const sizeStyle = sizeStyles[size as SizeFactor] ?? { width: size, height: size };
|
|
21
26
|
const { colors } = useUIKitTheme();
|
|
22
27
|
return (
|
|
@@ -10,7 +10,7 @@ type Props = {
|
|
|
10
10
|
style?: StyleProp<ViewStyle>;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
const LoadingSpinner
|
|
13
|
+
const LoadingSpinner = ({ size = 24, color, style }: Props) => {
|
|
14
14
|
const { colors } = useUIKitTheme();
|
|
15
15
|
return (
|
|
16
16
|
<Rotate style={style}>
|
|
@@ -37,7 +37,7 @@ const useLoopAnimated = (duration: number, useNativeDriver = true) => {
|
|
|
37
37
|
return animated;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
const Rotate: React.
|
|
40
|
+
const Rotate = ({ children, style }: React.PropsWithChildren<{ style: StyleProp<ViewStyle> }>) => {
|
|
41
41
|
const loop = useLoopAnimated(1000);
|
|
42
42
|
const rotate = loop.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg'] });
|
|
43
43
|
return <Animated.View style={[style, { transform: [{ rotate }] }]}>{children}</Animated.View>;
|
package/src/ui/MenuBar/index.tsx
CHANGED
|
@@ -23,7 +23,7 @@ export type MenuBarProps = {
|
|
|
23
23
|
actionLabel?: string;
|
|
24
24
|
actionItem?: React.ReactNode;
|
|
25
25
|
};
|
|
26
|
-
const MenuBar
|
|
26
|
+
const MenuBar = ({
|
|
27
27
|
variant = 'default',
|
|
28
28
|
disabled,
|
|
29
29
|
onPress,
|
|
@@ -33,7 +33,7 @@ const MenuBar: React.FC<MenuBarProps> = ({
|
|
|
33
33
|
iconBackgroundColor,
|
|
34
34
|
actionLabel,
|
|
35
35
|
actionItem = null,
|
|
36
|
-
}) => {
|
|
36
|
+
}: MenuBarProps) => {
|
|
37
37
|
const { palette, colors } = useUIKitTheme();
|
|
38
38
|
|
|
39
39
|
return (
|
package/src/ui/Modal/index.tsx
CHANGED
|
@@ -34,7 +34,7 @@ type Props = {
|
|
|
34
34
|
* Modal Close: Triggered by Modal.props.onClose() call
|
|
35
35
|
* - Modal.props.onClose() -> visible false -> animation start -> modalVisible false
|
|
36
36
|
* */
|
|
37
|
-
const Modal
|
|
37
|
+
const Modal = ({
|
|
38
38
|
children,
|
|
39
39
|
onClose,
|
|
40
40
|
backgroundStyle,
|
|
@@ -45,7 +45,7 @@ const Modal: React.FC<Props> = ({
|
|
|
45
45
|
enableKeyboardAvoid = false,
|
|
46
46
|
statusBarTranslucent,
|
|
47
47
|
...props
|
|
48
|
-
}) => {
|
|
48
|
+
}: Props) => {
|
|
49
49
|
const { palette } = useUIKitTheme();
|
|
50
50
|
const { content, backdrop, showTransition, hideTransition } = useModalAnimation(type);
|
|
51
51
|
const panResponder = useModalPanResponder(type, content.translateY, showTransition, onClose);
|
|
@@ -19,7 +19,7 @@ type Props = {
|
|
|
19
19
|
onPressRetry?: () => void;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const Placeholder
|
|
22
|
+
const Placeholder = ({ icon, loading = false, message = '', errorRetryLabel, onPressRetry }: Props) => {
|
|
23
23
|
const { colors } = useUIKitTheme();
|
|
24
24
|
|
|
25
25
|
// loading ? styles.containerLoading : errorRetryLabel ? styles.containerError : styles.container
|
package/src/ui/Prompt/index.tsx
CHANGED
|
@@ -28,7 +28,7 @@ type Props = {
|
|
|
28
28
|
onDismiss?: () => void;
|
|
29
29
|
autoFocus?: boolean;
|
|
30
30
|
} & PromptItem;
|
|
31
|
-
const Prompt
|
|
31
|
+
const Prompt = ({
|
|
32
32
|
onDismiss,
|
|
33
33
|
visible,
|
|
34
34
|
onHide,
|
|
@@ -40,7 +40,7 @@ const Prompt: React.FC<Props> = ({
|
|
|
40
40
|
onCancel = NOOP,
|
|
41
41
|
submitLabel = 'Submit',
|
|
42
42
|
cancelLabel = 'Cancel',
|
|
43
|
-
}) => {
|
|
43
|
+
}: Props) => {
|
|
44
44
|
const { statusBarTranslucent } = useHeaderStyle();
|
|
45
45
|
const { colors } = useUIKitTheme();
|
|
46
46
|
const inputRef = useRef<RNTextInput>(null);
|
package/src/ui/Switch/index.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { Animated, Platform, Pressable } from 'react-native';
|
|
|
4
4
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
5
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
type SwitchProps = React.PropsWithChildren<{
|
|
8
8
|
trackColor?: string;
|
|
9
9
|
thumbColor?: string;
|
|
10
10
|
inactiveThumbColor?: string;
|
|
@@ -12,15 +12,15 @@ interface SwitchProps {
|
|
|
12
12
|
|
|
13
13
|
value: boolean;
|
|
14
14
|
onChangeValue: (val: boolean) => void;
|
|
15
|
-
}
|
|
16
|
-
const Switch
|
|
15
|
+
}>;
|
|
16
|
+
const Switch = ({
|
|
17
17
|
value,
|
|
18
18
|
onChangeValue,
|
|
19
19
|
inactiveThumbColor,
|
|
20
20
|
inactiveTrackColor,
|
|
21
21
|
trackColor,
|
|
22
22
|
thumbColor,
|
|
23
|
-
}) => {
|
|
23
|
+
}: SwitchProps) => {
|
|
24
24
|
const { select, palette, colors } = useUIKitTheme();
|
|
25
25
|
const position = useRef(new Animated.Value(0)).current;
|
|
26
26
|
|
package/src/ui/Text/index.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import type { TypoName, UIKitTheme } from '../../types';
|
|
|
6
6
|
|
|
7
7
|
type TypographyProps = Partial<Record<TypoName, boolean>>;
|
|
8
8
|
export type TextProps = RNTextProps & TypographyProps & { color?: ((colors: UIKitTheme['colors']) => string) | string };
|
|
9
|
-
const Text
|
|
9
|
+
const Text = ({ children, color, style, ...props }: TextProps) => {
|
|
10
10
|
const { colors } = useUIKitTheme();
|
|
11
11
|
const typoStyle = useTypographyFilter(props);
|
|
12
12
|
return (
|
package/src/ui/Toast/index.tsx
CHANGED
|
@@ -12,13 +12,13 @@ type Context = { show(text: string, type?: ToastType): void };
|
|
|
12
12
|
|
|
13
13
|
const ToastContext = createContext<Context | null>(null);
|
|
14
14
|
|
|
15
|
-
type Props = {
|
|
15
|
+
type Props = React.PropsWithChildren<{
|
|
16
16
|
top?: number;
|
|
17
17
|
bottom?: number;
|
|
18
18
|
visible: boolean;
|
|
19
19
|
type: ToastType;
|
|
20
20
|
children: string;
|
|
21
|
-
}
|
|
21
|
+
}>;
|
|
22
22
|
|
|
23
23
|
const useOpacity = () => {
|
|
24
24
|
const opacity = useRef(new Animated.Value(0)).current;
|
|
@@ -32,7 +32,8 @@ const useOpacity = () => {
|
|
|
32
32
|
hide: () => transition(0),
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
const Toast = ({ visible, type, children, top, bottom }: Props) => {
|
|
36
37
|
const { colors, select, palette } = useUIKitTheme();
|
|
37
38
|
const { opacity, show, hide } = useOpacity();
|
|
38
39
|
|
|
@@ -67,7 +68,10 @@ const Toast: React.FC<Props> = ({ visible, type, children, top, bottom }) => {
|
|
|
67
68
|
};
|
|
68
69
|
|
|
69
70
|
const VISIBLE_MS = 3000;
|
|
70
|
-
export const ToastProvider
|
|
71
|
+
export const ToastProvider = ({
|
|
72
|
+
children,
|
|
73
|
+
dismissTimeout = VISIBLE_MS,
|
|
74
|
+
}: React.PropsWithChildren<{ dismissTimeout?: number }>) => {
|
|
71
75
|
const [state, setState] = useState({ visible: false, type: 'error' as ToastType, text: '' });
|
|
72
76
|
const { bottom } = useSafeAreaInsets();
|
|
73
77
|
|
|
@@ -18,7 +18,7 @@ type Props = TextProps & {
|
|
|
18
18
|
onPressUrl?: OnPressUrl;
|
|
19
19
|
strict?: boolean;
|
|
20
20
|
};
|
|
21
|
-
const URLParsedText
|
|
21
|
+
const URLParsedText = ({ children, onPressUrl = openUrl, strict, ...props }: Props) => {
|
|
22
22
|
const parsedChildren = useMemo((): React.ReactNode => {
|
|
23
23
|
return React.Children.map(React.Children.toArray(children), (child) => {
|
|
24
24
|
if (typeof child === 'string') {
|