From f3a94e2178dc5b005679535c3d0b9d1225e22b2d Mon Sep 17 00:00:00 2001 From: bang9 Date: Fri, 7 Oct 2022 16:06:02 +0900 Subject: [PATCH] docs: update features --- docs-validation/2_features/DeliveryReceipt.tsx | 4 +++- docs-validation/2_features/FileSharing.tsx | 13 +++++++++---- docs-validation/2_features/ReadReceipt.tsx | 3 ++- docs-validation/2_features/TypingIndicator.tsx | 5 +++-- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/docs-validation/2_features/DeliveryReceipt.tsx b/docs-validation/2_features/DeliveryReceipt.tsx index 73cf8450d..ec29258d3 100644 --- a/docs-validation/2_features/DeliveryReceipt.tsx +++ b/docs-validation/2_features/DeliveryReceipt.tsx @@ -2,8 +2,10 @@ * How to use * {@link https://sendbird.com/docs/uikit/v3/react-native/features/delivery-receipt#2-how-to-use} * */ -// TODO: import SendbirdUIKitContainer +import { SendbirdUIKitContainer } from "@sendbird/uikit-react-native"; + const App = () => { + // @ts-ignore return ; }; /** ------------------ **/ diff --git a/docs-validation/2_features/FileSharing.tsx b/docs-validation/2_features/FileSharing.tsx index efa2e1c08..350e2bc28 100644 --- a/docs-validation/2_features/FileSharing.tsx +++ b/docs-validation/2_features/FileSharing.tsx @@ -1,18 +1,20 @@ import React from 'react'; -import { MessageRenderer, StringSet, createGroupChannelFragment } from '@sendbird/uikit-react-native'; +import type { StringSet } from '@sendbird/uikit-react-native'; import { Icon } from '@sendbird/uikit-react-native-foundation'; import type { UIKitColors } from '@sendbird/uikit-react-native-foundation'; -const ImageResizer = { createResizedImage: async (_: string) => ({ uri: '', size: 0 }) }; const CustomFileMessage = (_: object) => ; -const getFileExtension = (x: string) => x; +const isImageFile = (x: string) => x; /** * Customize the UI for file sharing * {@link https://sendbird.com/docs/uikit/v3/react-native/features/file-sharing#2-customize-the-ui-for-file-sharing} * */ +import { createGroupChannelFragment, MessageRenderer } from '@sendbird/uikit-react-native'; + const GroupChannelFragment = createGroupChannelFragment(); + const GroupChannelScreen = () => { return ( // @ts-ignore @@ -82,13 +84,16 @@ function _stringResource(str: StringSet) { * Image compression * {@link https://sendbird.com/docs/uikit/v3/react-native/features/file-sharing#2-image-compression} * */ +// @ts-ignore +import ImageResizer from 'react-native-image-resizer'; + const GroupChannelScreen2 = () => { return ( // @ts-ignore { if (params.file && 'uri' in params.file) { - if (getFileExtension(params.file.name).match(/jpeg|png/i)) { + if (isImageFile(params.file.name)) { const { uri, size } = await ImageResizer.createResizedImage(params.file.uri); params.file = { ...params.file, uri, size }; } diff --git a/docs-validation/2_features/ReadReceipt.tsx b/docs-validation/2_features/ReadReceipt.tsx index d930aa278..6d15f4ea3 100644 --- a/docs-validation/2_features/ReadReceipt.tsx +++ b/docs-validation/2_features/ReadReceipt.tsx @@ -2,8 +2,9 @@ * How to use * {@link https://sendbird.com/docs/uikit/v3/react-native/features/read-receipt#2-how-to-use} * */ -// TODO: import SendbirdUIKitContainer +import { SendbirdUIKitContainer } from '@sendbird/uikit-react-native'; const App = () => { + // @ts-ignore return ; }; /** ------------------ **/ diff --git a/docs-validation/2_features/TypingIndicator.tsx b/docs-validation/2_features/TypingIndicator.tsx index 7539b2bae..0af3b0439 100644 --- a/docs-validation/2_features/TypingIndicator.tsx +++ b/docs-validation/2_features/TypingIndicator.tsx @@ -4,8 +4,9 @@ import type { StringSet } from '@sendbird/uikit-react-native'; * How to use * {@link https://sendbird.com/docs/uikit/v3/react-native/features/typing-indicator#2-how-to-use} * */ -// TODO: import SendbirdUIKitContainer +import { SendbirdUIKitContainer } from '@sendbird/uikit-react-native'; const App = () => { + // @ts-ignore return ; }; /** ------------------ **/ @@ -14,5 +15,5 @@ const App = () => { * String resource * {@link https://sendbird.com/docs/uikit/v3/react-native/features/typing-indicator#2-customize-the-ui-for-typing-indicator-3-string-resource} * */ -type _TypingIndicatorTypings = StringSet['LABELS']['TYPING_INDICATOR_TYPINGS']; +type TypingIndicatorTypings = StringSet['LABELS']['TYPING_INDICATOR_TYPINGS']; /** ------------------ **/