@sendbird/uikit-react-native-foundation 2.4.1 → 2.5.0-rc.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/README.md +1 -1
- package/lib/commonjs/assets/bundle-icons.js +0 -3
- package/lib/commonjs/assets/bundle-icons.js.map +1 -1
- package/lib/commonjs/assets/icon/index.js.map +1 -1
- package/lib/commonjs/components/Box/index.js +0 -9
- package/lib/commonjs/components/Box/index.js.map +1 -1
- package/lib/commonjs/components/Divider/index.js +0 -7
- package/lib/commonjs/components/Divider/index.js.map +1 -1
- package/lib/commonjs/components/Icon/index.js +0 -9
- package/lib/commonjs/components/Icon/index.js.map +1 -1
- package/lib/commonjs/components/Image/Image.fastimage.js +8 -17
- package/lib/commonjs/components/Image/Image.fastimage.js.map +1 -1
- package/lib/commonjs/components/Image/Image.reactnative.js +0 -6
- package/lib/commonjs/components/Image/Image.reactnative.js.map +1 -1
- package/lib/commonjs/components/Image/index.js +0 -5
- package/lib/commonjs/components/Image/index.js.map +1 -1
- package/lib/commonjs/components/ImageWithPlaceholder/index.js +0 -15
- package/lib/commonjs/components/ImageWithPlaceholder/index.js.map +1 -1
- package/lib/commonjs/components/Modal/index.js +6 -24
- package/lib/commonjs/components/Modal/index.js.map +1 -1
- package/lib/commonjs/components/PressBox/index.js +0 -11
- package/lib/commonjs/components/PressBox/index.js.map +1 -1
- package/lib/commonjs/components/RegexText/index.js +2 -8
- package/lib/commonjs/components/RegexText/index.js.map +1 -1
- package/lib/commonjs/components/Switch/index.js +0 -14
- package/lib/commonjs/components/Switch/index.js.map +1 -1
- package/lib/commonjs/components/Text/index.js +0 -8
- package/lib/commonjs/components/Text/index.js.map +1 -1
- package/lib/commonjs/components/TextInput/index.js +0 -8
- package/lib/commonjs/components/TextInput/index.js.map +1 -1
- package/lib/commonjs/components/URLParsedText/index.js +0 -14
- package/lib/commonjs/components/URLParsedText/index.js.map +1 -1
- package/lib/commonjs/index.js +0 -49
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/styles/HeaderStyleContext.js +0 -9
- package/lib/commonjs/styles/HeaderStyleContext.js.map +1 -1
- package/lib/commonjs/styles/createScaleFactor.js +0 -6
- package/lib/commonjs/styles/createScaleFactor.js.map +1 -1
- package/lib/commonjs/styles/createSelectByColorScheme.js +0 -2
- package/lib/commonjs/styles/createSelectByColorScheme.js.map +1 -1
- package/lib/commonjs/styles/createStyleSheet.js +1 -6
- package/lib/commonjs/styles/createStyleSheet.js.map +1 -1
- package/lib/commonjs/styles/createTypography.js +0 -3
- package/lib/commonjs/styles/createTypography.js.map +1 -1
- package/lib/commonjs/styles/getDefaultHeaderHeight.js +0 -2
- package/lib/commonjs/styles/getDefaultHeaderHeight.js.map +1 -1
- package/lib/commonjs/styles/useHeaderStyle.js +0 -4
- package/lib/commonjs/styles/useHeaderStyle.js.map +1 -1
- package/lib/commonjs/theme/DarkUIKitTheme.js +0 -3
- package/lib/commonjs/theme/DarkUIKitTheme.js.map +1 -1
- package/lib/commonjs/theme/LightUIKitTheme.js +0 -3
- package/lib/commonjs/theme/LightUIKitTheme.js.map +1 -1
- package/lib/commonjs/theme/Palette.js.map +1 -1
- package/lib/commonjs/theme/UIKitThemeContext.js +0 -4
- package/lib/commonjs/theme/UIKitThemeContext.js.map +1 -1
- package/lib/commonjs/theme/UIKitThemeProvider.js +0 -6
- package/lib/commonjs/theme/UIKitThemeProvider.js.map +1 -1
- package/lib/commonjs/theme/createTheme.js +0 -13
- package/lib/commonjs/theme/createTheme.js.map +1 -1
- package/lib/commonjs/theme/useUIKitTheme.js +0 -5
- package/lib/commonjs/theme/useUIKitTheme.js.map +1 -1
- package/lib/commonjs/ui/ActionMenu/index.js +2 -20
- package/lib/commonjs/ui/ActionMenu/index.js.map +1 -1
- package/lib/commonjs/ui/Alert/index.js +0 -12
- package/lib/commonjs/ui/Alert/index.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarGroup.js +0 -17
- package/lib/commonjs/ui/Avatar/AvatarGroup.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarIcon.js +0 -8
- package/lib/commonjs/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/commonjs/ui/Avatar/index.js +0 -15
- package/lib/commonjs/ui/Avatar/index.js.map +1 -1
- package/lib/commonjs/ui/Badge/index.js +0 -9
- package/lib/commonjs/ui/Badge/index.js.map +1 -1
- package/lib/commonjs/ui/BottomSheet/index.js +0 -10
- package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
- package/lib/commonjs/ui/Button/index.js +0 -11
- package/lib/commonjs/ui/Button/index.js.map +1 -1
- package/lib/commonjs/ui/ChannelFrozenBanner/index.js +0 -8
- package/lib/commonjs/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogBox.js +0 -7
- package/lib/commonjs/ui/Dialog/DialogBox.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogSheet.js +0 -10
- package/lib/commonjs/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/commonjs/ui/Dialog/index.js +0 -30
- package/lib/commonjs/ui/Dialog/index.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelPreview/index.js +1 -13
- package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/Header/index.js +0 -24
- package/lib/commonjs/ui/Header/index.js.map +1 -1
- package/lib/commonjs/ui/LoadingSpinner/index.js +0 -12
- package/lib/commonjs/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/commonjs/ui/MenuBar/index.js +0 -11
- package/lib/commonjs/ui/MenuBar/index.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.admin.js +0 -7
- package/lib/commonjs/ui/OpenChannelMessage/Message.admin.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.image.js +0 -10
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.image.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.js +0 -14
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.video.js +0 -16
- package/lib/commonjs/ui/OpenChannelMessage/Message.file.video.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.unknown.js +0 -10
- package/lib/commonjs/ui/OpenChannelMessage/Message.unknown.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.user.js +0 -14
- package/lib/commonjs/ui/OpenChannelMessage/Message.user.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/Message.user.og.js +0 -17
- package/lib/commonjs/ui/OpenChannelMessage/Message.user.og.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/MessageContainer.js +0 -21
- package/lib/commonjs/ui/OpenChannelMessage/MessageContainer.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelMessage/index.js +0 -9
- package/lib/commonjs/ui/OpenChannelMessage/index.js.map +1 -1
- package/lib/commonjs/ui/OpenChannelPreview/index.js +0 -12
- package/lib/commonjs/ui/OpenChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/OutlinedButton/index.js +0 -8
- package/lib/commonjs/ui/OutlinedButton/index.js.map +1 -1
- package/lib/commonjs/ui/Placeholder/index.js +2 -13
- package/lib/commonjs/ui/Placeholder/index.js.map +1 -1
- package/lib/commonjs/ui/ProfileCard/index.js +0 -10
- package/lib/commonjs/ui/ProfileCard/index.js.map +1 -1
- package/lib/commonjs/ui/Prompt/index.js +3 -20
- package/lib/commonjs/ui/Prompt/index.js.map +1 -1
- package/lib/commonjs/ui/Toast/index.js +2 -23
- package/lib/commonjs/ui/Toast/index.js.map +1 -1
- package/lib/module/assets/bundle-icons.js +0 -3
- package/lib/module/assets/bundle-icons.js.map +1 -1
- package/lib/module/assets/icon/index.js.map +1 -1
- package/lib/module/components/Box/index.js +0 -4
- package/lib/module/components/Box/index.js.map +1 -1
- package/lib/module/components/Divider/index.js +0 -2
- package/lib/module/components/Divider/index.js.map +1 -1
- package/lib/module/components/Icon/index.js +0 -2
- package/lib/module/components/Icon/index.js.map +1 -1
- package/lib/module/components/Image/Image.fastimage.js +8 -15
- package/lib/module/components/Image/Image.fastimage.js.map +1 -1
- package/lib/module/components/Image/Image.reactnative.js +0 -3
- package/lib/module/components/Image/Image.reactnative.js.map +1 -1
- package/lib/module/components/Image/index.js +0 -3
- package/lib/module/components/Image/index.js.map +1 -1
- package/lib/module/components/ImageWithPlaceholder/index.js +0 -4
- package/lib/module/components/ImageWithPlaceholder/index.js.map +1 -1
- package/lib/module/components/Modal/index.js +6 -16
- package/lib/module/components/Modal/index.js.map +1 -1
- package/lib/module/components/PressBox/index.js +0 -5
- package/lib/module/components/PressBox/index.js.map +1 -1
- package/lib/module/components/RegexText/index.js +2 -4
- package/lib/module/components/RegexText/index.js.map +1 -1
- package/lib/module/components/Switch/index.js +0 -6
- package/lib/module/components/Switch/index.js.map +1 -1
- package/lib/module/components/Text/index.js +0 -4
- package/lib/module/components/Text/index.js.map +1 -1
- package/lib/module/components/TextInput/index.js +0 -1
- package/lib/module/components/TextInput/index.js.map +1 -1
- package/lib/module/components/URLParsedText/index.js +0 -5
- package/lib/module/components/URLParsedText/index.js.map +1 -1
- package/lib/module/index.js +5 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/styles/HeaderStyleContext.js.map +1 -1
- package/lib/module/styles/createScaleFactor.js +0 -3
- package/lib/module/styles/createScaleFactor.js.map +1 -1
- package/lib/module/styles/createSelectByColorScheme.js +0 -1
- package/lib/module/styles/createSelectByColorScheme.js.map +1 -1
- package/lib/module/styles/createStyleSheet.js +1 -4
- package/lib/module/styles/createStyleSheet.js.map +1 -1
- package/lib/module/styles/createTypography.js +0 -2
- package/lib/module/styles/createTypography.js.map +1 -1
- package/lib/module/styles/getDefaultHeaderHeight.js +0 -2
- package/lib/module/styles/getDefaultHeaderHeight.js.map +1 -1
- package/lib/module/styles/useHeaderStyle.js +0 -2
- package/lib/module/styles/useHeaderStyle.js.map +1 -1
- package/lib/module/theme/DarkUIKitTheme.js.map +1 -1
- package/lib/module/theme/LightUIKitTheme.js.map +1 -1
- package/lib/module/theme/Palette.js.map +1 -1
- package/lib/module/theme/UIKitThemeContext.js.map +1 -1
- package/lib/module/theme/UIKitThemeProvider.js +0 -2
- package/lib/module/theme/UIKitThemeProvider.js.map +1 -1
- package/lib/module/theme/createTheme.js +0 -9
- package/lib/module/theme/createTheme.js.map +1 -1
- package/lib/module/theme/useUIKitTheme.js +0 -2
- package/lib/module/theme/useUIKitTheme.js.map +1 -1
- package/lib/module/ui/ActionMenu/index.js +2 -7
- package/lib/module/ui/ActionMenu/index.js.map +1 -1
- package/lib/module/ui/Alert/index.js +0 -2
- package/lib/module/ui/Alert/index.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarGroup.js +0 -12
- package/lib/module/ui/Avatar/AvatarGroup.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarIcon.js +0 -2
- package/lib/module/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/module/ui/Avatar/index.js +0 -3
- package/lib/module/ui/Avatar/index.js.map +1 -1
- package/lib/module/ui/Badge/index.js +0 -2
- package/lib/module/ui/Badge/index.js.map +1 -1
- package/lib/module/ui/BottomSheet/index.js +0 -3
- package/lib/module/ui/BottomSheet/index.js.map +1 -1
- package/lib/module/ui/Button/index.js +0 -4
- package/lib/module/ui/Button/index.js.map +1 -1
- package/lib/module/ui/ChannelFrozenBanner/index.js +0 -2
- package/lib/module/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/module/ui/Dialog/DialogBox.js +0 -2
- package/lib/module/ui/Dialog/DialogBox.js.map +1 -1
- package/lib/module/ui/Dialog/DialogSheet.js +0 -3
- package/lib/module/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/module/ui/Dialog/index.js +0 -6
- package/lib/module/ui/Dialog/index.js.map +1 -1
- package/lib/module/ui/GroupChannelPreview/index.js +1 -3
- package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/module/ui/Header/index.js +0 -14
- package/lib/module/ui/Header/index.js.map +1 -1
- package/lib/module/ui/LoadingSpinner/index.js +0 -4
- package/lib/module/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/module/ui/MenuBar/index.js +0 -2
- package/lib/module/ui/MenuBar/index.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.admin.js +0 -2
- package/lib/module/ui/OpenChannelMessage/Message.admin.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.file.image.js +0 -2
- package/lib/module/ui/OpenChannelMessage/Message.file.image.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.file.js +0 -3
- package/lib/module/ui/OpenChannelMessage/Message.file.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.file.video.js +0 -4
- package/lib/module/ui/OpenChannelMessage/Message.file.video.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.unknown.js +0 -4
- package/lib/module/ui/OpenChannelMessage/Message.unknown.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.user.js +0 -6
- package/lib/module/ui/OpenChannelMessage/Message.user.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/Message.user.og.js +0 -6
- package/lib/module/ui/OpenChannelMessage/Message.user.og.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/MessageContainer.js +0 -9
- package/lib/module/ui/OpenChannelMessage/MessageContainer.js.map +1 -1
- package/lib/module/ui/OpenChannelMessage/index.js.map +1 -1
- package/lib/module/ui/OpenChannelPreview/index.js +0 -3
- package/lib/module/ui/OpenChannelPreview/index.js.map +1 -1
- package/lib/module/ui/OutlinedButton/index.js +0 -2
- package/lib/module/ui/OutlinedButton/index.js.map +1 -1
- package/lib/module/ui/Placeholder/index.js +2 -3
- package/lib/module/ui/Placeholder/index.js.map +1 -1
- package/lib/module/ui/ProfileCard/index.js +0 -2
- package/lib/module/ui/ProfileCard/index.js.map +1 -1
- package/lib/module/ui/Prompt/index.js +3 -6
- package/lib/module/ui/Prompt/index.js.map +1 -1
- package/lib/module/ui/Toast/index.js +2 -8
- package/lib/module/ui/Toast/index.js.map +1 -1
- package/lib/typescript/src/components/PressBox/index.d.ts +2 -1
- package/package.json +15 -9
- package/src/components/Image/Image.fastimage.tsx +17 -1
- package/src/components/PressBox/index.tsx +2 -1
- package/src/ui/GroupChannelPreview/index.tsx +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ToastContext","createContext","useOpacity","opacity","useRef","Animated","Value","current","transition","value","timing","toValue","duration","useNativeDriver","start","show","hide","Toast","visible","type","children","top","bottom","colors","select","palette","useUIKitTheme","color","useMemo","dark","error300","light","error200","secondary300","secondary200","backgroundColor","useEffect","styles","toast","icon","onBackgroundReverse01","text","VISIBLE_MS","ToastProvider","dismissTimeout","state","setState","useState","useSafeAreaInsets","hideTimeout","setTimeout","prev","clearTimeout","Platform","OS","undefined","toastPosition","useToast","context","useContext","Error","createStyleSheet","position","height","paddingHorizontal","justifyContent","alignItems","alignSelf","borderRadius","flexDirection","marginRight","maxWidth"],"sources":["index.tsx"],"sourcesContent":["import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { Animated, KeyboardAvoidingView, Platform } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport Icon from '../../components/Icon';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype ToastType = 'normal' | 'error' | 'success';\ntype Context = { show(text: string, type?: ToastType): void };\n\nconst ToastContext = createContext<Context | null>(null);\n\ntype Props = React.PropsWithChildren<{\n top?: number;\n bottom?: number;\n visible: boolean;\n type: ToastType;\n children: string;\n}>;\n\nconst useOpacity = () => {\n const opacity = useRef(new Animated.Value(0)).current;\n const transition = (value: number) => {\n Animated.timing(opacity, { toValue: value, duration: 500, useNativeDriver: true }).start();\n };\n\n return {\n opacity,\n show: () => transition(1),\n hide: () => transition(0),\n };\n};\n\nconst Toast = ({ visible, type, children, top, bottom }: Props) => {\n const { colors, select, palette } = useUIKitTheme();\n const { opacity, show, hide } = useOpacity();\n\n const color = useMemo(() => {\n if (type === 'error') {\n return select({ dark: palette.error300, light: palette.error200 });\n }\n if (type === 'success') {\n return select({ dark: palette.secondary300, light: palette.secondary200 });\n }\n return 'transparent';\n }, [type, select]);\n\n const backgroundColor = useMemo(() => {\n return select({ light: 'rgba(0,0,0,0.64)', dark: 'rgba(255,255,255,0.64)' });\n }, [select]);\n\n useEffect(() => {\n visible ? show() : hide();\n }, [visible]);\n\n return (\n <Animated.View pointerEvents={'none'} style={[styles.toast, { opacity, top, bottom, backgroundColor }]}>\n {type !== 'normal' && (\n <Icon icon={type === 'success' ? 'done' : 'error'} color={color} containerStyle={styles.icon} />\n )}\n <Text color={colors.onBackgroundReverse01} body3 numberOfLines={2} style={styles.text}>\n {children}\n </Text>\n </Animated.View>\n );\n};\n\nconst VISIBLE_MS = 3000;\nexport const ToastProvider = ({\n children,\n dismissTimeout = VISIBLE_MS,\n}: React.PropsWithChildren<{ dismissTimeout?: number }>) => {\n const [state, setState] = useState({ visible: false, type: 'error' as ToastType, text: '' });\n const { bottom } = useSafeAreaInsets();\n\n useEffect(() => {\n if (!state.visible) return;\n\n const hideTimeout = setTimeout(() => {\n setState((prev) => ({ ...prev, visible: false }));\n }, dismissTimeout);\n return () => clearTimeout(hideTimeout);\n });\n\n return (\n <ToastContext.Provider value={{ show: (text, type = 'normal') => text && setState({ text, type, visible: true }) }}>\n {children}\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'position' : undefined}\n keyboardVerticalOffset={-bottom}\n pointerEvents={'none'}\n >\n <Toast type={state.type} visible={state.visible} bottom={bottom + styles.toastPosition.bottom}>\n {state.text}\n </Toast>\n </KeyboardAvoidingView>\n </ToastContext.Provider>\n );\n};\n\nexport const useToast = () => {\n const context = useContext(ToastContext);\n if (!context) throw new Error('ToastContext is not provided, wrap your app with ToastProvider');\n return context;\n};\n\nconst styles = createStyleSheet({\n toast: {\n position: 'absolute',\n height: 48,\n paddingHorizontal: 12,\n justifyContent: 'center',\n alignItems: 'center',\n alignSelf: 'center',\n borderRadius: 24,\n flexDirection: 'row',\n },\n icon: {\n marginRight: 4,\n },\n text: {\n maxWidth: 240,\n paddingHorizontal: 4,\n },\n toastPosition: {\n bottom: 60,\n },\n});\n\nexport default Toast;\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAKA,MAAMA,YAAY,gBAAG,IAAAC,oBAAA,EAA8B,IAA9B,CAArB;;AAUA,MAAMC,UAAU,GAAG,MAAM;EACvB,MAAMC,OAAO,GAAG,IAAAC,aAAA,EAAO,IAAIC,qBAAA,CAASC,KAAb,CAAmB,CAAnB,CAAP,EAA8BC,OAA9C;;EACA,MAAMC,UAAU,GAAIC,KAAD,IAAmB;IACpCJ,qBAAA,CAASK,MAAT,CAAgBP,OAAhB,EAAyB;MAAEQ,OAAO,EAAEF,KAAX;MAAkBG,QAAQ,EAAE,GAA5B;MAAiCC,eAAe,EAAE;IAAlD,CAAzB,EAAmFC,KAAnF;EACD,CAFD;;EAIA,OAAO;IACLX,OADK;IAELY,IAAI,EAAE,MAAMP,UAAU,CAAC,CAAD,CAFjB;IAGLQ,IAAI,EAAE,MAAMR,UAAU,CAAC,CAAD;EAHjB,CAAP;AAKD,CAXD;;AAaA,MAAMS,KAAK,GAAG,QAAqD;EAAA,IAApD;IAAEC,OAAF;IAAWC,IAAX;IAAiBC,QAAjB;IAA2BC,GAA3B;IAAgCC;EAAhC,CAAoD;EACjE,MAAM;IAAEC,MAAF;IAAUC,MAAV;IAAkBC;EAAlB,IAA8B,IAAAC,sBAAA,GAApC;EACA,MAAM;IAAEvB,OAAF;IAAWY,IAAX;IAAiBC;EAAjB,IAA0Bd,UAAU,EAA1C;EAEA,MAAMyB,KAAK,GAAG,IAAAC,cAAA,EAAQ,MAAM;IAC1B,IAAIT,IAAI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M,GAAGe,MAAM,CAACmB,aAAP,CAAqBlC;EAAvF,GACGuB,KAAK,CAACJ,IADT,CALF,CAFF,CADF;AAcD,CA9BM;;;;AAgCA,MAAMgB,QAAQ,GAAG,MAAM;EAC5B,MAAMC,OAAO,GAAG,IAAAC,iBAAA,EAAW3D,YAAX,CAAhB;EACA,IAAI,CAAC0D,OAAL,EAAc,MAAM,IAAIE,KAAJ,CAAU,gEAAV,CAAN;EACd,OAAOF,OAAP;AACD,CAJM;;;AAMP,MAAMrB,MAAM,GAAG,IAAAwB,yBAAA,EAAiB;EAC9BvB,KAAK,EAAE;IACLwB,QAAQ,EAAE,UADL;IAELC,MAAM,EAAE,EAFH;IAGLC,iBAAiB,EAAE,EAHd;IAILC,cAAc,EAAE,QAJX;IAKLC,UAAU,EAAE,QALP;IAMLC,SAAS,EAAE,QANN;IAOLC,YAAY,EAAE,EAPT;IAQLC,aAAa,EAAE;EARV,CADuB;EAW9B9B,IAAI,EAAE;IACJ+B,WAAW,EAAE;EADT,CAXwB;EAc9B7B,IAAI,EAAE;IACJ8B,QAAQ,EAAE,GADN;IAEJP,iBAAiB,EAAE;EAFf,CAdwB;EAkB9BR,aAAa,EAAE;IACblC,MAAM,EAAE;EADK;AAlBe,CAAjB,CAAf;eAuBeL,K"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_Icon","_interopRequireDefault","_Text","_createStyleSheet","_useUIKitTheme","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ToastContext","createContext","useOpacity","opacity","useRef","Animated","Value","current","transition","value","timing","toValue","duration","useNativeDriver","start","show","hide","Toast","_ref","visible","type","children","top","bottom","colors","select","palette","useUIKitTheme","color","useMemo","dark","error300","light","error200","secondary300","secondary200","backgroundColor","useEffect","createElement","View","pointerEvents","style","styles","toast","icon","containerStyle","onBackgroundReverse01","body3","numberOfLines","text","VISIBLE_MS","ToastProvider","_ref2","dismissTimeout","state","setState","useState","useSafeAreaInsets","hideTimeout","setTimeout","prev","clearTimeout","Provider","arguments","length","undefined","KeyboardAvoidingView","behavior","Platform","OS","keyboardVerticalOffset","toastPosition","exports","useToast","context","useContext","Error","createStyleSheet","position","height","paddingHorizontal","justifyContent","alignItems","alignSelf","borderRadius","flexDirection","marginRight","maxWidth","_default"],"sources":["index.tsx"],"sourcesContent":["import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { Animated, KeyboardAvoidingView, Platform } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport Icon from '../../components/Icon';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype ToastType = 'normal' | 'error' | 'success';\ntype Context = { show(text: string, type?: ToastType): void };\n\nconst ToastContext = createContext<Context | null>(null);\n\ntype Props = React.PropsWithChildren<{\n top?: number;\n bottom?: number;\n visible: boolean;\n type: ToastType;\n children: string;\n}>;\n\nconst useOpacity = () => {\n const opacity = useRef(new Animated.Value(0)).current;\n const transition = (value: number) => {\n Animated.timing(opacity, { toValue: value, duration: 500, useNativeDriver: true }).start();\n };\n\n return {\n opacity,\n show: () => transition(1),\n hide: () => transition(0),\n };\n};\n\nconst Toast = ({ visible, type, children, top, bottom }: Props) => {\n const { colors, select, palette } = useUIKitTheme();\n const { opacity, show, hide } = useOpacity();\n\n const color = useMemo(() => {\n if (type === 'error') {\n return select({ dark: palette.error300, light: palette.error200 });\n }\n if (type === 'success') {\n return select({ dark: palette.secondary300, light: palette.secondary200 });\n }\n return 'transparent';\n }, [type, select]);\n\n const backgroundColor = useMemo(() => {\n return select({ light: 'rgba(0,0,0,0.64)', dark: 'rgba(255,255,255,0.64)' });\n }, [select]);\n\n useEffect(() => {\n visible ? show() : hide();\n }, [visible]);\n\n return (\n <Animated.View pointerEvents={'none'} style={[styles.toast, { opacity, top, bottom, backgroundColor }]}>\n {type !== 'normal' && (\n <Icon icon={type === 'success' ? 'done' : 'error'} color={color} containerStyle={styles.icon} />\n )}\n <Text color={colors.onBackgroundReverse01} body3 numberOfLines={2} style={styles.text}>\n {children}\n </Text>\n </Animated.View>\n );\n};\n\nconst VISIBLE_MS = 3000;\nexport const ToastProvider = ({\n children,\n dismissTimeout = VISIBLE_MS,\n}: React.PropsWithChildren<{ dismissTimeout?: number }>) => {\n const [state, setState] = useState({ visible: false, type: 'error' as ToastType, text: '' });\n const { bottom } = useSafeAreaInsets();\n\n useEffect(() => {\n if (!state.visible) return;\n\n const hideTimeout = setTimeout(() => {\n setState((prev) => ({ ...prev, visible: false }));\n }, dismissTimeout);\n return () => clearTimeout(hideTimeout);\n });\n\n return (\n <ToastContext.Provider value={{ show: (text, type = 'normal') => text && setState({ text, type, visible: true }) }}>\n {children}\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'position' : undefined}\n keyboardVerticalOffset={-bottom}\n pointerEvents={'none'}\n >\n <Toast type={state.type} visible={state.visible} bottom={bottom + styles.toastPosition.bottom}>\n {state.text}\n </Toast>\n </KeyboardAvoidingView>\n </ToastContext.Provider>\n );\n};\n\nexport const useToast = () => {\n const context = useContext(ToastContext);\n if (!context) throw new Error('ToastContext is not provided, wrap your app with ToastProvider');\n return context;\n};\n\nconst styles = createStyleSheet({\n toast: {\n position: 'absolute',\n height: 48,\n paddingHorizontal: 12,\n justifyContent: 'center',\n alignItems: 'center',\n alignSelf: 'center',\n borderRadius: 24,\n flexDirection: 'row',\n },\n icon: {\n marginRight: 4,\n },\n text: {\n maxWidth: 240,\n paddingHorizontal: 4,\n },\n toastPosition: {\n bottom: 60,\n },\n});\n\nexport default Toast;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,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{"version":3,"names":["fs","require","path","prettier","ignorePatterns","requireBasePath","iconPath","join","__dirname","icons","readdirSync","forEach","filename","match","ext","extname","name","replace","assetPath","serializedIcons","JSON","stringify","_","a","b","c","exportString","writeFileSync","format"],"sources":["bundle-icons.js"],"sourcesContent":["const fs = require('fs');\nconst path = require('path');\nconst prettier = require('prettier');\n\nconst ignorePatterns = /bundle-icons\\.js|\\.DS_Store|index\\.ts|@2x|@3x/;\nconst requireBasePath = './';\nconst iconPath = path.join(__dirname, 'icon');\nconst icons = {};\n\nfs.readdirSync(iconPath).forEach((filename) => {\n if (filename.match(ignorePatterns)) return;\n const ext = path.extname(filename);\n const name = filename.replace(ext, '').replace(/icon-|ic-/g, '');\n const assetPath = requireBasePath + filename;\n icons[name] = `require('${assetPath}')`;\n});\n\nconst serializedIcons = JSON.stringify(icons, null, 4).replace(\n /(\"require\\()('.+')(\\)\")/g,\n (_, a, b, c) => a.replace('\"', '') + b + c.replace('\"', ''),\n);\nconst exportString = `const IconAssets = ${serializedIcons}; export default IconAssets`;\n\nfs.writeFileSync(\n path.join(iconPath, 'index.ts'),\n prettier.format(exportString, {\n 'printWidth': 120,\n 'tabWidth': 2,\n 'useTabs': false,\n 'semi': true,\n 'singleQuote': true,\n 'quoteProps': 'preserve',\n 'trailingComma': 'all',\n 'bracketSpacing': true,\n 'arrowParens': 'always',\n }),\n);\n"],"mappings":"AAAA,MAAMA,EAAE,GAAGC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"names":["fs","require","path","prettier","ignorePatterns","requireBasePath","iconPath","join","__dirname","icons","readdirSync","forEach","filename","match","ext","extname","name","replace","assetPath","serializedIcons","JSON","stringify","_","a","b","c","exportString","writeFileSync","format"],"sources":["bundle-icons.js"],"sourcesContent":["const fs = require('fs');\nconst path = require('path');\nconst prettier = require('prettier');\n\nconst ignorePatterns = /bundle-icons\\.js|\\.DS_Store|index\\.ts|@2x|@3x/;\nconst requireBasePath = './';\nconst iconPath = path.join(__dirname, 'icon');\nconst icons = {};\n\nfs.readdirSync(iconPath).forEach((filename) => {\n if (filename.match(ignorePatterns)) return;\n const ext = path.extname(filename);\n const name = filename.replace(ext, '').replace(/icon-|ic-/g, '');\n const assetPath = requireBasePath + filename;\n icons[name] = `require('${assetPath}')`;\n});\n\nconst serializedIcons = JSON.stringify(icons, null, 4).replace(\n /(\"require\\()('.+')(\\)\")/g,\n (_, a, b, c) => a.replace('\"', '') + b + c.replace('\"', ''),\n);\nconst exportString = `const IconAssets = ${serializedIcons}; export default IconAssets`;\n\nfs.writeFileSync(\n path.join(iconPath, 'index.ts'),\n prettier.format(exportString, {\n 'printWidth': 120,\n 'tabWidth': 2,\n 'useTabs': false,\n 'semi': true,\n 'singleQuote': true,\n 'quoteProps': 'preserve',\n 'trailingComma': 'all',\n 'bracketSpacing': true,\n 'arrowParens': 'always',\n }),\n);\n"],"mappings":"AAAA,MAAMA,EAAE,GAAGC,OAAO,CAAC,IAAI,CAAC;AACxB,MAAMC,IAAI,GAAGD,OAAO,CAAC,MAAM,CAAC;AAC5B,MAAME,QAAQ,GAAGF,OAAO,CAAC,UAAU,CAAC;AAEpC,MAAMG,cAAc,GAAG,+CAA+C;AACtE,MAAMC,eAAe,GAAG,IAAI;AAC5B,MAAMC,QAAQ,GAAGJ,IAAI,CAACK,IAAI,CAACC,SAAS,EAAE,MAAM,CAAC;AAC7C,MAAMC,KAAK,GAAG,CAAC,CAAC;AAEhBT,EAAE,CAACU,WAAW,CAACJ,QAAQ,CAAC,CAACK,OAAO,CAAEC,QAAQ,IAAK;EAC7C,IAAIA,QAAQ,CAACC,KAAK,CAACT,cAAc,CAAC,EAAE;EACpC,MAAMU,GAAG,GAAGZ,IAAI,CAACa,OAAO,CAACH,QAAQ,CAAC;EAClC,MAAMI,IAAI,GAAGJ,QAAQ,CAACK,OAAO,CAACH,GAAG,EAAE,EAAE,CAAC,CAACG,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;EAChE,MAAMC,SAAS,GAAGb,eAAe,GAAGO,QAAQ;EAC5CH,KAAK,CAACO,IAAI,CAAC,GAAI,YAAWE,SAAU,IAAG;AACzC,CAAC,CAAC;AAEF,MAAMC,eAAe,GAAGC,IAAI,CAACC,SAAS,CAACZ,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAACQ,OAAO,CAC5D,0BAA0B,EAC1B,CAACK,CAAC,EAAEC,CAAC,EAAEC,CAAC,EAAEC,CAAC,KAAKF,CAAC,CAACN,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,GAAGO,CAAC,GAAGC,CAAC,CAACR,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAC5D;AACD,MAAMS,YAAY,GAAI,sBAAqBP,eAAgB,6BAA4B;AAEvFnB,EAAE,CAAC2B,aAAa,CACdzB,IAAI,CAACK,IAAI,CAACD,QAAQ,EAAE,UAAU,CAAC,EAC/BH,QAAQ,CAACyB,MAAM,CAACF,YAAY,EAAE;EAC5B,YAAY,EAAE,GAAG;EACjB,UAAU,EAAE,CAAC;EACb,SAAS,EAAE,KAAK;EAChB,MAAM,EAAE,IAAI;EACZ,aAAa,EAAE,IAAI;EACnB,YAAY,EAAE,UAAU;EACxB,eAAe,EAAE,KAAK;EACtB,gBAAgB,EAAE,IAAI;EACtB,aAAa,EAAE;AACjB,CAAC,CAAC,CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IconAssets","require"],"sources":["index.ts"],"sourcesContent":["const IconAssets = {\n 'chat-hide': require('./ic-chat-hide.png'),\n 'chat-show': require('./ic-chat-show.png'),\n 'add': require('./icon-add.png'),\n 'archive': require('./icon-archive.png'),\n 'arrow-left': require('./icon-arrow-left.png'),\n 'ban': require('./icon-ban.png'),\n 'broadcast': require('./icon-broadcast.png'),\n 'camera': require('./icon-camera.png'),\n 'channels': require('./icon-channels.png'),\n 'chat-filled': require('./icon-chat-filled.png'),\n 'chat': require('./icon-chat.png'),\n 'checkbox-off': require('./icon-checkbox-off.png'),\n 'checkbox-on': require('./icon-checkbox-on.png'),\n 'chevron-down': require('./icon-chevron-down.png'),\n 'chevron-right': require('./icon-chevron-right.png'),\n 'close': require('./icon-close.png'),\n 'copy': require('./icon-copy.png'),\n 'create': require('./icon-create.png'),\n 'delete': require('./icon-delete.png'),\n 'document': require('./icon-document.png'),\n 'done-all': require('./icon-done-all.png'),\n 'done': require('./icon-done.png'),\n 'download': require('./icon-download.png'),\n 'edit': require('./icon-edit.png'),\n 'emoji-more': require('./icon-emoji-more.png'),\n 'error': require('./icon-error.png'),\n 'file-audio': require('./icon-file-audio.png'),\n 'file-document': require('./icon-file-document.png'),\n 'freeze': require('./icon-freeze.png'),\n 'gif': require('./icon-gif.png'),\n 'info': require('./icon-info.png'),\n 'leave': require('./icon-leave.png'),\n 'members': require('./icon-members.png'),\n 'message': require('./icon-message.png'),\n 'moderation': require('./icon-moderation.png'),\n 'more': require('./icon-more.png'),\n 'mute': require('./icon-mute.png'),\n 'notifications-filled': require('./icon-notifications-filled.png'),\n 'notifications-off-filled': require('./icon-notifications-off-filled.png'),\n 'notifications': require('./icon-notifications.png'),\n 'operator': require('./icon-operator.png'),\n 'photo': require('./icon-photo.png'),\n 'play': require('./icon-play.png'),\n 'plus': require('./icon-plus.png'),\n 'question': require('./icon-question.png'),\n 'radio-off': require('./icon-radio-off.png'),\n 'radio-on': require('./icon-radio-on.png'),\n 'refresh': require('./icon-refresh.png'),\n 'remove': require('./icon-remove.png'),\n 'reply-filled': require('./icon-reply-filled.png'),\n 'reply': require('./icon-reply.png'),\n 'search': require('./icon-search.png'),\n 'send': require('./icon-send.png'),\n 'settings-filled': require('./icon-settings-filled.png'),\n 'spinner': require('./icon-spinner.png'),\n 'streaming': require('./icon-streaming.png'),\n 'supergroup': require('./icon-supergroup.png'),\n 'theme': require('./icon-theme.png'),\n 'thumbnail-none': require('./icon-thumbnail-none.png'),\n 'unarchive': require('./icon-unarchive.png'),\n 'user': require('./icon-user.png'),\n};\nexport default IconAssets;\n"],"mappings":"AAAA,MAAMA,UAAU,GAAG;EACjB,
|
|
1
|
+
{"version":3,"names":["IconAssets","require"],"sources":["index.ts"],"sourcesContent":["const IconAssets = {\n 'chat-hide': require('./ic-chat-hide.png'),\n 'chat-show': require('./ic-chat-show.png'),\n 'add': require('./icon-add.png'),\n 'archive': require('./icon-archive.png'),\n 'arrow-left': require('./icon-arrow-left.png'),\n 'ban': require('./icon-ban.png'),\n 'broadcast': require('./icon-broadcast.png'),\n 'camera': require('./icon-camera.png'),\n 'channels': require('./icon-channels.png'),\n 'chat-filled': require('./icon-chat-filled.png'),\n 'chat': require('./icon-chat.png'),\n 'checkbox-off': require('./icon-checkbox-off.png'),\n 'checkbox-on': require('./icon-checkbox-on.png'),\n 'chevron-down': require('./icon-chevron-down.png'),\n 'chevron-right': require('./icon-chevron-right.png'),\n 'close': require('./icon-close.png'),\n 'copy': require('./icon-copy.png'),\n 'create': require('./icon-create.png'),\n 'delete': require('./icon-delete.png'),\n 'document': require('./icon-document.png'),\n 'done-all': require('./icon-done-all.png'),\n 'done': require('./icon-done.png'),\n 'download': require('./icon-download.png'),\n 'edit': require('./icon-edit.png'),\n 'emoji-more': require('./icon-emoji-more.png'),\n 'error': require('./icon-error.png'),\n 'file-audio': require('./icon-file-audio.png'),\n 'file-document': require('./icon-file-document.png'),\n 'freeze': require('./icon-freeze.png'),\n 'gif': require('./icon-gif.png'),\n 'info': require('./icon-info.png'),\n 'leave': require('./icon-leave.png'),\n 'members': require('./icon-members.png'),\n 'message': require('./icon-message.png'),\n 'moderation': require('./icon-moderation.png'),\n 'more': require('./icon-more.png'),\n 'mute': require('./icon-mute.png'),\n 'notifications-filled': require('./icon-notifications-filled.png'),\n 'notifications-off-filled': require('./icon-notifications-off-filled.png'),\n 'notifications': require('./icon-notifications.png'),\n 'operator': require('./icon-operator.png'),\n 'photo': require('./icon-photo.png'),\n 'play': require('./icon-play.png'),\n 'plus': require('./icon-plus.png'),\n 'question': require('./icon-question.png'),\n 'radio-off': require('./icon-radio-off.png'),\n 'radio-on': require('./icon-radio-on.png'),\n 'refresh': require('./icon-refresh.png'),\n 'remove': require('./icon-remove.png'),\n 'reply-filled': require('./icon-reply-filled.png'),\n 'reply': require('./icon-reply.png'),\n 'search': require('./icon-search.png'),\n 'send': require('./icon-send.png'),\n 'settings-filled': require('./icon-settings-filled.png'),\n 'spinner': require('./icon-spinner.png'),\n 'streaming': require('./icon-streaming.png'),\n 'supergroup': require('./icon-supergroup.png'),\n 'theme': require('./icon-theme.png'),\n 'thumbnail-none': require('./icon-thumbnail-none.png'),\n 'unarchive': require('./icon-unarchive.png'),\n 'user': require('./icon-user.png'),\n};\nexport default IconAssets;\n"],"mappings":"AAAA,MAAMA,UAAU,GAAG;EACjB,WAAW,EAAEC,OAAO,CAAC,oBAAoB,CAAC;EAC1C,WAAW,EAAEA,OAAO,CAAC,oBAAoB,CAAC;EAC1C,KAAK,EAAEA,OAAO,CAAC,gBAAgB,CAAC;EAChC,SAAS,EAAEA,OAAO,CAAC,oBAAoB,CAAC;EACxC,YAAY,EAAEA,OAAO,CAAC,uBAAuB,CAAC;EAC9C,KAAK,EAAEA,OAAO,CAAC,gBAAgB,CAAC;EAChC,WAAW,EAAEA,OAAO,CAAC,sBAAsB,CAAC;EAC5C,QAAQ,EAAEA,OAAO,CAAC,mBAAmB,CAAC;EACtC,UAAU,EAAEA,OAAO,CAAC,qBAAqB,CAAC;EAC1C,aAAa,EAAEA,OAAO,CAAC,wBAAwB,CAAC;EAChD,MAAM,EAAEA,OAAO,CAAC,iBAAiB,CAAC;EAClC,cAAc,EAAEA,OAAO,CAAC,yBAAyB,CAAC;EAClD,aAAa,EAAEA,OAAO,CAAC,wBAAwB,CAAC;EAChD,cAAc,EAAEA,OAAO,CAAC,yBAAyB,CAAC;EAClD,eAAe,EAAEA,OAAO,CAAC,0BAA0B,CAAC;EACpD,OAAO,EAAEA,OAAO,CAAC,kBAAkB,CAAC;EACpC,MAAM,EAAEA,OAAO,CAAC,iBAAiB,CAAC;EAClC,QAAQ,E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CAAC;EAClC,UAAU,EAAEA,OAAO,CAAC,qBAAqB,CAAC;EAC1C,WAAW,EAAEA,OAAO,CAAC,sBAAsB,CAAC;EAC5C,UAAU,EAAEA,OAAO,CAAC,qBAAqB,CAAC;EAC1C,SAAS,EAAEA,OAAO,CAAC,oBAAoB,CAAC;EACxC,QAAQ,EAAEA,OAAO,CAAC,mBAAmB,CAAC;EACtC,cAAc,EAAEA,OAAO,CAAC,yBAAyB,CAAC;EAClD,OAAO,EAAEA,OAAO,CAAC,kBAAkB,CAAC;EACpC,QAAQ,EAAEA,OAAO,CAAC,mBAAmB,CAAC;EACtC,MAAM,EAAEA,OAAO,CAAC,iBAAiB,CAAC;EAClC,iBAAiB,EAAEA,OAAO,CAAC,4BAA4B,CAAC;EACxD,SAAS,EAAEA,OAAO,CAAC,oBAAoB,CAAC;EACxC,WAAW,EAAEA,OAAO,CAAC,sBAAsB,CAAC;EAC5C,YAAY,EAAEA,OAAO,CAAC,uBAAuB,CAAC;EAC9C,OAAO,EAAEA,OAAO,CAAC,kBAAkB,CAAC;EACpC,gBAAgB,EAAEA,OAAO,CAAC,2BAA2B,CAAC;EACtD,WAAW,EAAEA,OAAO,CAAC,sBAAsB,CAAC;EAC5C,MAAM,EAAEA,OAAO,CAAC,iBAAiB;AACnC,CAAC;AACD,eAAeD,UAAU"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { View } from 'react-native';
|
|
5
4
|
import { isFunction } from '@sendbird/uikit-utils';
|
|
6
5
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
7
|
-
|
|
8
6
|
const Box = _ref => {
|
|
9
7
|
let {
|
|
10
8
|
style,
|
|
@@ -16,7 +14,6 @@ const Box = _ref => {
|
|
|
16
14
|
style: [boxStyle, style]
|
|
17
15
|
}, props), children);
|
|
18
16
|
};
|
|
19
|
-
|
|
20
17
|
const useBoxStyle = props => {
|
|
21
18
|
const theme = useUIKitTheme();
|
|
22
19
|
const {
|
|
@@ -28,6 +25,5 @@ const useBoxStyle = props => {
|
|
|
28
25
|
...rest
|
|
29
26
|
};
|
|
30
27
|
};
|
|
31
|
-
|
|
32
28
|
export default Box;
|
|
33
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","isFunction","useUIKitTheme","Box","style","children","props","boxStyle","useBoxStyle","theme","backgroundColor","rest"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleProp, View, ViewProps, ViewStyle } from 'react-native';\n\nimport { isFunction } from '@sendbird/uikit-utils';\n\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport type { UIKitColors, UIKitPalette } from '../../types';\n\ntype BaseBoxProps = Pick<\n ViewStyle,\n | 'flex'\n | 'flexShrink'\n | 'flexGrow'\n | 'flexDirection'\n | 'alignItems'\n | 'justifyContent'\n | 'borderRadius'\n | 'borderWidth'\n | 'borderColor'\n | 'borderBottomColor'\n | 'borderBottomWidth'\n | 'margin'\n | 'marginHorizontal'\n | 'marginVertical'\n | 'marginLeft'\n | 'marginRight'\n | 'marginTop'\n | 'marginBottom'\n | 'padding'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingTop'\n | 'paddingBottom'\n | 'overflow'\n | 'width'\n | 'height'\n> & {\n backgroundColor?: string | ((theme: { colors: UIKitColors; palette: UIKitPalette }) => string);\n};\n\ntype BoxProps = BaseBoxProps & ViewProps;\nconst Box = ({ style, children, ...props }: BoxProps) => {\n const boxStyle = useBoxStyle(props);\n\n return (\n <View style={[boxStyle, style]} {...props}>\n {children}\n </View>\n );\n};\n\nconst useBoxStyle = (props: BaseBoxProps): StyleProp<ViewStyle> => {\n const theme = useUIKitTheme();\n\n const { backgroundColor, ...rest } = props;\n\n return {\n backgroundColor: isFunction(backgroundColor) ? backgroundColor(theme) : backgroundColor,\n ...rest,\n };\n};\n\nexport default Box;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["React","View","isFunction","useUIKitTheme","Box","_ref","style","children","props","boxStyle","useBoxStyle","createElement","_extends","theme","backgroundColor","rest"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleProp, View, ViewProps, ViewStyle } from 'react-native';\n\nimport { isFunction } from '@sendbird/uikit-utils';\n\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport type { UIKitColors, UIKitPalette } from '../../types';\n\ntype BaseBoxProps = Pick<\n ViewStyle,\n | 'flex'\n | 'flexShrink'\n | 'flexGrow'\n | 'flexDirection'\n | 'alignItems'\n | 'justifyContent'\n | 'borderRadius'\n | 'borderWidth'\n | 'borderColor'\n | 'borderBottomColor'\n | 'borderBottomWidth'\n | 'margin'\n | 'marginHorizontal'\n | 'marginVertical'\n | 'marginLeft'\n | 'marginRight'\n | 'marginTop'\n | 'marginBottom'\n | 'padding'\n | 'paddingHorizontal'\n | 'paddingVertical'\n | 'paddingLeft'\n | 'paddingRight'\n | 'paddingTop'\n | 'paddingBottom'\n | 'overflow'\n | 'width'\n | 'height'\n> & {\n backgroundColor?: string | ((theme: { colors: UIKitColors; palette: UIKitPalette }) => string);\n};\n\ntype BoxProps = BaseBoxProps & ViewProps;\nconst Box = ({ style, children, ...props }: BoxProps) => {\n const boxStyle = useBoxStyle(props);\n\n return (\n <View style={[boxStyle, style]} {...props}>\n {children}\n </View>\n );\n};\n\nconst useBoxStyle = (props: BaseBoxProps): StyleProp<ViewStyle> => {\n const theme = useUIKitTheme();\n\n const { backgroundColor, ...rest } = props;\n\n return {\n backgroundColor: isFunction(backgroundColor) ? backgroundColor(theme) : backgroundColor,\n ...rest,\n };\n};\n\nexport default Box;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAoBC,IAAI,QAA8B,cAAc;AAEpE,SAASC,UAAU,QAAQ,uBAAuB;AAElD,OAAOC,aAAa,MAAM,2BAA2B;AAsCrD,MAAMC,GAAG,GAAGC,IAAA,IAA6C;EAAA,IAA5C;IAAEC,KAAK;IAAEC,QAAQ;IAAE,GAAGC;EAAgB,CAAC,GAAAH,IAAA;EAClD,MAAMI,QAAQ,GAAGC,WAAW,CAACF,KAAK,CAAC;EAEnC,oBACER,KAAA,CAAAW,aAAA,CAACV,IAAI,EAAAW,QAAA;IAACN,KAAK,EAAE,CAACG,QAAQ,EAAEH,KAAK;EAAE,GAAKE,KAAK,GACtCD,QAAQ,CACJ;AAEX,CAAC;AAED,MAAMG,WAAW,GAAIF,KAAmB,IAA2B;EACjE,MAAMK,KAAK,GAAGV,aAAa,EAAE;EAE7B,MAAM;IAAEW,eAAe;IAAE,GAAGC;EAAK,CAAC,GAAGP,KAAK;EAE1C,OAAO;IACLM,eAAe,EAAEZ,UAAU,CAACY,eAAe,CAAC,GAAGA,eAAe,CAACD,KAAK,CAAC,GAAGC,eAAe;IACvF,GAAGC;EACL,CAAC;AACH,CAAC;AAED,eAAeX,GAAG"}
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
4
4
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
5
|
-
|
|
6
5
|
const Divider = _ref => {
|
|
7
6
|
let {
|
|
8
7
|
style,
|
|
@@ -21,7 +20,6 @@ const Divider = _ref => {
|
|
|
21
20
|
}]
|
|
22
21
|
}));
|
|
23
22
|
};
|
|
24
|
-
|
|
25
23
|
const styles = createStyleSheet({
|
|
26
24
|
divider: {
|
|
27
25
|
width: '100%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","createStyleSheet","useUIKitTheme","Divider","style","space","colors","styles","divider","paddingHorizontal","inner","backgroundColor","onBackground04","width","height"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleProp, View, ViewStyle } from 'react-native';\n\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype Props = {\n style?: StyleProp<ViewStyle>;\n space?: number;\n};\n\nconst Divider = ({ style, space }: Props) => {\n const { colors } = useUIKitTheme();\n return (\n <View style={[style, styles.divider, { paddingHorizontal: space }]}>\n <View style={[styles.inner, { backgroundColor: colors.onBackground04 }]} />\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n divider: {\n width: '100%',\n height: 1,\n },\n inner: {\n width: '100%',\n height: '100%',\n },\n});\n\nexport default Divider;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"names":["React","View","createStyleSheet","useUIKitTheme","Divider","_ref","style","space","colors","createElement","styles","divider","paddingHorizontal","inner","backgroundColor","onBackground04","width","height"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleProp, View, ViewStyle } from 'react-native';\n\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype Props = {\n style?: StyleProp<ViewStyle>;\n space?: number;\n};\n\nconst Divider = ({ style, space }: Props) => {\n const { colors } = useUIKitTheme();\n return (\n <View style={[style, styles.divider, { paddingHorizontal: space }]}>\n <View style={[styles.inner, { backgroundColor: colors.onBackground04 }]} />\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n divider: {\n width: '100%',\n height: 1,\n },\n inner: {\n width: '100%',\n height: '100%',\n },\n});\n\nexport default Divider;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAoBC,IAAI,QAAmB,cAAc;AAEzD,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AAOrD,MAAMC,OAAO,GAAGC,IAAA,IAA6B;EAAA,IAA5B;IAAEC,KAAK;IAAEC;EAAa,CAAC,GAAAF,IAAA;EACtC,MAAM;IAAEG;EAAO,CAAC,GAAGL,aAAa,EAAE;EAClC,oBACEH,KAAA,CAAAS,aAAA,CAACR,IAAI;IAACK,KAAK,EAAE,CAACA,KAAK,EAAEI,MAAM,CAACC,OAAO,EAAE;MAAEC,iBAAiB,EAAEL;IAAM,CAAC;EAAE,gBACjEP,KAAA,CAAAS,aAAA,CAACR,IAAI;IAACK,KAAK,EAAE,CAACI,MAAM,CAACG,KAAK,EAAE;MAAEC,eAAe,EAAEN,MAAM,CAACO;IAAe,CAAC;EAAE,EAAG,CACtE;AAEX,CAAC;AAED,MAAML,MAAM,GAAGR,gBAAgB,CAAC;EAC9BS,OAAO,EAAE;IACPK,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDJ,KAAK,EAAE;IACLG,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAEF,eAAeb,OAAO"}
|
|
@@ -3,7 +3,6 @@ import { Image, StyleSheet, View } from 'react-native';
|
|
|
3
3
|
import IconAssets from '../../assets/icon';
|
|
4
4
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
5
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
|
-
|
|
7
6
|
const Icon = _ref => {
|
|
8
7
|
let {
|
|
9
8
|
icon,
|
|
@@ -29,7 +28,6 @@ const Icon = _ref => {
|
|
|
29
28
|
}, sizeStyle, style]
|
|
30
29
|
}));
|
|
31
30
|
};
|
|
32
|
-
|
|
33
31
|
const containerStyles = StyleSheet.create({
|
|
34
32
|
container: {
|
|
35
33
|
alignItems: 'center',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Image","StyleSheet","View","IconAssets","createStyleSheet","useUIKitTheme","Icon","icon","color","size","containerStyle","style","sizeStyle","sizeStyles","width","height","colors","containerStyles","container","tintColor","primary","create","alignItems","justifyContent","Assets"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { Image, ImageStyle, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport IconAssets from '../../assets/icon';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype IconNames = keyof typeof IconAssets;\ntype SizeFactor = keyof typeof sizeStyles;\n\ntype Props = {\n icon: IconNames;\n color?: string;\n size?: number;\n style?: StyleProp<ImageStyle>;\n containerStyle?: StyleProp<ViewStyle>;\n};\nconst Icon: ((props: Props) => JSX.Element) & { Assets: typeof IconAssets } = ({\n icon,\n color,\n size = 24,\n containerStyle,\n style,\n}) => {\n const sizeStyle = sizeStyles[size as SizeFactor] ?? { width: size, height: size };\n const { colors } = useUIKitTheme();\n return (\n <View style={[containerStyle, containerStyles.container]}>\n <Image\n resizeMode={'contain'}\n source={IconAssets[icon]}\n style={[{ tintColor: color ?? colors.primary }, sizeStyle, style]}\n />\n </View>\n );\n};\n\nconst containerStyles = StyleSheet.create({\n container: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nconst sizeStyles = createStyleSheet({\n 16: {\n width: 16,\n height: 16,\n },\n 20: {\n width: 20,\n height: 20,\n },\n 24: {\n width: 24,\n height: 24,\n },\n 28: {\n width: 28,\n height: 28,\n },\n 32: {\n width: 32,\n height: 32,\n },\n});\n\nIcon.Assets = IconAssets;\nexport default Icon;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"names":["React","Image","StyleSheet","View","IconAssets","createStyleSheet","useUIKitTheme","Icon","_ref","icon","color","size","containerStyle","style","sizeStyle","sizeStyles","width","height","colors","createElement","containerStyles","container","resizeMode","source","tintColor","primary","create","alignItems","justifyContent","Assets"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { Image, ImageStyle, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport IconAssets from '../../assets/icon';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype IconNames = keyof typeof IconAssets;\ntype SizeFactor = keyof typeof sizeStyles;\n\ntype Props = {\n icon: IconNames;\n color?: string;\n size?: number;\n style?: StyleProp<ImageStyle>;\n containerStyle?: StyleProp<ViewStyle>;\n};\nconst Icon: ((props: Props) => JSX.Element) & { Assets: typeof IconAssets } = ({\n icon,\n color,\n size = 24,\n containerStyle,\n style,\n}) => {\n const sizeStyle = sizeStyles[size as SizeFactor] ?? { width: size, height: size };\n const { colors } = useUIKitTheme();\n return (\n <View style={[containerStyle, containerStyles.container]}>\n <Image\n resizeMode={'contain'}\n source={IconAssets[icon]}\n style={[{ tintColor: color ?? colors.primary }, sizeStyle, style]}\n />\n </View>\n );\n};\n\nconst containerStyles = StyleSheet.create({\n container: {\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nconst sizeStyles = createStyleSheet({\n 16: {\n width: 16,\n height: 16,\n },\n 20: {\n width: 20,\n height: 20,\n },\n 24: {\n width: 24,\n height: 24,\n },\n 28: {\n width: 28,\n height: 28,\n },\n 32: {\n width: 32,\n height: 32,\n },\n});\n\nIcon.Assets = IconAssets;\nexport default Icon;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAyBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAExF,OAAOC,UAAU,MAAM,mBAAmB;AAC1C,OAAOC,gBAAgB,MAAM,+BAA+B;AAC5D,OAAOC,aAAa,MAAM,2BAA2B;AAYrD,MAAMC,IAAqE,GAAGC,IAAA,IAMxE;EAAA,IANyE;IAC7EC,IAAI;IACJC,KAAK;IACLC,IAAI,GAAG,EAAE;IACTC,cAAc;IACdC;EACF,CAAC,GAAAL,IAAA;EACC,MAAMM,SAAS,GAAGC,UAAU,CAACJ,IAAI,CAAe,IAAI;IAAEK,KAAK,EAAEL,IAAI;IAAEM,MAAM,EAAEN;EAAK,CAAC;EACjF,MAAM;IAAEO;EAAO,CAAC,GAAGZ,aAAa,EAAE;EAClC,oBACEN,KAAA,CAAAmB,aAAA,CAAChB,IAAI;IAACU,KAAK,EAAE,CAACD,cAAc,EAAEQ,eAAe,CAACC,SAAS;EAAE,gBACvDrB,KAAA,CAAAmB,aAAA,CAAClB,KAAK;IACJqB,UAAU,EAAE,SAAU;IACtBC,MAAM,EAAEnB,UAAU,CAACK,IAAI,CAAE;IACzBI,KAAK,EAAE,CAAC;MAAEW,SAAS,EAAEd,KAAK,IAAIQ,MAAM,CAACO;IAAQ,CAAC,EAAEX,SAAS,EAAED,KAAK;EAAE,EAClE,CACG;AAEX,CAAC;AAED,MAAMO,eAAe,GAAGlB,UAAU,CAACwB,MAAM,CAAC;EACxCL,SAAS,EAAE;IACTM,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,MAAMb,UAAU,GAAGV,gBAAgB,CAAC;EAClC,EAAE,EAAE;IACFW,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV,CAAC;EACD,EAAE,EAAE;IACFD,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV,CAAC;EACD,EAAE,EAAE;IACFD,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV,CAAC;EACD,EAAE,EAAE;IACFD,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV,CAAC;EACD,EAAE,EAAE;IACFD,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAEFV,IAAI,CAACsB,MAAM,GAAGzB,UAAU;AACxB,eAAeG,IAAI"}
|
|
@@ -1,63 +1,56 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
|
-
|
|
5
3
|
function convertCache(cache) {
|
|
6
4
|
switch (cache) {
|
|
7
5
|
case 'force-cache':
|
|
8
6
|
case 'only-if-cached':
|
|
9
7
|
return 'cacheOnly';
|
|
10
|
-
|
|
11
8
|
default:
|
|
12
9
|
return 'immutable';
|
|
13
10
|
}
|
|
14
11
|
}
|
|
15
|
-
|
|
16
12
|
function convertSource(source) {
|
|
17
13
|
if (Array.isArray(source)) {
|
|
18
14
|
return convertSource(source[0]);
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
if (typeof source === 'number') {
|
|
22
17
|
return source;
|
|
23
18
|
}
|
|
24
|
-
|
|
25
19
|
return {
|
|
26
20
|
uri: source.uri,
|
|
27
21
|
headers: source.headers,
|
|
28
22
|
cache: convertCache(source.cache) //'immutable' | 'web' | 'cacheOnly'
|
|
29
|
-
|
|
30
23
|
};
|
|
31
24
|
}
|
|
32
25
|
|
|
26
|
+
function convertDefaultSource(source) {
|
|
27
|
+
if (typeof source === 'number') {
|
|
28
|
+
return source;
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
33
32
|
function convertResizeMode(mode) {
|
|
34
33
|
switch (mode) {
|
|
35
34
|
case 'center':
|
|
36
35
|
return 'center';
|
|
37
|
-
|
|
38
36
|
case 'contain':
|
|
39
37
|
return 'contain';
|
|
40
|
-
|
|
41
38
|
case 'cover':
|
|
42
39
|
return 'cover';
|
|
43
|
-
|
|
44
40
|
case 'stretch':
|
|
45
41
|
return 'stretch';
|
|
46
|
-
|
|
47
42
|
default:
|
|
48
43
|
return undefined;
|
|
49
44
|
}
|
|
50
45
|
}
|
|
51
|
-
|
|
52
46
|
let FastImage = () => null;
|
|
53
|
-
|
|
54
47
|
try {
|
|
55
48
|
FastImage = require('react-native-fast-image');
|
|
56
49
|
} catch {}
|
|
57
|
-
|
|
58
50
|
const Image_FastImage = _ref => {
|
|
59
51
|
let {
|
|
60
52
|
source,
|
|
53
|
+
defaultSource,
|
|
61
54
|
resizeMode,
|
|
62
55
|
onLoad,
|
|
63
56
|
onError,
|
|
@@ -69,9 +62,9 @@ const Image_FastImage = _ref => {
|
|
|
69
62
|
onError: onError && (() => onError({})),
|
|
70
63
|
style: style,
|
|
71
64
|
source: convertSource(source),
|
|
65
|
+
defaultSource: convertDefaultSource(defaultSource),
|
|
72
66
|
resizeMode: convertResizeMode(resizeMode)
|
|
73
67
|
}));
|
|
74
68
|
};
|
|
75
|
-
|
|
76
69
|
export default Image_FastImage;
|
|
77
70
|
//# sourceMappingURL=Image.fastimage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","convertCache","cache","convertSource","source","Array","isArray","uri","headers","
|
|
1
|
+
{"version":3,"names":["React","convertCache","cache","convertSource","source","Array","isArray","uri","headers","convertDefaultSource","undefined","convertResizeMode","mode","FastImage","require","Image_FastImage","_ref","defaultSource","resizeMode","onLoad","onError","style","props","createElement","_extends","e","nativeEvent"],"sources":["Image.fastimage.tsx"],"sourcesContent":["import React from 'react';\nimport type { FastImageProps, ResizeMode, Source } from 'react-native-fast-image';\n\nimport type { SendbirdImageComponent, SendbirdImageProps } from './index';\n\nfunction convertCache(\n cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached' | undefined,\n): 'immutable' | 'web' | 'cacheOnly' {\n switch (cache) {\n case 'force-cache':\n case 'only-if-cached':\n return 'cacheOnly';\n default:\n return 'immutable';\n }\n}\n\nfunction convertSource(source: SendbirdImageProps['source']): Source | number {\n if (Array.isArray(source)) {\n return convertSource(source[0]);\n }\n\n if (typeof source === 'number') {\n return source;\n }\n\n return {\n uri: source.uri,\n headers: source.headers,\n cache: convertCache(source.cache), //'immutable' | 'web' | 'cacheOnly'\n };\n}\nfunction convertDefaultSource(source?: SendbirdImageProps['defaultSource']): number | undefined {\n if (typeof source === 'number') {\n return source;\n }\n\n return undefined;\n}\n\nfunction convertResizeMode(mode?: SendbirdImageProps['resizeMode']): ResizeMode | undefined {\n switch (mode) {\n case 'center':\n return 'center';\n case 'contain':\n return 'contain';\n case 'cover':\n return 'cover';\n case 'stretch':\n return 'stretch';\n default:\n return undefined;\n }\n}\n\nlet FastImage: (props: FastImageProps) => JSX.Element | null = () => null;\n\ntry {\n FastImage = require('react-native-fast-image') as (props: FastImageProps) => JSX.Element;\n} catch {}\n\nconst Image_FastImage: SendbirdImageComponent = ({\n source,\n defaultSource,\n resizeMode,\n onLoad,\n onError,\n style,\n ...props\n}) => {\n return (\n <FastImage\n {...props}\n onLoad={onLoad && ((e) => onLoad(e.nativeEvent))}\n onError={onError && (() => onError({}))}\n style={style as FastImageProps['style']}\n source={convertSource(source)}\n defaultSource={convertDefaultSource(defaultSource)}\n resizeMode={convertResizeMode(resizeMode)}\n />\n );\n};\n\nexport default Image_FastImage;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAKzB,SAASC,YAAYA,CACnBC,KAA2E,EACxC;EACnC,QAAQA,KAAK;IACX,KAAK,aAAa;IAClB,KAAK,gBAAgB;MACnB,OAAO,WAAW;IACpB;MACE,OAAO,WAAW;EAAC;AAEzB;AAEA,SAASC,aAAaA,CAACC,MAAoC,EAAmB;EAC5E,IAAIC,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,EAAE;IACzB,OAAOD,aAAa,CAACC,MAAM,CAAC,CAAC,CAAC,CAAC;EACjC;EAEA,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOA,MAAM;EACf;EAEA,OAAO;IACLG,GAAG,EAAEH,MAAM,CAACG,GAAG;IACfC,OAAO,EAAEJ,MAAM,CAACI,OAAO;IACvBN,KAAK,EAAED,YAAY,CAACG,MAAM,CAACF,KAAK,CAAC,CAAE;EACrC,CAAC;AACH;;AACA,SAASO,oBAAoBA,CAACL,MAA4C,EAAsB;EAC9F,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOA,MAAM;EACf;EAEA,OAAOM,SAAS;AAClB;AAEA,SAASC,iBAAiBA,CAACC,IAAuC,EAA0B;EAC1F,QAAQA,IAAI;IACV,KAAK,QAAQ;MACX,OAAO,QAAQ;IACjB,KAAK,SAAS;MACZ,OAAO,SAAS;IAClB,KAAK,OAAO;MACV,OAAO,OAAO;IAChB,KAAK,SAAS;MACZ,OAAO,SAAS;IAClB;MACE,OAAOF,SAAS;EAAC;AAEvB;AAEA,IAAIG,SAAwD,GAAGA,CAAA,KAAM,IAAI;AAEzE,IAAI;EACFA,SAAS,GAAGC,OAAO,CAAC,yBAAyB,CAA2C;AAC1F,CAAC,CAAC,MAAM,CAAC;AAET,MAAMC,eAAuC,GAAGC,IAAA,IAQ1C;EAAA,IAR2C;IAC/CZ,MAAM;IACNa,aAAa;IACbC,UAAU;IACVC,MAAM;IACNC,OAAO;IACPC,KAAK;IACL,GAAGC;EACL,CAAC,GAAAN,IAAA;EACC,oBACEhB,KAAA,CAAAuB,aAAA,CAACV,SAAS,EAAAW,QAAA,KACJF,KAAK;IACTH,MAAM,EAAEA,MAAM,KAAMM,CAAC,IAAKN,MAAM,CAACM,CAAC,CAACC,WAAW,CAAC,CAAE;IACjDN,OAAO,EAAEA,OAAO,KAAK,MAAMA,OAAO,CAAC,CAAC,CAAC,CAAC,CAAE;IACxCC,KAAK,EAAEA,KAAiC;IACxCjB,MAAM,EAAED,aAAa,CAACC,MAAM,CAAE;IAC9Ba,aAAa,EAAER,oBAAoB,CAACQ,aAAa,CAAE;IACnDC,UAAU,EAAEP,iBAAiB,CAACO,UAAU;EAAE,GAC1C;AAEN,CAAC;AAED,eAAeH,eAAe"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { Image } from 'react-native';
|
|
5
|
-
|
|
6
4
|
const Image_ReactNative = _ref => {
|
|
7
5
|
let {
|
|
8
6
|
onLoad,
|
|
@@ -19,6 +17,5 @@ const Image_ReactNative = _ref => {
|
|
|
19
17
|
onLoad: onLoad && (e => onLoad(e.nativeEvent.source))
|
|
20
18
|
}));
|
|
21
19
|
};
|
|
22
|
-
|
|
23
20
|
export default Image_ReactNative;
|
|
24
21
|
//# sourceMappingURL=Image.reactnative.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Image","Image_ReactNative","onLoad","onError","style","tintColor","props","e","nativeEvent","source"],"sources":["Image.reactnative.tsx"],"sourcesContent":["import React from 'react';\nimport { Image } from 'react-native';\n\nimport type { SendbirdImageComponent } from './index';\n\nconst Image_ReactNative: SendbirdImageComponent = ({ onLoad, onError, style, tintColor, ...props }) => {\n return (\n <Image\n {...props}\n style={[style, { tintColor }]}\n onError={onError && ((e) => onError(e.nativeEvent))}\n onLoad={onLoad && ((e) => onLoad(e.nativeEvent.source))}\n />\n );\n};\n\nexport default Image_ReactNative;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["React","Image","Image_ReactNative","_ref","onLoad","onError","style","tintColor","props","createElement","_extends","e","nativeEvent","source"],"sources":["Image.reactnative.tsx"],"sourcesContent":["import React from 'react';\nimport { Image } from 'react-native';\n\nimport type { SendbirdImageComponent } from './index';\n\nconst Image_ReactNative: SendbirdImageComponent = ({ onLoad, onError, style, tintColor, ...props }) => {\n return (\n <Image\n {...props}\n style={[style, { tintColor }]}\n onError={onError && ((e) => onError(e.nativeEvent))}\n onLoad={onLoad && ((e) => onLoad(e.nativeEvent.source))}\n />\n );\n};\n\nexport default Image_ReactNative;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,QAAQ,cAAc;AAIpC,MAAMC,iBAAyC,GAAGC,IAAA,IAAqD;EAAA,IAApD;IAAEC,MAAM;IAAEC,OAAO;IAAEC,KAAK;IAAEC,SAAS;IAAE,GAAGC;EAAM,CAAC,GAAAL,IAAA;EAChG,oBACEH,KAAA,CAAAS,aAAA,CAACR,KAAK,EAAAS,QAAA,KACAF,KAAK;IACTF,KAAK,EAAE,CAACA,KAAK,EAAE;MAAEC;IAAU,CAAC,CAAE;IAC9BF,OAAO,EAAEA,OAAO,KAAMM,CAAC,IAAKN,OAAO,CAACM,CAAC,CAACC,WAAW,CAAC,CAAE;IACpDR,MAAM,EAAEA,MAAM,KAAMO,CAAC,IAAKP,MAAM,CAACO,CAAC,CAACC,WAAW,CAACC,MAAM,CAAC;EAAE,GACxD;AAEN,CAAC;AAED,eAAeX,iBAAiB"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { NativeModules } from 'react-native';
|
|
2
|
-
|
|
3
2
|
function getImageModule() {
|
|
4
3
|
const hasFastImage = Boolean(NativeModules.FastImageView);
|
|
5
|
-
|
|
6
4
|
if (hasFastImage) {
|
|
7
5
|
try {
|
|
8
6
|
return require('./Image.fastimage').default;
|
|
@@ -13,6 +11,5 @@ function getImageModule() {
|
|
|
13
11
|
return require('./Image.reactnative').default;
|
|
14
12
|
}
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
export default getImageModule();
|
|
18
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","getImageModule","hasFastImage","Boolean","FastImageView","require","default","e"],"sources":["index.ts"],"sourcesContent":["import type { ImageProps as NativeImageProps } from 'react-native';\nimport { NativeModules } from 'react-native';\n\nexport interface SendbirdImageProps extends Omit<NativeImageProps, 'onLoad' | 'onError'> {\n onLoad?: (event: { width: number; height: number }) => void;\n onError?: (event: { error?: unknown }) => void;\n tintColor?: string;\n}\n\nexport type SendbirdImageComponent = (props: SendbirdImageProps) => JSX.Element;\n\nfunction getImageModule(): SendbirdImageComponent {\n const hasFastImage = Boolean(NativeModules.FastImageView);\n if (hasFastImage) {\n try {\n return require('./Image.fastimage').default;\n } catch (e) {\n return require('./Image.reactnative').default;\n }\n } else {\n return require('./Image.reactnative').default;\n }\n}\n\nexport default getImageModule();\n"],"mappings":"AACA,SAASA,
|
|
1
|
+
{"version":3,"names":["NativeModules","getImageModule","hasFastImage","Boolean","FastImageView","require","default","e"],"sources":["index.ts"],"sourcesContent":["import type { ImageProps as NativeImageProps } from 'react-native';\nimport { NativeModules } from 'react-native';\n\nexport interface SendbirdImageProps extends Omit<NativeImageProps, 'onLoad' | 'onError'> {\n onLoad?: (event: { width: number; height: number }) => void;\n onError?: (event: { error?: unknown }) => void;\n tintColor?: string;\n}\n\nexport type SendbirdImageComponent = (props: SendbirdImageProps) => JSX.Element;\n\nfunction getImageModule(): SendbirdImageComponent {\n const hasFastImage = Boolean(NativeModules.FastImageView);\n if (hasFastImage) {\n try {\n return require('./Image.fastimage').default;\n } catch (e) {\n return require('./Image.reactnative').default;\n }\n } else {\n return require('./Image.reactnative').default;\n }\n}\n\nexport default getImageModule();\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,cAAc;AAU5C,SAASC,cAAcA,CAAA,EAA2B;EAChD,MAAMC,YAAY,GAAGC,OAAO,CAACH,aAAa,CAACI,aAAa,CAAC;EACzD,IAAIF,YAAY,EAAE;IAChB,IAAI;MACF,OAAOG,OAAO,CAAC,mBAAmB,CAAC,CAACC,OAAO;IAC7C,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,OAAOF,OAAO,CAAC,qBAAqB,CAAC,CAACC,OAAO;IAC/C;EACF,CAAC,MAAM;IACL,OAAOD,OAAO,CAAC,qBAAqB,CAAC,CAACC,OAAO;EAC/C;AACF;AAEA,eAAeL,cAAc,EAAE"}
|
|
@@ -6,7 +6,6 @@ import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
|
6
6
|
import Box from '../Box';
|
|
7
7
|
import Icon from '../Icon';
|
|
8
8
|
import Image from '../Image';
|
|
9
|
-
|
|
10
9
|
const useRetry = function (hasError) {
|
|
11
10
|
let retryCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5;
|
|
12
11
|
if (Platform.OS === 'android') return '';
|
|
@@ -24,7 +23,6 @@ const useRetry = function (hasError) {
|
|
|
24
23
|
}, retryCountRef.current * 5000);
|
|
25
24
|
}
|
|
26
25
|
};
|
|
27
|
-
|
|
28
26
|
return reloadReservation();
|
|
29
27
|
} else {
|
|
30
28
|
return clearTimeout(retryTimeoutRef.current);
|
|
@@ -32,7 +30,6 @@ const useRetry = function (hasError) {
|
|
|
32
30
|
}, [hasError]);
|
|
33
31
|
return retryCountRef.current;
|
|
34
32
|
};
|
|
35
|
-
|
|
36
33
|
const ImageWithPlaceholder = props => {
|
|
37
34
|
const {
|
|
38
35
|
colors
|
|
@@ -61,7 +58,6 @@ const ImageWithPlaceholder = props => {
|
|
|
61
58
|
color: colors.onBackground02
|
|
62
59
|
}));
|
|
63
60
|
};
|
|
64
|
-
|
|
65
61
|
const styles = createStyleSheet({
|
|
66
62
|
hide: {
|
|
67
63
|
display: 'none'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRef","useState","Platform","StyleSheet","useForceUpdate","createStyleSheet","useUIKitTheme","Box","Icon","Image","useRetry","hasError","retryCount","OS","forceUpdate","retryCountRef","retryTimeoutRef","reloadReservation","current","setTimeout","clearTimeout","ImageWithPlaceholder","props","colors","imageNotFound","setImageNotFound","key","overflow","width","height","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useState","Platform","StyleSheet","useForceUpdate","createStyleSheet","useUIKitTheme","Box","Icon","Image","useRetry","hasError","retryCount","arguments","length","undefined","OS","forceUpdate","retryCountRef","retryTimeoutRef","reloadReservation","current","setTimeout","clearTimeout","ImageWithPlaceholder","props","colors","imageNotFound","setImageNotFound","key","createElement","style","overflow","width","height","backgroundColor","onBackground04","source","absoluteFill","styles","hide","resizeMode","resizeMethod","onError","onLoad","containerStyle","icon","size","color","onBackground02","display"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Platform, StyleProp, StyleSheet, ViewStyle } from 'react-native';\n\nimport { useForceUpdate } from '@sendbird/uikit-utils';\n\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Box from '../Box';\nimport Icon from '../Icon';\nimport Image from '../Image';\n\nconst useRetry = (hasError: boolean, retryCount = 5) => {\n if (Platform.OS === 'android') return '';\n\n const forceUpdate = useForceUpdate();\n const retryCountRef = useRef(1);\n const retryTimeoutRef = useRef<NodeJS.Timeout>();\n\n useEffect(() => {\n if (hasError) {\n const reloadReservation = () => {\n if (retryCountRef.current < retryCount) {\n retryTimeoutRef.current = setTimeout(() => {\n retryCountRef.current++;\n reloadReservation();\n forceUpdate();\n }, retryCountRef.current * 5000);\n }\n };\n\n return reloadReservation();\n } else {\n return clearTimeout(retryTimeoutRef.current);\n }\n }, [hasError]);\n\n return retryCountRef.current;\n};\n\ntype Props = {\n source: number | { uri: string };\n width?: number | string;\n height?: number | string;\n style?: StyleProp<ViewStyle>;\n};\nconst ImageWithPlaceholder = (props: Props) => {\n const { colors } = useUIKitTheme();\n const [imageNotFound, setImageNotFound] = useState(false);\n\n const key = useRetry(imageNotFound);\n return (\n <Box\n style={[{ overflow: 'hidden', width: props.width, height: props.height }, props.style]}\n backgroundColor={colors.onBackground04}\n >\n <Image\n key={key}\n source={props.source}\n style={[StyleSheet.absoluteFill, imageNotFound && styles.hide]}\n resizeMode={'cover'}\n resizeMethod={'resize'}\n onError={() => setImageNotFound(true)}\n onLoad={() => setImageNotFound(false)}\n />\n {imageNotFound && (\n <Icon\n containerStyle={StyleSheet.absoluteFill}\n icon={'thumbnail-none'}\n size={48}\n color={colors.onBackground02}\n />\n )}\n </Box>\n );\n};\n\nconst styles = createStyleSheet({\n hide: {\n display: 'none',\n },\n});\n\nexport default ImageWithPlaceholder;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,QAAQ,EAAaC,UAAU,QAAmB,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G3B,QAAQ,CAAC,KAAK,CAAC;EAEzD,MAAM4B,GAAG,GAAGnB,QAAQ,CAACiB,aAAa,CAAC;EACnC,oBACE7B,KAAA,CAAAgC,aAAA,CAACvB,GAAG;IACFwB,KAAK,EAAE,CAAC;MAAEC,QAAQ,EAAE,QAAQ;MAAEC,KAAK,EAAER,KAAK,CAACQ,KAAK;MAAEC,MAAM,EAAET,KAAK,CAACS;IAAO,CAAC,EAAET,KAAK,CAACM,KAAK,CAAE;IACvFI,eAAe,EAAET,MAAM,CAACU;EAAe,gBAEvCtC,KAAA,CAAAgC,aAAA,CAACrB,KAAK;IACJoB,GAAG,EAAEA,GAAI;IACTQ,MAAM,EAAEZ,KAAK,CAACY,MAAO;IACrBN,KAAK,EAAE,CAAC5B,UAAU,CAACmC,YAAY,EAAEX,aAAa,IAAIY,MAAM,CAACC,IAAI,CAAE;IAC/DC,UAAU,EAAE,OAAQ;IACpBC,YAAY,EAAE,QAAS;IACvBC,OAAO,EAAEA,CAAA,KAAMf,gBAAgB,CAAC,IAAI,CAAE;IACtCgB,MAAM,EAAEA,CAAA,KAAMhB,gBAAgB,CAAC,KAAK;EAAE,EACtC,EACDD,aAAa,iBACZ7B,KAAA,CAAAgC,aAAA,CAACtB,IAAI;IACHqC,cAAc,EAAE1C,UAAU,CAACmC,YAAa;IACxCQ,IAAI,EAAE,gBAAiB;IACvBC,IAAI,EAAE,EAAG;IACTC,KAAK,EAAEtB,MAAM,CAACuB;EAAe,EAEhC,CACG;AAEV,CAAC;AAED,MAAMV,MAAM,GAAGlC,gBAAgB,CAAC;EAC9BmC,IAAI,EAAE;IACJU,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEF,eAAe1B,oBAAoB"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
4
3
|
import { Animated, Dimensions, KeyboardAvoidingView, PanResponder, Platform, Pressable, Modal as RNModal, StyleSheet, TouchableWithoutFeedback, useWindowDimensions } from 'react-native';
|
|
5
4
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
6
5
|
import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
7
6
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
8
|
-
|
|
9
7
|
/**
|
|
10
8
|
* Modal Open: Triggered by Modal.props.visible state changed to true
|
|
11
9
|
* - visible true -> modalVisible true -> animation start
|
|
@@ -40,11 +38,8 @@ const Modal = _ref => {
|
|
|
40
38
|
topInset
|
|
41
39
|
} = useHeaderStyle();
|
|
42
40
|
const [modalVisible, setModalVisible] = useState(false);
|
|
43
|
-
|
|
44
41
|
const showAction = () => setModalVisible(true);
|
|
45
|
-
|
|
46
42
|
const hideAction = () => hideTransition(() => setModalVisible(false));
|
|
47
|
-
|
|
48
43
|
const {
|
|
49
44
|
width,
|
|
50
45
|
height
|
|
@@ -70,7 +65,8 @@ const Modal = _ref => {
|
|
|
70
65
|
opacity: backdrop.opacity,
|
|
71
66
|
backgroundColor: palette.onBackgroundLight03
|
|
72
67
|
}]
|
|
73
|
-
})), /*#__PURE__*/React.createElement(KeyboardAvoidingView
|
|
68
|
+
})), /*#__PURE__*/React.createElement(KeyboardAvoidingView
|
|
69
|
+
// NOTE: This is trick for Android.
|
|
74
70
|
// When orientation is changed on Android, the offset that to avoid soft-keyboard is not updated normally.
|
|
75
71
|
, {
|
|
76
72
|
key: `${width}-${height}`,
|
|
@@ -90,15 +86,14 @@ const Modal = _ref => {
|
|
|
90
86
|
}]
|
|
91
87
|
}],
|
|
92
88
|
pointerEvents: 'box-none'
|
|
93
|
-
}, panResponder.panHandlers), /*#__PURE__*/React.createElement(Pressable
|
|
89
|
+
}, panResponder.panHandlers), /*#__PURE__*/React.createElement(Pressable
|
|
90
|
+
// NOTE: https://github.com/facebook/react-native/issues/14295
|
|
94
91
|
// Due to 'Pressable', the width of the children must be explicitly specified as a number.
|
|
95
92
|
, null, children))));
|
|
96
93
|
};
|
|
97
|
-
|
|
98
94
|
const isHideGesture = (distanceY, velocityY) => {
|
|
99
95
|
return distanceY > 125 || distanceY > 0 && velocityY > 0.1;
|
|
100
96
|
};
|
|
101
|
-
|
|
102
97
|
const useModalPanResponder = (type, translateY, show, hide) => {
|
|
103
98
|
if (type === 'fade' || type === 'slide-no-gesture') return {
|
|
104
99
|
panHandlers: {}
|
|
@@ -128,7 +123,6 @@ const useModalPanResponder = (type, translateY, show, hide) => {
|
|
|
128
123
|
}
|
|
129
124
|
})).current;
|
|
130
125
|
};
|
|
131
|
-
|
|
132
126
|
const useModalAnimation = type => {
|
|
133
127
|
const initialY = type === 'fade' ? 0 : Dimensions.get('window').height;
|
|
134
128
|
const baseAnimBackground = useRef(new Animated.Value(0)).current;
|
|
@@ -146,7 +140,6 @@ const useModalAnimation = type => {
|
|
|
146
140
|
outputRange: [0, 1]
|
|
147
141
|
})
|
|
148
142
|
};
|
|
149
|
-
|
|
150
143
|
const createTransition = toValue => {
|
|
151
144
|
const config = {
|
|
152
145
|
duration: 250,
|
|
@@ -160,16 +153,15 @@ const useModalAnimation = type => {
|
|
|
160
153
|
...config
|
|
161
154
|
})]).start;
|
|
162
155
|
};
|
|
163
|
-
|
|
164
156
|
return {
|
|
165
157
|
content,
|
|
166
158
|
backdrop,
|
|
167
159
|
showTransition: createTransition(1),
|
|
168
160
|
hideTransition: createTransition(0)
|
|
169
161
|
};
|
|
170
|
-
};
|
|
171
|
-
|
|
162
|
+
};
|
|
172
163
|
|
|
164
|
+
// NOTE: onDismiss is supports iOS only
|
|
173
165
|
const useOnDismiss = (visible, onDismiss) => {
|
|
174
166
|
const prevVisible = usePrevProp(visible);
|
|
175
167
|
useEffect(() => {
|
|
@@ -177,7 +169,6 @@ const useOnDismiss = (visible, onDismiss) => {
|
|
|
177
169
|
if (prevVisible && !visible) onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
178
170
|
}, [prevVisible, visible]);
|
|
179
171
|
};
|
|
180
|
-
|
|
181
172
|
const usePrevProp = prop => {
|
|
182
173
|
const prev = useRef(prop);
|
|
183
174
|
const curr = useRef(prop);
|
|
@@ -187,7 +178,6 @@ const usePrevProp = prop => {
|
|
|
187
178
|
});
|
|
188
179
|
return prev.current;
|
|
189
180
|
};
|
|
190
|
-
|
|
191
181
|
const styles = createStyleSheet({
|
|
192
182
|
background: {
|
|
193
183
|
flex: 1
|