Skip to content

Commit

Permalink
docs: update features
Browse files Browse the repository at this point in the history
  • Loading branch information
bang9 committed Oct 7, 2022
1 parent 3173e38 commit f3a94e2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
4 changes: 3 additions & 1 deletion docs-validation/2_features/DeliveryReceipt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SendbirdUIKitContainer chatOptions={{ enableChannelListMessageReceiptStatus: true }} />;
};
/** ------------------ **/
Expand Down
13 changes: 9 additions & 4 deletions docs-validation/2_features/FileSharing.tsx
Original file line number Diff line number Diff line change
@@ -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) => <React.Fragment />;
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
Expand Down Expand Up @@ -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
<GroupChannelFragment
onBeforeSendFileMessage={async (params) => {
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 };
}
Expand Down
3 changes: 2 additions & 1 deletion docs-validation/2_features/ReadReceipt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SendbirdUIKitContainer chatOptions={{ enableChannelListMessageReceiptStatus: true }} />;
};
/** ------------------ **/
Expand Down
5 changes: 3 additions & 2 deletions docs-validation/2_features/TypingIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SendbirdUIKitContainer chatOptions={{ enableChannelListTypingIndicator: true }} />;
};
/** ------------------ **/
Expand All @@ -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'];
/** ------------------ **/

0 comments on commit f3a94e2

Please sign in to comment.