diff --git a/packages/uikit-react-native-core/src/domain/groupChannelInfo/index.ts b/packages/uikit-react-native-core/src/domain/groupChannelInfo/index.ts deleted file mode 100644 index a8e6c41c6..000000000 --- a/packages/uikit-react-native-core/src/domain/groupChannelInfo/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { default as GroupChannelInfoView } from './component/GroupChannelInfoView'; -export { default as createGroupChannelInfoModule } from './module/createGroupChannelInfoModule'; -export { GroupChannelInfoContextProvider, GroupChannelInfoContext } from './module/moduleContext'; diff --git a/packages/uikit-react-native-core/src/domain/groupChannelInfo/module/createGroupChannelInfoModule.tsx b/packages/uikit-react-native-core/src/domain/groupChannelInfo/module/createGroupChannelInfoModule.tsx deleted file mode 100644 index 12eda6a59..000000000 --- a/packages/uikit-react-native-core/src/domain/groupChannelInfo/module/createGroupChannelInfoModule.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import GroupChannelInfoHeader from '../component/GroupChannelInfoHeader'; -import GroupChannelInfoView from '../component/GroupChannelInfoView'; -import type { GroupChannelInfoModule } from '../types'; -import { GroupChannelInfoContextProvider } from './moduleContext'; - -const createGroupChannelInfoModule = ({ - Header = GroupChannelInfoHeader, - View = GroupChannelInfoView, - Provider = GroupChannelInfoContextProvider, - ...module -}: Partial = {}): GroupChannelInfoModule => { - return { Header, View, Provider, ...module }; -}; - -export default createGroupChannelInfoModule; diff --git a/packages/uikit-react-native-core/src/domain/groupChannelInfo/types.ts b/packages/uikit-react-native-core/src/domain/groupChannelInfo/types.ts deleted file mode 100644 index 87a41a5bb..000000000 --- a/packages/uikit-react-native-core/src/domain/groupChannelInfo/types.ts +++ /dev/null @@ -1,48 +0,0 @@ -import type React from 'react'; -import type Sendbird from 'sendbird'; - -import type { BaseHeaderProps } from '@sendbird/uikit-react-native-foundation'; - -import type { CommonComponent } from '../../types'; - -export type GroupChannelInfoProps = { - Fragment: { - staleChannel: GroupChannelInfoProps['Provider']['staleChannel']; - Header?: GroupChannelInfoProps['Header']['Header']; - onPressHeaderLeft: GroupChannelInfoProps['Header']['onPressHeaderLeft']; - onPressMenuMembers: GroupChannelInfoProps['View']['onPressMenuMembers']; - onLeaveChannel: GroupChannelInfoProps['View']['onLeaveChannel']; - }; - Header: { - Header?: null | CommonComponent void }>>; - onPressHeaderLeft: () => void; - }; - View: { - onPressMenuMembers: () => void; - onLeaveChannel: () => void; - }; - Provider: { - staleChannel: Sendbird.GroupChannel; - }; -}; - -/** - * Internal context for GroupChannelInfo - * For example, the developer can create a custom header - * with getting data from the domain context - * */ -export type GroupChannelInfoContextType = { - Fragment: React.Context<{ - channel: Sendbird.GroupChannel; - headerTitle: string; - headerRight: string; - onPressHeaderRight: () => void; - }>; -}; -export interface GroupChannelInfoModule { - Provider: React.FC; - Header: CommonComponent; - View: CommonComponent; -} - -export type GroupChannelInfoFragment = React.FC; diff --git a/packages/uikit-react-native-core/src/domain/groupChannelInfo/component/GroupChannelInfoHeader.tsx b/packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsHeader.tsx similarity index 67% rename from packages/uikit-react-native-core/src/domain/groupChannelInfo/component/GroupChannelInfoHeader.tsx rename to packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsHeader.tsx index 6668233ef..469b4905c 100644 --- a/packages/uikit-react-native-core/src/domain/groupChannelInfo/component/GroupChannelInfoHeader.tsx +++ b/packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsHeader.tsx @@ -2,15 +2,15 @@ import React, { useContext } from 'react'; import { Header as DefaultHeader, Icon, Text, useUIKitTheme } from '@sendbird/uikit-react-native-foundation'; -import { GroupChannelInfoContext } from '../module/moduleContext'; -import type { GroupChannelInfoProps } from '../types'; +import { GroupChannelSettingsContext } from '../module/moduleContext'; +import type { GroupChannelSettingsProps } from '../types'; -const GroupChannelInfoHeader: React.FC = ({ +const GroupChannelSettingsHeader: React.FC = ({ Header = DefaultHeader, onPressHeaderLeft, }) => { const { colors } = useUIKitTheme(); - const { headerTitle, headerRight, onPressHeaderRight } = useContext(GroupChannelInfoContext.Fragment); + const { headerTitle, headerRight, onPressHeaderRight } = useContext(GroupChannelSettingsContext.Fragment); if (!Header) return null; return (
= ({ ); }; -export default GroupChannelInfoHeader; +export default GroupChannelSettingsHeader; diff --git a/packages/uikit-react-native-core/src/domain/groupChannelInfo/component/GroupChannelInfoView.tsx b/packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsView.tsx similarity index 84% rename from packages/uikit-react-native-core/src/domain/groupChannelInfo/component/GroupChannelInfoView.tsx rename to packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsView.tsx index f132ed7f0..d55dd58d2 100644 --- a/packages/uikit-react-native-core/src/domain/groupChannelInfo/component/GroupChannelInfoView.tsx +++ b/packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsView.tsx @@ -23,11 +23,14 @@ import { import { useLocalization } from '../../../contexts/Localization'; import { useSendbirdChat } from '../../../contexts/SendbirdChat'; -import { GroupChannelInfoContext } from '../module/moduleContext'; -import type { GroupChannelInfoProps } from '../types'; +import { GroupChannelSettingsContext } from '../module/moduleContext'; +import type { GroupChannelSettingsProps } from '../types'; -const GroupChannelInfoView: React.FC = ({ onPressMenuMembers, onLeaveChannel }) => { - const { channel } = useContext(GroupChannelInfoContext.Fragment); +const GroupChannelSettingsView: React.FC = ({ + onPressMenuMembers, + onLeaveChannel, +}) => { + const { channel } = useContext(GroupChannelSettingsContext.Fragment); const { currentUser } = useSendbirdChat(); const { LABEL } = useLocalization(); const { colors } = useUIKitTheme(); @@ -44,13 +47,13 @@ const GroupChannelInfoView: React.FC = ({ onPress const menuItems: MenuBarProps[] = [ { icon: 'notifications', - name: LABEL.GROUP_CHANNEL_INFO.MENU_NOTIFICATION, + name: LABEL.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION, onPress: toggleNotification, actionItem: , }, { icon: 'members', - name: LABEL.GROUP_CHANNEL_INFO.MENU_MEMBERS, + name: LABEL.GROUP_CHANNEL_SETTINGS.MENU_MEMBERS, onPress: () => onPressMenuMembers(), actionLabel: String(channel.memberCount), actionItem: , @@ -58,7 +61,7 @@ const GroupChannelInfoView: React.FC = ({ onPress { icon: 'leave', iconColor: colors.error, - name: LABEL.GROUP_CHANNEL_INFO.MENU_LEAVE_CHANNEL, + name: LABEL.GROUP_CHANNEL_SETTINGS.MENU_LEAVE_CHANNEL, onPress: () => { onLeaveChannel(); channel.leave(); @@ -67,7 +70,7 @@ const GroupChannelInfoView: React.FC = ({ onPress ]; if (!currentUser) { - Logger.warn('Cannot render GroupChannelInfoFragment, User is not connected'); + Logger.warn('Cannot render GroupChannelSettingsFragment, User is not connected'); return null; } @@ -124,4 +127,4 @@ const styles = createStyleSheet({ userIdContainer: { paddingVertical: 16 }, userIdLabel: { marginBottom: 4 }, }); -export default GroupChannelInfoView; +export default GroupChannelSettingsView; diff --git a/packages/uikit-react-native-core/src/domain/groupChannelSettings/index.ts b/packages/uikit-react-native-core/src/domain/groupChannelSettings/index.ts new file mode 100644 index 000000000..6328d03d1 --- /dev/null +++ b/packages/uikit-react-native-core/src/domain/groupChannelSettings/index.ts @@ -0,0 +1,4 @@ +export { default as GroupChannelSettingsHeader } from './component/GroupChannelSettingsHeader'; +export { default as GroupChannelSettingsView } from './component/GroupChannelSettingsView'; +export { default as createGroupChannelSettingsModule } from './module/createGroupChannelSettingsModule'; +export { GroupChannelSettingsContextProvider, GroupChannelSettingsContext } from './module/moduleContext'; diff --git a/packages/uikit-react-native-core/src/domain/groupChannelSettings/module/createGroupChannelSettingsModule.tsx b/packages/uikit-react-native-core/src/domain/groupChannelSettings/module/createGroupChannelSettingsModule.tsx new file mode 100644 index 000000000..1962fba0e --- /dev/null +++ b/packages/uikit-react-native-core/src/domain/groupChannelSettings/module/createGroupChannelSettingsModule.tsx @@ -0,0 +1,15 @@ +import GroupChannelSettingsHeader from '../component/GroupChannelSettingsHeader'; +import GroupChannelSettingsView from '../component/GroupChannelSettingsView'; +import type { GroupChannelSettingsModule } from '../types'; +import { GroupChannelSettingsContextProvider } from './moduleContext'; + +const createGroupChannelSettingsModule = ({ + Header = GroupChannelSettingsHeader, + View = GroupChannelSettingsView, + Provider = GroupChannelSettingsContextProvider, + ...module +}: Partial = {}): GroupChannelSettingsModule => { + return { Header, View, Provider, ...module }; +}; + +export default createGroupChannelSettingsModule; diff --git a/packages/uikit-react-native-core/src/domain/groupChannelInfo/module/moduleContext.tsx b/packages/uikit-react-native-core/src/domain/groupChannelSettings/module/moduleContext.tsx similarity index 73% rename from packages/uikit-react-native-core/src/domain/groupChannelInfo/module/moduleContext.tsx rename to packages/uikit-react-native-core/src/domain/groupChannelSettings/module/moduleContext.tsx index 358630265..264b12ef0 100644 --- a/packages/uikit-react-native-core/src/domain/groupChannelInfo/module/moduleContext.tsx +++ b/packages/uikit-react-native-core/src/domain/groupChannelSettings/module/moduleContext.tsx @@ -9,9 +9,9 @@ import ProviderLayout from '../../../components/ProviderLayout'; import { useLocalization } from '../../../contexts/Localization'; import { usePlatformService } from '../../../contexts/PlatformService'; import { useSendbirdChat } from '../../../contexts/SendbirdChat'; -import type { GroupChannelInfoContextType, GroupChannelInfoProps } from '../types'; +import type { GroupChannelSettingsContextType, GroupChannelSettingsProps } from '../types'; -export const GroupChannelInfoContext: GroupChannelInfoContextType = { +export const GroupChannelSettingsContext: GroupChannelSettingsContextType = { Fragment: createContext({ channel: {} as Sendbird.GroupChannel, headerTitle: '', @@ -20,8 +20,8 @@ export const GroupChannelInfoContext: GroupChannelInfoContextType = { }), }; -const HOOK_NAME = 'GroupChannelInfoContextProvider'; -export const GroupChannelInfoContextProvider: React.FC = ({ +const HOOK_NAME = 'GroupChannelSettingsContextProvider'; +export const GroupChannelSettingsContextProvider: React.FC = ({ children, staleChannel, }) => { @@ -68,9 +68,9 @@ export const GroupChannelInfoContextProvider: React.FC { prompt({ - title: LABEL.GROUP_CHANNEL_INFO.DIALOG_CHANGE_NAME_PROMPT_TITLE, - submitLabel: LABEL.GROUP_CHANNEL_INFO.DIALOG_CHANGE_NAME_PROMPT_OK, - placeholder: LABEL.GROUP_CHANNEL_INFO.DIALOG_CHANGE_NAME_PROMPT_PLACEHOLDER, + title: LABEL.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_TITLE, + submitLabel: LABEL.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_OK, + placeholder: LABEL.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_PLACEHOLDER, defaultValue: activeChannel.name, onSubmit: async (channelName) => { const params = new sdk.GroupChannelParams(); @@ -82,10 +82,10 @@ export const GroupChannelInfoContextProvider: React.FC { openMenu({ - title: LABEL.GROUP_CHANNEL_INFO.DIALOG_CHANGE_IMAGE_MENU_TITLE, + title: LABEL.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE_MENU_TITLE, menuItems: [ { - title: LABEL.GROUP_CHANNEL_INFO.DIALOG_CHANGE_IMAGE_MENU_CAMERA, + title: LABEL.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE_MENU_CAMERA, onPress: async () => { const file = await fileService.openCamera(); if (!file) return; @@ -96,7 +96,7 @@ export const GroupChannelInfoContextProvider: React.FC { const files = await fileService.openMediaLibrary({ selectionLimit: 1 }); if (!files || !files[0]) return; @@ -113,24 +113,24 @@ export const GroupChannelInfoContextProvider: React.FC { openSheet({ sheetItems: [ - { title: LABEL.GROUP_CHANNEL_INFO.DIALOG_CHANGE_NAME, onPress: changeChannelName }, - { title: LABEL.GROUP_CHANNEL_INFO.DIALOG_CHANGE_IMAGE, onPress: changeChannelImage }, + { title: LABEL.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME, onPress: changeChannelName }, + { title: LABEL.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE, onPress: changeChannelImage }, ], }); }, [LABEL, changeChannelImage, changeChannelName]); return ( - {children} - + ); }; diff --git a/packages/uikit-react-native-core/src/domain/groupChannelSettings/types.ts b/packages/uikit-react-native-core/src/domain/groupChannelSettings/types.ts new file mode 100644 index 000000000..574d50dc7 --- /dev/null +++ b/packages/uikit-react-native-core/src/domain/groupChannelSettings/types.ts @@ -0,0 +1,48 @@ +import type React from 'react'; +import type Sendbird from 'sendbird'; + +import type { BaseHeaderProps } from '@sendbird/uikit-react-native-foundation'; + +import type { CommonComponent } from '../../types'; + +export type GroupChannelSettingsProps = { + Fragment: { + staleChannel: GroupChannelSettingsProps['Provider']['staleChannel']; + Header?: GroupChannelSettingsProps['Header']['Header']; + onPressHeaderLeft: GroupChannelSettingsProps['Header']['onPressHeaderLeft']; + onPressMenuMembers: GroupChannelSettingsProps['View']['onPressMenuMembers']; + onLeaveChannel: GroupChannelSettingsProps['View']['onLeaveChannel']; + }; + Header: { + Header?: null | CommonComponent void }>>; + onPressHeaderLeft: () => void; + }; + View: { + onPressMenuMembers: () => void; + onLeaveChannel: () => void; + }; + Provider: { + staleChannel: Sendbird.GroupChannel; + }; +}; + +/** + * Internal context for GroupChannelSettings + * For example, the developer can create a custom header + * with getting data from the domain context + * */ +export type GroupChannelSettingsContextType = { + Fragment: React.Context<{ + channel: Sendbird.GroupChannel; + headerTitle: string; + headerRight: string; + onPressHeaderRight: () => void; + }>; +}; +export interface GroupChannelSettingsModule { + Provider: React.FC; + Header: CommonComponent; + View: CommonComponent; +} + +export type GroupChannelSettingsFragment = React.FC; diff --git a/packages/uikit-react-native-core/src/index.tsx b/packages/uikit-react-native-core/src/index.tsx index ef74e6621..f69f19dff 100644 --- a/packages/uikit-react-native-core/src/index.tsx +++ b/packages/uikit-react-native-core/src/index.tsx @@ -33,7 +33,7 @@ export type { /** Domain **/ export * from './domain/groupChannel'; -export * from './domain/groupChannelInfo'; +export * from './domain/groupChannelSettings'; export * from './domain/groupChannelList'; export * from './domain/userList'; export type { @@ -43,11 +43,11 @@ export type { GroupChannelContextType, } from './domain/groupChannel/types'; export type { - GroupChannelInfoProps, - GroupChannelInfoModule, - GroupChannelInfoFragment, - GroupChannelInfoContextType, -} from './domain/groupChannelInfo/types'; + GroupChannelSettingsProps, + GroupChannelSettingsModule, + GroupChannelSettingsFragment, + GroupChannelSettingsContextType, +} from './domain/groupChannelSettings/types'; export type { GroupChannelType, GroupChannelListProps, diff --git a/packages/uikit-react-native-core/src/localization/label.type.ts b/packages/uikit-react-native-core/src/localization/label.type.ts index 80779e40a..5d1b70272 100644 --- a/packages/uikit-react-native-core/src/localization/label.type.ts +++ b/packages/uikit-react-native-core/src/localization/label.type.ts @@ -60,17 +60,17 @@ export interface LabelSet { DIALOG_ATTACHMENT_PHOTO_LIBRARY: string; DIALOG_ATTACHMENT_FILES: string; }; - GROUP_CHANNEL_INFO: { - /** GroupChannelInfo > Header */ + GROUP_CHANNEL_SETTINGS: { + /** GroupChannelSettings > Header */ HEADER_TITLE: string; HEADER_RIGHT: string; - /** GroupChannelInfo > Menu */ + /** GroupChannelSettings > Menu */ MENU_NOTIFICATION: string; MENU_MEMBERS: string; MENU_LEAVE_CHANNEL: string; - /** GroupChannelInfo > Dialog */ + /** GroupChannelSettings > Dialog */ DIALOG_CHANGE_NAME: string; DIALOG_CHANGE_IMAGE: string; DIALOG_CHANGE_NAME_PROMPT_TITLE: string; @@ -209,7 +209,7 @@ export const createBaseLabel = ({ dateLocale, overrides }: LabelCreateOptions): DIALOG_ATTACHMENT_FILES: 'Files', ...overrides?.GROUP_CHANNEL, }, - GROUP_CHANNEL_INFO: { + GROUP_CHANNEL_SETTINGS: { HEADER_TITLE: 'Channel information', HEADER_RIGHT: 'Edit', MENU_NOTIFICATION: 'Notification', @@ -224,7 +224,7 @@ export const createBaseLabel = ({ dateLocale, overrides }: LabelCreateOptions): DIALOG_CHANGE_IMAGE_MENU_TITLE: 'Change channel image', DIALOG_CHANGE_IMAGE_MENU_CAMERA: 'Take photo', DIALOG_CHANGE_IMAGE_MENU_PHOTO_LIBRARY: 'Choose photo', - ...overrides?.GROUP_CHANNEL_INFO, + ...overrides?.GROUP_CHANNEL_SETTINGS, }, GROUP_CHANNEL_LIST: { HEADER_TITLE: 'Channels', diff --git a/packages/uikit-react-native/src/fragments/createGroupChannelInfoFragment.tsx b/packages/uikit-react-native/src/fragments/createGroupChannelInfoFragment.tsx deleted file mode 100644 index a374a8844..000000000 --- a/packages/uikit-react-native/src/fragments/createGroupChannelInfoFragment.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; - -import type { GroupChannelInfoFragment, GroupChannelInfoModule } from '@sendbird/uikit-react-native-core'; -import { createGroupChannelInfoModule } from '@sendbird/uikit-react-native-core'; -import { NOOP } from '@sendbird/uikit-utils'; - -const createGroupChannelInfoFragment = (initModule?: Partial): GroupChannelInfoFragment => { - const GroupChannelInfoModule = createGroupChannelInfoModule(initModule); - - return ({ Header, onPressHeaderLeft = NOOP, staleChannel, onPressMenuMembers, onLeaveChannel, children }) => { - return ( - - - - {children} - - ); - }; -}; - -export default createGroupChannelInfoFragment; diff --git a/packages/uikit-react-native/src/fragments/createGroupChannelSettingsFragment.tsx b/packages/uikit-react-native/src/fragments/createGroupChannelSettingsFragment.tsx new file mode 100644 index 000000000..e88ffffc9 --- /dev/null +++ b/packages/uikit-react-native/src/fragments/createGroupChannelSettingsFragment.tsx @@ -0,0 +1,23 @@ +import React from 'react'; + +import type { GroupChannelSettingsFragment, GroupChannelSettingsModule } from '@sendbird/uikit-react-native-core'; +import { createGroupChannelSettingsModule } from '@sendbird/uikit-react-native-core'; +import { NOOP } from '@sendbird/uikit-utils'; + +const createGroupChannelSettingsFragment = ( + initModule?: Partial, +): GroupChannelSettingsFragment => { + const GroupChannelSettingsModule = createGroupChannelSettingsModule(initModule); + + return ({ Header, onPressHeaderLeft = NOOP, staleChannel, onPressMenuMembers, onLeaveChannel, children }) => { + return ( + + + + {children} + + ); + }; +}; + +export default createGroupChannelSettingsFragment; diff --git a/packages/uikit-react-native/src/index.tsx b/packages/uikit-react-native/src/index.tsx index e29207fe9..e01dbf87f 100644 --- a/packages/uikit-react-native/src/index.tsx +++ b/packages/uikit-react-native/src/index.tsx @@ -10,7 +10,7 @@ export { default as UserSelectableBar } from './ui/UserSelectableBar'; /** Fragments **/ export { default as createGroupChannelCreateFragment } from './fragments/createGroupChannelCreateFragment'; export { default as createGroupChannelFragment } from './fragments/createGroupChannelFragment'; -export { default as createGroupChannelInfoFragment } from './fragments/createGroupChannelInfoFragment'; +export { default as createGroupChannelSettingsFragment } from './fragments/createGroupChannelSettingsFragment'; export { default as createGroupChannelInviteFragment } from './fragments/createGroupChannelInviteFragment'; export { default as createGroupChannelListFragment } from './fragments/createGroupChannelListFragment'; export { default as createGroupChannelMembersFragment } from './fragments/createGroupChannelMembersFragment'; diff --git a/sample/src/App.tsx b/sample/src/App.tsx index b27884529..f02df08f9 100644 --- a/sample/src/App.tsx +++ b/sample/src/App.tsx @@ -22,10 +22,10 @@ import { onForegroundAndroid, onForegroundIOS } from './libs/notification'; import { ErrorInfoScreen, GroupChannelCreateScreen, - GroupChannelInfoScreen, GroupChannelInviteScreen, GroupChannelMembersScreen, GroupChannelScreen, + GroupChannelSettingsScreen, GroupChannelTabs, HomeScreen, PaletteScreen, @@ -79,7 +79,7 @@ const Navigations = () => { - + diff --git a/sample/src/libs/navigation.ts b/sample/src/libs/navigation.ts index 74813631a..4be1759ea 100644 --- a/sample/src/libs/navigation.ts +++ b/sample/src/libs/navigation.ts @@ -18,7 +18,7 @@ export enum Routes { GroupChannelTabs = 'GroupChannelTabs', GroupChannelList = 'GroupChannelList', GroupChannel = 'GroupChannel', - GroupChannelInfo = 'GroupChannelInfo', + GroupChannelSettings = 'GroupChannelSettings', GroupChannelCreate = 'GroupChannelCreate', GroupChannelInvite = 'GroupChannelInvite', GroupChannelMembers = 'GroupChannelMembers', @@ -59,7 +59,7 @@ export type RouteParamsUnion = params: { serializedChannel: object }; } | { - route: Routes.GroupChannelInfo; + route: Routes.GroupChannelSettings; params: { serializedChannel: object }; } | { diff --git a/sample/src/screens/uikit-app/GroupChannelScreen.tsx b/sample/src/screens/uikit-app/GroupChannelScreen.tsx index 06a8c7faa..069f3ed02 100644 --- a/sample/src/screens/uikit-app/GroupChannelScreen.tsx +++ b/sample/src/screens/uikit-app/GroupChannelScreen.tsx @@ -93,7 +93,7 @@ const GroupChannelScreen: React.FC = () => { }} onPressHeaderRight={() => { // Navigate to group channel information - navigation.navigate(Routes.GroupChannelInfo, { serializedChannel: params.serializedChannel }); + navigation.navigate(Routes.GroupChannelSettings, { serializedChannel: params.serializedChannel }); }} /> ); diff --git a/sample/src/screens/uikit-app/GroupChannelInfoScreen.tsx b/sample/src/screens/uikit-app/GroupChannelSettingsScreen.tsx similarity index 74% rename from sample/src/screens/uikit-app/GroupChannelInfoScreen.tsx rename to sample/src/screens/uikit-app/GroupChannelSettingsScreen.tsx index c610f979e..cf1da5c8c 100644 --- a/sample/src/screens/uikit-app/GroupChannelInfoScreen.tsx +++ b/sample/src/screens/uikit-app/GroupChannelSettingsScreen.tsx @@ -1,19 +1,19 @@ import React, { useState } from 'react'; -import { createGroupChannelInfoFragment } from '@sendbird/uikit-react-native'; +import { createGroupChannelSettingsFragment } from '@sendbird/uikit-react-native'; import { useSendbirdChat } from '@sendbird/uikit-react-native-core'; import { useAppNavigation } from '../../hooks/useAppNavigation'; import { Routes } from '../../libs/navigation'; -const GroupChannelInfoFragment = createGroupChannelInfoFragment(); -const GroupChannelInfoScreen: React.FC = () => { +const GroupChannelSettingsFragment = createGroupChannelSettingsFragment(); +const GroupChannelSettingsScreen: React.FC = () => { const { sdk } = useSendbirdChat(); - const { navigation, params } = useAppNavigation(); + const { navigation, params } = useAppNavigation(); const [channel] = useState(() => sdk.GroupChannel.buildFromSerializedData(params.serializedChannel)); return ( - { // Navigate back @@ -31,4 +31,4 @@ const GroupChannelInfoScreen: React.FC = () => { ); }; -export default GroupChannelInfoScreen; +export default GroupChannelSettingsScreen; diff --git a/sample/src/screens/uikit-app/index.ts b/sample/src/screens/uikit-app/index.ts index ca1983bf0..c3d435727 100644 --- a/sample/src/screens/uikit-app/index.ts +++ b/sample/src/screens/uikit-app/index.ts @@ -1,6 +1,6 @@ export { default as GroupChannelTabs } from './GroupChannelTabs'; export { default as GroupChannelScreen } from './GroupChannelScreen'; -export { default as GroupChannelInfoScreen } from './GroupChannelInfoScreen'; +export { default as GroupChannelSettingsScreen } from './GroupChannelSettingsScreen'; export { default as GroupChannelCreateScreen } from './GroupChannelCreateScreen'; export { default as GroupChannelInviteScreen } from './GroupChannelInviteScreen'; export { default as GroupChannelMembersScreen } from './GroupChannelMembersScreen';