@sendbird/uikit-react-native 1.1.0 → 1.1.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.
Files changed (144) hide show
  1. package/lib/commonjs/components/FileViewer.js +11 -13
  2. package/lib/commonjs/components/FileViewer.js.map +1 -1
  3. package/lib/commonjs/components/MessageRenderer/FileMessage/ImageFileMessage.js +47 -15
  4. package/lib/commonjs/components/MessageRenderer/FileMessage/ImageFileMessage.js.map +1 -1
  5. package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js +51 -34
  6. package/lib/commonjs/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +1 -1
  7. package/lib/commonjs/components/MessageRenderer/MessageIncomingSenderName.js +2 -1
  8. package/lib/commonjs/components/MessageRenderer/MessageIncomingSenderName.js.map +1 -1
  9. package/lib/commonjs/components/MessageRenderer/MessageOutgoingStatus.js +20 -56
  10. package/lib/commonjs/components/MessageRenderer/MessageOutgoingStatus.js.map +1 -1
  11. package/lib/commonjs/components/MessageRenderer/index.js +7 -2
  12. package/lib/commonjs/components/MessageRenderer/index.js.map +1 -1
  13. package/lib/commonjs/{components → containers}/GroupChannelPreviewContainer.js +30 -53
  14. package/lib/commonjs/containers/GroupChannelPreviewContainer.js.map +1 -0
  15. package/lib/commonjs/{InternalErrorBoundary.js → containers/InternalErrorBoundaryContainer.js} +5 -5
  16. package/lib/commonjs/containers/InternalErrorBoundaryContainer.js.map +1 -0
  17. package/lib/commonjs/{SendbirdUIKitContainer.js → containers/SendbirdUIKitContainer.js} +10 -10
  18. package/lib/commonjs/containers/SendbirdUIKitContainer.js.map +1 -0
  19. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js +39 -6
  20. package/lib/commonjs/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
  21. package/lib/commonjs/domain/groupChannelList/types.js.map +1 -1
  22. package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsInfo.js +1 -1
  23. package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsInfo.js.map +1 -1
  24. package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js +35 -2
  25. package/lib/commonjs/domain/groupChannelSettings/module/moduleContext.js.map +1 -1
  26. package/lib/commonjs/fragments/createGroupChannelFragment.js +1 -1
  27. package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
  28. package/lib/commonjs/fragments/createGroupChannelListFragment.js +6 -6
  29. package/lib/commonjs/fragments/createGroupChannelListFragment.js.map +1 -1
  30. package/lib/commonjs/index.js +1 -1
  31. package/lib/commonjs/index.js.map +1 -1
  32. package/lib/commonjs/{InternalLocalCacheStorage.js → libs/InternalLocalCacheStorage.js} +0 -0
  33. package/lib/commonjs/libs/InternalLocalCacheStorage.js.map +1 -0
  34. package/lib/commonjs/libs/SBUError.js +41 -0
  35. package/lib/commonjs/libs/SBUError.js.map +1 -0
  36. package/lib/commonjs/libs/SBUUtils.js +20 -0
  37. package/lib/commonjs/libs/SBUUtils.js.map +1 -0
  38. package/lib/commonjs/localization/StringSet.type.js +6 -0
  39. package/lib/commonjs/localization/StringSet.type.js.map +1 -1
  40. package/lib/commonjs/platform/createFileService.expo.js +6 -4
  41. package/lib/commonjs/platform/createFileService.expo.js.map +1 -1
  42. package/lib/commonjs/platform/createFileService.native.js +20 -8
  43. package/lib/commonjs/platform/createFileService.native.js.map +1 -1
  44. package/lib/commonjs/platform/types.js +4 -0
  45. package/lib/commonjs/platform/types.js.map +1 -1
  46. package/lib/commonjs/version.js +1 -1
  47. package/lib/commonjs/version.js.map +1 -1
  48. package/lib/module/components/FileViewer.js +13 -12
  49. package/lib/module/components/FileViewer.js.map +1 -1
  50. package/lib/module/components/MessageRenderer/FileMessage/ImageFileMessage.js +48 -17
  51. package/lib/module/components/MessageRenderer/FileMessage/ImageFileMessage.js.map +1 -1
  52. package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js +52 -35
  53. package/lib/module/components/MessageRenderer/FileMessage/VideoFileMessage.js.map +1 -1
  54. package/lib/module/components/MessageRenderer/MessageIncomingSenderName.js +2 -1
  55. package/lib/module/components/MessageRenderer/MessageIncomingSenderName.js.map +1 -1
  56. package/lib/module/components/MessageRenderer/MessageOutgoingStatus.js +17 -51
  57. package/lib/module/components/MessageRenderer/MessageOutgoingStatus.js.map +1 -1
  58. package/lib/module/components/MessageRenderer/index.js +7 -2
  59. package/lib/module/components/MessageRenderer/index.js.map +1 -1
  60. package/lib/module/{components → containers}/GroupChannelPreviewContainer.js +28 -51
  61. package/lib/module/containers/GroupChannelPreviewContainer.js.map +1 -0
  62. package/lib/module/{InternalErrorBoundary.js → containers/InternalErrorBoundaryContainer.js} +5 -5
  63. package/lib/module/containers/InternalErrorBoundaryContainer.js.map +1 -0
  64. package/lib/module/{SendbirdUIKitContainer.js → containers/SendbirdUIKitContainer.js} +10 -10
  65. package/lib/module/containers/SendbirdUIKitContainer.js.map +1 -0
  66. package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js +38 -7
  67. package/lib/module/domain/groupChannel/component/GroupChannelInput/SendInput.js.map +1 -1
  68. package/lib/module/domain/groupChannelList/types.js.map +1 -1
  69. package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsInfo.js +1 -1
  70. package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsInfo.js.map +1 -1
  71. package/lib/module/domain/groupChannelSettings/module/moduleContext.js +34 -3
  72. package/lib/module/domain/groupChannelSettings/module/moduleContext.js.map +1 -1
  73. package/lib/module/fragments/createGroupChannelFragment.js +1 -1
  74. package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
  75. package/lib/module/fragments/createGroupChannelListFragment.js +6 -6
  76. package/lib/module/fragments/createGroupChannelListFragment.js.map +1 -1
  77. package/lib/module/index.js +1 -1
  78. package/lib/module/index.js.map +1 -1
  79. package/lib/module/{InternalLocalCacheStorage.js → libs/InternalLocalCacheStorage.js} +0 -0
  80. package/lib/module/libs/InternalLocalCacheStorage.js.map +1 -0
  81. package/lib/module/libs/SBUError.js +32 -0
  82. package/lib/module/libs/SBUError.js.map +1 -0
  83. package/lib/module/libs/SBUUtils.js +10 -0
  84. package/lib/module/libs/SBUUtils.js.map +1 -0
  85. package/lib/module/localization/StringSet.type.js +6 -0
  86. package/lib/module/localization/StringSet.type.js.map +1 -1
  87. package/lib/module/platform/createFileService.expo.js +5 -4
  88. package/lib/module/platform/createFileService.expo.js.map +1 -1
  89. package/lib/module/platform/createFileService.native.js +18 -8
  90. package/lib/module/platform/createFileService.native.js.map +1 -1
  91. package/lib/module/platform/types.js +1 -1
  92. package/lib/module/platform/types.js.map +1 -1
  93. package/lib/module/version.js +1 -1
  94. package/lib/module/version.js.map +1 -1
  95. package/lib/typescript/src/{components → containers}/GroupChannelPreviewContainer.d.ts +0 -0
  96. package/lib/typescript/src/{InternalErrorBoundary.d.ts → containers/InternalErrorBoundaryContainer.d.ts} +3 -3
  97. package/lib/typescript/src/{SendbirdUIKitContainer.d.ts → containers/SendbirdUIKitContainer.d.ts} +4 -4
  98. package/lib/typescript/src/domain/groupChannelList/types.d.ts +2 -2
  99. package/lib/typescript/src/index.d.ts +1 -1
  100. package/lib/typescript/src/{InternalLocalCacheStorage.d.ts → libs/InternalLocalCacheStorage.d.ts} +2 -2
  101. package/lib/typescript/src/libs/SBUError.d.ts +14 -0
  102. package/lib/typescript/src/libs/SBUUtils.d.ts +3 -0
  103. package/lib/typescript/src/localization/StringSet.type.d.ts +3 -0
  104. package/lib/typescript/src/platform/types.d.ts +2 -1
  105. package/lib/typescript/src/version.d.ts +1 -1
  106. package/package.json +5 -5
  107. package/src/components/FileViewer.tsx +19 -12
  108. package/src/components/MessageRenderer/FileMessage/ImageFileMessage.tsx +55 -12
  109. package/src/components/MessageRenderer/FileMessage/VideoFileMessage.tsx +38 -30
  110. package/src/components/MessageRenderer/MessageIncomingSenderName.tsx +1 -1
  111. package/src/components/MessageRenderer/MessageOutgoingStatus.tsx +13 -46
  112. package/src/components/MessageRenderer/index.tsx +5 -2
  113. package/src/{components → containers}/GroupChannelPreviewContainer.tsx +20 -37
  114. package/src/{InternalErrorBoundary.tsx → containers/InternalErrorBoundaryContainer.tsx} +4 -4
  115. package/src/{SendbirdUIKitContainer.tsx → containers/SendbirdUIKitContainer.tsx} +13 -13
  116. package/src/domain/groupChannel/component/GroupChannelInput/SendInput.tsx +28 -4
  117. package/src/domain/groupChannelList/types.ts +2 -2
  118. package/src/domain/groupChannelSettings/component/GroupChannelSettingsInfo.tsx +1 -1
  119. package/src/domain/groupChannelSettings/module/moduleContext.tsx +26 -3
  120. package/src/fragments/createGroupChannelFragment.tsx +1 -1
  121. package/src/fragments/createGroupChannelListFragment.tsx +6 -6
  122. package/src/index.ts +1 -1
  123. package/src/{InternalLocalCacheStorage.ts → libs/InternalLocalCacheStorage.ts} +1 -1
  124. package/src/libs/SBUError.ts +26 -0
  125. package/src/libs/SBUUtils.ts +9 -0
  126. package/src/localization/StringSet.type.ts +10 -0
  127. package/src/platform/createFileService.expo.ts +5 -4
  128. package/src/platform/createFileService.native.ts +17 -8
  129. package/src/platform/types.ts +3 -1
  130. package/src/version.ts +1 -1
  131. package/lib/commonjs/InternalErrorBoundary.js.map +0 -1
  132. package/lib/commonjs/InternalLocalCacheStorage.js.map +0 -1
  133. package/lib/commonjs/SendbirdUIKitContainer.js.map +0 -1
  134. package/lib/commonjs/components/GroupChannelPreviewContainer.js.map +0 -1
  135. package/lib/commonjs/components/SBUPressable.js +0 -45
  136. package/lib/commonjs/components/SBUPressable.js.map +0 -1
  137. package/lib/module/InternalErrorBoundary.js.map +0 -1
  138. package/lib/module/InternalLocalCacheStorage.js.map +0 -1
  139. package/lib/module/SendbirdUIKitContainer.js.map +0 -1
  140. package/lib/module/components/GroupChannelPreviewContainer.js.map +0 -1
  141. package/lib/module/components/SBUPressable.js +0 -33
  142. package/lib/module/components/SBUPressable.js.map +0 -1
  143. package/lib/typescript/src/components/SBUPressable.d.ts +0 -18
  144. package/src/components/SBUPressable.tsx +0 -40
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useState","useChannelHandler","GroupChannelPreview","LoadingSpinner","createStyleSheet","useUIKitTheme","Icon","getFileExtension","getFileType","isDifferentChannel","isMyMessage","useForceUpdate","useIIFE","useUniqId","useLocalization","useSendbirdChat","ChannelCover","SBUPressable","iconMapper","audio","image","video","file","GroupChannelPreviewContainer","onPress","onLongPress","channel","currentUser","sdk","features","STRINGS","colors","typingUsers","setTypingUsers","forceUpdate","channelListTypingIndicatorEnabled","typingId","onTypingStatusUpdated","eventChannel","getTypingUsers","channelListMessageReceiptStatusEnabled","receiptId","onDeliveryReceiptUpdated","isGroupChannel","lastMessage","userId","onReadReceiptUpdated","bodyText","length","LABELS","TYPING_INDICATOR_TYPINGS","GROUP_CHANNEL_LIST","CHANNEL_PREVIEW_BODY","bodyIcon","isFileMessage","undefined","type","name","titleCaptionIcon","sendingStatus","styles","error","getUnreadMemberCount","secondary","deliveryReceiptEnabled","getUndeliveredMemberCount","onBackground03","coverUrl","CHANNEL_PREVIEW_TITLE","CHANNEL_PREVIEW_TITLE_CAPTION","unreadMessageCount","memberCount","isFrozen","myPushTriggerOption","marginRight"],"sources":["GroupChannelPreviewContainer.tsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { useChannelHandler } from '@sendbird/uikit-chat-hooks';\nimport {\n GroupChannelPreview,\n LoadingSpinner,\n createStyleSheet,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\nimport Icon from '@sendbird/uikit-react-native-foundation/src/ui/Icon';\nimport {\n SendbirdGroupChannel,\n SendbirdUser,\n getFileExtension,\n getFileType,\n isDifferentChannel,\n isMyMessage,\n useForceUpdate,\n useIIFE,\n useUniqId,\n} from '@sendbird/uikit-utils';\n\nimport { useLocalization, useSendbirdChat } from '../hooks/useContext';\nimport ChannelCover from './ChannelCover';\nimport SBUPressable from './SBUPressable';\n\nconst iconMapper = { audio: 'file-audio', image: 'photo', video: 'play', file: 'file-document' } as const;\n\ntype Props = {\n channel: SendbirdGroupChannel;\n onPress: () => void;\n onLongPress: () => void;\n};\nconst GroupChannelPreviewContainer = ({ onPress, onLongPress, channel }: Props) => {\n const { currentUser, sdk, features } = useSendbirdChat();\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n\n const [typingUsers, setTypingUsers] = useState<SendbirdUser[]>([]);\n const forceUpdate = useForceUpdate();\n\n if (features.channelListTypingIndicatorEnabled) {\n const typingId = useUniqId('GroupChannelPreviewContainer');\n useChannelHandler(sdk, `GroupChannelPreviewContainer_TypingIndicator_${typingId}`, {\n onTypingStatusUpdated(eventChannel) {\n if (isDifferentChannel(channel, eventChannel)) return;\n setTypingUsers(eventChannel.getTypingUsers());\n },\n });\n }\n\n if (features.channelListMessageReceiptStatusEnabled) {\n const receiptId = useUniqId('GroupChannelPreviewContainer');\n useChannelHandler(sdk, `GroupChannelPreviewContainer_ReceiptStatus_${receiptId}`, {\n onDeliveryReceiptUpdated(eventChannel) {\n if (isDifferentChannel(channel, eventChannel)) return;\n if (!eventChannel.isGroupChannel() || !eventChannel.lastMessage) return;\n if (!isMyMessage(eventChannel.lastMessage, currentUser?.userId)) return;\n\n forceUpdate();\n },\n onReadReceiptUpdated(eventChannel) {\n if (isDifferentChannel(channel, eventChannel)) return;\n if (!eventChannel.isGroupChannel() || !eventChannel.lastMessage) return;\n if (!isMyMessage(eventChannel.lastMessage, currentUser?.userId)) return;\n\n forceUpdate();\n },\n });\n }\n\n const bodyText = useIIFE(() => {\n if (typingUsers.length > 0) return STRINGS.LABELS.TYPING_INDICATOR_TYPINGS(typingUsers) || '';\n else return STRINGS.GROUP_CHANNEL_LIST.CHANNEL_PREVIEW_BODY(channel);\n });\n\n const bodyIcon = useIIFE(() => {\n if (!channel.lastMessage?.isFileMessage()) return undefined;\n return iconMapper[getFileType(channel.lastMessage.type || getFileExtension(channel.lastMessage.name))];\n });\n\n const titleCaptionIcon = useIIFE(() => {\n if (!channel.lastMessage) return undefined;\n if (!features.channelListMessageReceiptStatusEnabled) return undefined;\n if (!isMyMessage(channel.lastMessage, currentUser?.userId)) return undefined;\n\n if (channel.lastMessage.sendingStatus === 'pending') {\n return <LoadingSpinner size={16} style={styles.titleCaptionIcon} />;\n }\n\n if (channel.lastMessage.sendingStatus === 'failed') {\n return <Icon icon={'error'} size={16} color={colors.error} style={styles.titleCaptionIcon} />;\n }\n\n if (channel.getUnreadMemberCount(channel.lastMessage) === 0) {\n return <Icon icon={'done-all'} size={16} color={colors.secondary} style={styles.titleCaptionIcon} />;\n }\n\n if (features.deliveryReceiptEnabled) {\n if (channel.getUndeliveredMemberCount(channel.lastMessage) === 0) {\n return <Icon icon={'done-all'} size={16} color={colors.onBackground03} style={styles.titleCaptionIcon} />;\n }\n return <Icon icon={'done'} size={16} color={colors.onBackground03} containerStyle={styles.titleCaptionIcon} />;\n }\n\n return <Icon icon={'done-all'} size={16} color={colors.onBackground03} style={styles.titleCaptionIcon} />;\n });\n\n return (\n <SBUPressable onPress={onPress} onLongPress={onLongPress}>\n <GroupChannelPreview\n customCover={<ChannelCover channel={channel} size={56} />}\n coverUrl={channel.coverUrl}\n title={STRINGS.GROUP_CHANNEL_LIST.CHANNEL_PREVIEW_TITLE(currentUser?.userId ?? '', channel)}\n titleCaptionLeft={titleCaptionIcon}\n titleCaption={STRINGS.GROUP_CHANNEL_LIST.CHANNEL_PREVIEW_TITLE_CAPTION(channel)}\n body={bodyText}\n bodyIcon={bodyIcon}\n badgeCount={channel.unreadMessageCount}\n memberCount={channel.memberCount > 2 ? channel.memberCount : undefined}\n frozen={channel.isFrozen}\n notificationOff={channel.myPushTriggerOption === 'off'}\n />\n </SBUPressable>\n );\n};\n\nconst styles = createStyleSheet({\n titleCaptionIcon: {\n marginRight: 4,\n },\n});\n\nexport default GroupChannelPreviewContainer;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AAEA,SAASC,iBAAT,QAAkC,4BAAlC;AACA,SACEC,mBADF,EAEE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AR,GAAsB,CAAtB,GAA0B7C,OAAO,CAAC6C,WAAlC,GAAgDhB,SAT/D;IAUE,MAAM,EAAE7B,OAAO,CAAC8C,QAVlB;IAWE,eAAe,EAAE9C,OAAO,CAAC+C,mBAAR,KAAgC;EAXnD,EADF,CADF;AAiBD,CA5FD;;AA8FA,MAAMb,MAAM,GAAGxD,gBAAgB,CAAC;EAC9BsD,gBAAgB,EAAE;IAChBgB,WAAW,EAAE;EADG;AADY,CAAD,CAA/B;AAMA,eAAenD,4BAAf"}
@@ -1,33 +0,0 @@
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
- import React from 'react';
4
- import { Pressable, TouchableOpacity } from 'react-native';
5
- import { DEFAULT_LONG_PRESS_DELAY } from '../constants';
6
-
7
- function getComponent(as) {
8
- switch (as) {
9
- case 'Pressable':
10
- return Pressable;
11
-
12
- case 'TouchableOpacity':
13
- return TouchableOpacity;
14
-
15
- default:
16
- return Pressable;
17
- }
18
- }
19
-
20
- const SBUPressable = _ref => {
21
- let {
22
- as,
23
- ...props
24
- } = _ref;
25
- const Renderer = getComponent(as); // @ts-ignore
26
-
27
- return /*#__PURE__*/React.createElement(Renderer, _extends({
28
- delayLongPress: DEFAULT_LONG_PRESS_DELAY
29
- }, props));
30
- };
31
-
32
- export default SBUPressable;
33
- //# sourceMappingURL=SBUPressable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","Pressable","TouchableOpacity","DEFAULT_LONG_PRESS_DELAY","getComponent","as","SBUPressable","props","Renderer"],"sources":["SBUPressable.tsx"],"sourcesContent":["import React from 'react';\nimport { Pressable, PressableProps, TouchableOpacity, TouchableOpacityProps } from 'react-native';\n\nimport { DEFAULT_LONG_PRESS_DELAY } from '../constants';\n\ntype Components = 'Pressable' | 'TouchableOpacity';\ntype Props<T extends Components = 'Pressable'> = {\n as?: T;\n} & ExtractProps<T, AsProps>;\n\ntype AsProps =\n | {\n type: 'Pressable';\n props: PressableProps;\n }\n | {\n type: 'TouchableOpacity';\n props: TouchableOpacityProps;\n };\n\ntype ExtractProps<T extends Components, U extends AsProps> = U extends { type: T; props: infer P } ? P : never;\n\nfunction getComponent(as?: Components) {\n switch (as) {\n case 'Pressable':\n return Pressable;\n case 'TouchableOpacity':\n return TouchableOpacity;\n default:\n return Pressable;\n }\n}\n\nconst SBUPressable = <T extends Components>({ as, ...props }: Props<T>) => {\n const Renderer = getComponent(as);\n // @ts-ignore\n return <Renderer delayLongPress={DEFAULT_LONG_PRESS_DELAY} {...props} />;\n};\n\nexport default SBUPressable;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,SAAT,EAAoCC,gBAApC,QAAmF,cAAnF;AAEA,SAASC,wBAAT,QAAyC,cAAzC;;AAmBA,SAASC,YAAT,CAAsBC,EAAtB,EAAuC;EACrC,QAAQA,EAAR;IACE,KAAK,WAAL;MACE,OAAOJ,SAAP;;IACF,KAAK,kBAAL;MACE,OAAOC,gBAAP;;IACF;MACE,OAAOD,SAAP;EANJ;AAQD;;AAED,MAAMK,YAAY,GAAG,QAAsD;EAAA,IAA/B;IAAED,EAAF;IAAM,GAAGE;EAAT,CAA+B;EACzE,MAAMC,QAAQ,GAAGJ,YAAY,CAACC,EAAD,CAA7B,CADyE,CAEzE;;EACA,oBAAO,oBAAC,QAAD;IAAU,cAAc,EAAEF;EAA1B,GAAwDI,KAAxD,EAAP;AACD,CAJD;;AAMA,eAAeD,YAAf"}
@@ -1,18 +0,0 @@
1
- import { PressableProps, TouchableOpacityProps } from 'react-native';
2
- declare type Components = 'Pressable' | 'TouchableOpacity';
3
- declare type Props<T extends Components = 'Pressable'> = {
4
- as?: T;
5
- } & ExtractProps<T, AsProps>;
6
- declare type AsProps = {
7
- type: 'Pressable';
8
- props: PressableProps;
9
- } | {
10
- type: 'TouchableOpacity';
11
- props: TouchableOpacityProps;
12
- };
13
- declare type ExtractProps<T extends Components, U extends AsProps> = U extends {
14
- type: T;
15
- props: infer P;
16
- } ? P : never;
17
- declare const SBUPressable: <T extends Components>({ as, ...props }: Props<T>) => JSX.Element;
18
- export default SBUPressable;
@@ -1,40 +0,0 @@
1
- import React from 'react';
2
- import { Pressable, PressableProps, TouchableOpacity, TouchableOpacityProps } from 'react-native';
3
-
4
- import { DEFAULT_LONG_PRESS_DELAY } from '../constants';
5
-
6
- type Components = 'Pressable' | 'TouchableOpacity';
7
- type Props<T extends Components = 'Pressable'> = {
8
- as?: T;
9
- } & ExtractProps<T, AsProps>;
10
-
11
- type AsProps =
12
- | {
13
- type: 'Pressable';
14
- props: PressableProps;
15
- }
16
- | {
17
- type: 'TouchableOpacity';
18
- props: TouchableOpacityProps;
19
- };
20
-
21
- type ExtractProps<T extends Components, U extends AsProps> = U extends { type: T; props: infer P } ? P : never;
22
-
23
- function getComponent(as?: Components) {
24
- switch (as) {
25
- case 'Pressable':
26
- return Pressable;
27
- case 'TouchableOpacity':
28
- return TouchableOpacity;
29
- default:
30
- return Pressable;
31
- }
32
- }
33
-
34
- const SBUPressable = <T extends Components>({ as, ...props }: Props<T>) => {
35
- const Renderer = getComponent(as);
36
- // @ts-ignore
37
- return <Renderer delayLongPress={DEFAULT_LONG_PRESS_DELAY} {...props} />;
38
- };
39
-
40
- export default SBUPressable;