From a4c94e380f64919f929c9a494e9fcfb6ba1263cf Mon Sep 17 00:00:00 2001 From: bang9 Date: Mon, 27 Jun 2022 18:50:01 +0900 Subject: [PATCH] fix: apply strings review --- .../__template__/module/moduleContext.tsx | 2 +- .../src/contexts/Localization.tsx | 20 ++++---- .../component/GroupChannelHeader.tsx | 4 +- .../component/GroupChannelInput/EditInput.tsx | 10 ++-- .../component/GroupChannelInput/SendInput.tsx | 24 ++++----- .../component/GroupChannelMessageList.tsx | 39 ++++++++------- .../groupChannel/module/moduleContext.tsx | 4 +- .../component/GroupChannelListChannelMenu.tsx | 8 +-- .../GroupChannelListTypeSelector.tsx | 4 +- .../groupChannelList/module/moduleContext.tsx | 6 +-- .../component/GroupChannelSettingsInfo.tsx | 4 +- .../component/GroupChannelSettingsMenu.tsx | 8 +-- .../module/moduleContext.tsx | 28 +++++------ .../uikit-react-native-core/src/index.tsx | 4 +- .../src/localization/StringSet.en.ts | 7 +++ .../{label.type.ts => StringSet.type.ts} | 50 +++++++++---------- .../src/localization/label.en.ts | 7 --- .../src/ui/ChannelFrozenBanner/index.tsx | 2 +- .../src/SendbirdUIKitContainer.tsx | 24 ++++----- .../createGroupChannelCreateFragment.tsx | 8 +-- .../createGroupChannelInviteFragment.tsx | 8 +-- .../createGroupChannelListFragment.tsx | 10 ++-- .../createGroupChannelMembersFragment.tsx | 10 ++-- .../FileMessage/BaseFileMessage.tsx | 4 +- .../MessageRenderer/MessageDateSeparator.tsx | 4 +- .../src/ui/MessageRenderer/MessageTime.tsx | 4 +- .../MessageRenderer/UnknownMessage/index.tsx | 6 +-- .../UserMessage/BaseUserMessage.tsx | 4 +- .../UserMessage/OpenGraphUserMessage.tsx | 4 +- .../src/ui/NewMessagesTooltip/index.tsx | 4 +- .../src/ui/TypedPlaceholder/index.tsx | 16 +++--- 31 files changed, 169 insertions(+), 168 deletions(-) create mode 100644 packages/uikit-react-native-core/src/localization/StringSet.en.ts rename packages/uikit-react-native-core/src/localization/{label.type.ts => StringSet.type.ts} (90%) delete mode 100644 packages/uikit-react-native-core/src/localization/label.en.ts diff --git a/packages/uikit-react-native-core/__template__/module/moduleContext.tsx b/packages/uikit-react-native-core/__template__/module/moduleContext.tsx index 268fedc55..30e238766 100644 --- a/packages/uikit-react-native-core/__template__/module/moduleContext.tsx +++ b/packages/uikit-react-native-core/__template__/module/moduleContext.tsx @@ -15,7 +15,7 @@ export const __domain__ContextProvider: React.FC = ({ children }) => { return ( - <__domain__Context.Fragment.Provider value={{ headerTitle: 'LABEL.DOMAIN.HEADER_TITLE' }}> + <__domain__Context.Fragment.Provider value={{ headerTitle: 'STRINGS.DOMAIN.HEADER_TITLE' }}> {children} diff --git a/packages/uikit-react-native-core/src/contexts/Localization.tsx b/packages/uikit-react-native-core/src/contexts/Localization.tsx index c4eaf02fc..48be36551 100644 --- a/packages/uikit-react-native-core/src/contexts/Localization.tsx +++ b/packages/uikit-react-native-core/src/contexts/Localization.tsx @@ -1,28 +1,28 @@ import React, { useContext, useState } from 'react'; -import type { LabelLocale, LabelSet } from '../localization/label.type'; +import type { StringsLocale, StringSet } from '../localization/StringSet.type'; -type Props = { +type Props = { defaultLocale: T; - labelSet: Record; + stringSets: Record; children?: React.ReactNode; }; -type Context = { - LABEL: LabelSet; +type Context = { + STRINGS: StringSet; locale: T; setLocale: React.Dispatch; }; export const LocalizationContext = React.createContext(null); -export const LocalizationProvider = ({ children, labelSet, defaultLocale }: Props) => { +export const LocalizationProvider = ({ children, stringSets, defaultLocale }: Props) => { const [locale, setLocale] = useState(defaultLocale); - const LABEL = labelSet[locale]; - if (!LABEL) throw new Error(`Invalid Locale(${locale}) or LabelSet(${Object.keys(labelSet).join()})`); - return {children}; + const STRINGS = stringSets[locale]; + if (!STRINGS) throw new Error(`Invalid Locale(${locale}) or StringSet(${Object.keys(stringSets).join()})`); + return {children}; }; -export const useLocalization = () => { +export const useLocalization = () => { const value = useContext | null>(LocalizationContext as React.Context | null>); if (!value) throw new Error('LocalizationContext is not provided'); return value; diff --git a/packages/uikit-react-native-core/src/domain/groupChannel/component/GroupChannelHeader.tsx b/packages/uikit-react-native-core/src/domain/groupChannel/component/GroupChannelHeader.tsx index 9c06faeef..9587afb59 100644 --- a/packages/uikit-react-native-core/src/domain/groupChannel/component/GroupChannelHeader.tsx +++ b/packages/uikit-react-native-core/src/domain/groupChannel/component/GroupChannelHeader.tsx @@ -16,12 +16,12 @@ const GroupChannelHeader: React.FC = ({ }) => { const { headerTitle, channel } = useContext(GroupChannelContext.Fragment); const { typingUsers } = useContext(GroupChannelContext.TypingIndicator); - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { currentUser } = useSendbirdChat(); if (!Header) return null; - const subtitle = LABEL.STRINGS.TYPING_INDICATOR_TYPINGS(typingUsers); + const subtitle = STRINGS.LABELS.TYPING_INDICATOR_TYPINGS(typingUsers); return (
= ({ text, setText, editMessage, setEditMessage, onUpdateUserMessage }) => { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const inputRef = useRef(null); const toast = useToast(); @@ -35,7 +35,7 @@ const EditInput: React.FC = ({ text, setText, editMessage, setEd const onPressSave = () => { if (editMessage.isUserMessage()) { - onUpdateUserMessage(text, editMessage).catch(() => toast.show(LABEL.TOAST.UPDATE_MSG_ERROR, 'error')); + onUpdateUserMessage(text, editMessage).catch(() => toast.show(STRINGS.TOAST.UPDATE_MSG_ERROR, 'error')); } setEditMessage(); setText(''); @@ -51,16 +51,16 @@ const EditInput: React.FC = ({ text, setText, editMessage, setEd value={text} onChangeText={setText} style={styles.input} - placeholder={LABEL.GROUP_CHANNEL.INPUT_PLACEHOLDER_ACTIVE} + placeholder={STRINGS.GROUP_CHANNEL.INPUT_PLACEHOLDER_ACTIVE} /> diff --git a/packages/uikit-react-native-core/src/domain/groupChannel/component/GroupChannelInput/SendInput.tsx b/packages/uikit-react-native-core/src/domain/groupChannel/component/GroupChannelInput/SendInput.tsx index d6c5666f5..bd1575107 100644 --- a/packages/uikit-react-native-core/src/domain/groupChannel/component/GroupChannelInput/SendInput.tsx +++ b/packages/uikit-react-native-core/src/domain/groupChannel/component/GroupChannelInput/SendInput.tsx @@ -21,58 +21,58 @@ type SendInputProps = GroupChannelProps['Input'] & { disabled: boolean; }; const SendInput: React.FC = ({ onSendUserMessage, onSendFileMessage, text, setText, disabled }) => { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { openSheet } = useBottomSheet(); const { fileService } = usePlatformService(); const { colors } = useUIKitTheme(); const toast = useToast(); const onPressSend = () => { - onSendUserMessage(text).catch(() => toast.show(LABEL.TOAST.SEND_MSG_ERROR, 'error')); + onSendUserMessage(text).catch(() => toast.show(STRINGS.TOAST.SEND_MSG_ERROR, 'error')); setText(''); }; const onPressAttachment = () => { openSheet({ sheetItems: [ { - title: LABEL.GROUP_CHANNEL.DIALOG_ATTACHMENT_CAMERA, + title: STRINGS.GROUP_CHANNEL.DIALOG_ATTACHMENT_CAMERA, icon: 'camera', onPress: async () => { const photo = await fileService.openCamera({ mediaType: 'photo', - onError: () => toast.show(LABEL.TOAST.OPEN_CAMERA_ERROR, 'error'), + onError: () => toast.show(STRINGS.TOAST.OPEN_CAMERA_ERROR, 'error'), }); if (photo) { - onSendFileMessage(photo).catch(() => toast.show(LABEL.TOAST.SEND_MSG_ERROR, 'error')); + onSendFileMessage(photo).catch(() => toast.show(STRINGS.TOAST.SEND_MSG_ERROR, 'error')); } }, }, { - title: LABEL.GROUP_CHANNEL.DIALOG_ATTACHMENT_PHOTO_LIBRARY, + title: STRINGS.GROUP_CHANNEL.DIALOG_ATTACHMENT_PHOTO_LIBRARY, icon: 'photo', onPress: async () => { const photo = await fileService.openMediaLibrary({ selectionLimit: 1, mediaType: 'photo', - onError: () => toast.show(LABEL.TOAST.OPEN_PHOTO_LIBRARY_ERROR, 'error'), + onError: () => toast.show(STRINGS.TOAST.OPEN_PHOTO_LIBRARY_ERROR, 'error'), }); if (photo && photo[0]) { - onSendFileMessage(photo[0]).catch(() => toast.show(LABEL.TOAST.SEND_MSG_ERROR, 'error')); + onSendFileMessage(photo[0]).catch(() => toast.show(STRINGS.TOAST.SEND_MSG_ERROR, 'error')); } }, }, { - title: LABEL.GROUP_CHANNEL.DIALOG_ATTACHMENT_FILES, + title: STRINGS.GROUP_CHANNEL.DIALOG_ATTACHMENT_FILES, icon: 'document', onPress: async () => { const file = await fileService.openDocument({ - onError: () => toast.show(LABEL.TOAST.OPEN_FILES_ERROR, 'error'), + onError: () => toast.show(STRINGS.TOAST.OPEN_FILES_ERROR, 'error'), }); if (file) { - onSendFileMessage(file).catch(() => toast.show(LABEL.TOAST.SEND_MSG_ERROR, 'error')); + onSendFileMessage(file).catch(() => toast.show(STRINGS.TOAST.SEND_MSG_ERROR, 'error')); } }, }, @@ -98,7 +98,7 @@ const SendInput: React.FC = ({ onSendUserMessage, onSendFileMess style={styles.input} placeholder={conditionChaining( [disabled], - [LABEL.GROUP_CHANNEL.INPUT_PLACEHOLDER_DISABLED, LABEL.GROUP_CHANNEL.INPUT_PLACEHOLDER_ACTIVE], + [STRINGS.GROUP_CHANNEL.INPUT_PLACEHOLDER_DISABLED, STRINGS.GROUP_CHANNEL.INPUT_PLACEHOLDER_ACTIVE], )} /> {Boolean(text) && ( diff --git a/packages/uikit-react-native-core/src/domain/groupChannel/component/GroupChannelMessageList.tsx b/packages/uikit-react-native-core/src/domain/groupChannel/component/GroupChannelMessageList.tsx index bf26349e8..a38ec7ae5 100644 --- a/packages/uikit-react-native-core/src/domain/groupChannel/component/GroupChannelMessageList.tsx +++ b/packages/uikit-react-native-core/src/domain/groupChannel/component/GroupChannelMessageList.tsx @@ -48,7 +48,7 @@ const GroupChannelMessageList: React.FC = ({ flatListProps, enableMessageGrouping, }) => { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { colors } = useUIKitTheme(); const { left, right } = useSafeAreaInsets(); const [scrollLeaveBottom, setScrollLeaveBottom] = useState(false); @@ -92,7 +92,7 @@ const GroupChannelMessageList: React.FC = ({ return ( {channel.isFrozen && ( - + )} ) => { const { colors } = useUIKitTheme(); - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const toast = useToast(); const { openSheet } = useBottomSheet(); const { alert } = useAlert(); @@ -153,11 +153,12 @@ const useGetMessagePressActions = ({ openSheet({ sheetItems: [ { - title: LABEL.GROUP_CHANNEL.DIALOG_MESSAGE_FAILED_RETRY, - onPress: () => onResendFailedMessage(message).catch(() => toast.show(LABEL.TOAST.RESEND_MSG_ERROR, 'error')), + title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_FAILED_RETRY, + onPress: () => + onResendFailedMessage(message).catch(() => toast.show(STRINGS.TOAST.RESEND_MSG_ERROR, 'error')), }, { - title: LABEL.GROUP_CHANNEL.DIALOG_MESSAGE_FAILED_REMOVE, + title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_FAILED_REMOVE, titleColor: colors.ui.dialog.default.none.destructive, onPress: () => confirmDelete(message), }, @@ -166,15 +167,15 @@ const useGetMessagePressActions = ({ }; const confirmDelete = (message: HandleableMessage) => { alert({ - title: LABEL.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE_CONFIRM_TITLE, + title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE_CONFIRM_TITLE, buttons: [ { - text: LABEL.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE_CONFIRM_CANCEL, + text: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE_CONFIRM_CANCEL, }, { - text: LABEL.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE_CONFIRM_OK, + text: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE_CONFIRM_OK, style: 'destructive', - onPress: () => onDeleteMessage(message).catch(() => toast.show(LABEL.TOAST.DELETE_MSG_ERROR, 'error')), + onPress: () => onDeleteMessage(message).catch(() => toast.show(STRINGS.TOAST.DELETE_MSG_ERROR, 'error')), }, ], }); @@ -194,10 +195,10 @@ const useGetMessagePressActions = ({ if (msg.isUserMessage()) { sheetItems.push({ icon: 'copy', - title: LABEL.GROUP_CHANNEL.DIALOG_MESSAGE_COPY, + title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_COPY, onPress: () => { clipboardService.setString(msg.message || ''); - toast.show(LABEL.TOAST.COPY_OK, 'success'); + toast.show(STRINGS.TOAST.COPY_OK, 'success'); }, }); @@ -205,12 +206,12 @@ const useGetMessagePressActions = ({ sheetItems.push( { icon: 'edit', - title: LABEL.GROUP_CHANNEL.DIALOG_MESSAGE_EDIT, + title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_EDIT, onPress: () => setEditMessage(msg), }, { icon: 'delete', - title: LABEL.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE, + title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE, onPress: () => confirmDelete(msg), }, ); @@ -220,20 +221,20 @@ const useGetMessagePressActions = ({ if (msg.isFileMessage()) { sheetItems.push({ icon: 'download', - title: LABEL.GROUP_CHANNEL.DIALOG_MESSAGE_SAVE, + title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_SAVE, onPress: async () => { if (toMegabyte(msg.size) > 4) { - toast.show(LABEL.TOAST.DOWNLOAD_START, 'success'); + toast.show(STRINGS.TOAST.DOWNLOAD_START, 'success'); } fileService .save(msg.url, msg.name) .then((response) => { - toast.show(LABEL.TOAST.DOWNLOAD_OK, 'success'); + toast.show(STRINGS.TOAST.DOWNLOAD_OK, 'success'); Logger.log('File saved to', response); }) .catch((err) => { - toast.show(LABEL.TOAST.DOWNLOAD_ERROR, 'error'); + toast.show(STRINGS.TOAST.DOWNLOAD_ERROR, 'error'); Logger.log('File save failure', err); }); }, @@ -242,7 +243,7 @@ const useGetMessagePressActions = ({ if (isMyMessage(msg, currentUserId) && msg.sendingStatus === 'succeeded') { sheetItems.push({ icon: 'delete', - title: LABEL.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE, + title: STRINGS.GROUP_CHANNEL.DIALOG_MESSAGE_DELETE, onPress: () => confirmDelete(msg), }); } diff --git a/packages/uikit-react-native-core/src/domain/groupChannel/module/moduleContext.tsx b/packages/uikit-react-native-core/src/domain/groupChannel/module/moduleContext.tsx index a3e7365a5..4c872633c 100644 --- a/packages/uikit-react-native-core/src/domain/groupChannel/module/moduleContext.tsx +++ b/packages/uikit-react-native-core/src/domain/groupChannel/module/moduleContext.tsx @@ -29,7 +29,7 @@ export const GroupChannelContextProvider: GroupChannelModule['Provider'] = ({ if (!channel) throw new Error('GroupChannel is not provided to GroupChannelModule'); const id = useUniqId('GroupChannelContextProvider'); - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { currentUser, sdk } = useSendbirdChat(); const [typingUsers, setTypingUsers] = useState([]); @@ -52,7 +52,7 @@ export const GroupChannelContextProvider: GroupChannelModule['Provider'] = ({ = () => { const channelMenu = useContext(GroupChannelListContext.ChannelMenu); - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { currentUser } = useSendbirdChat(); const [visible, setVisible] = useState(false); @@ -25,11 +25,11 @@ const GroupChannelListChannelMenu: React.FC { if (channelMenu.selectedChannel?.myPushTriggerOption === 'off') { await channelMenu.selectedChannel?.setMyPushTriggerOption('default'); @@ -39,7 +39,7 @@ const GroupChannelListChannelMenu: React.FC { await channelMenu.selectedChannel?.leave(); }, diff --git a/packages/uikit-react-native-core/src/domain/groupChannelList/component/GroupChannelListTypeSelector.tsx b/packages/uikit-react-native-core/src/domain/groupChannelList/component/GroupChannelListTypeSelector.tsx index 1bcb45ab9..9fadbbbcf 100644 --- a/packages/uikit-react-native-core/src/domain/groupChannelList/component/GroupChannelListTypeSelector.tsx +++ b/packages/uikit-react-native-core/src/domain/groupChannelList/component/GroupChannelListTypeSelector.tsx @@ -87,11 +87,11 @@ const DefaultTypeIcon: React.FC<{ type: GroupChannelType }> = ({ type }) => { }; const DefaultTypeText: React.FC<{ type: GroupChannelType }> = ({ type }) => { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { colors } = useUIKitTheme(); return ( - {LABEL.GROUP_CHANNEL_LIST[`TYPE_SELECTOR_${type}`]} + {STRINGS.GROUP_CHANNEL_LIST[`TYPE_SELECTOR_${type}`]} ); }; diff --git a/packages/uikit-react-native-core/src/domain/groupChannelList/module/moduleContext.tsx b/packages/uikit-react-native-core/src/domain/groupChannelList/module/moduleContext.tsx index 5be6b317f..9fb3cb2f9 100644 --- a/packages/uikit-react-native-core/src/domain/groupChannelList/module/moduleContext.tsx +++ b/packages/uikit-react-native-core/src/domain/groupChannelList/module/moduleContext.tsx @@ -23,7 +23,7 @@ export const GroupChannelListContext: GroupChannelListContextType = { }; export const GroupChannelListContextProvider: React.FC = ({ children }) => { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); // Type selector const [visible, setVisible] = useState(false); @@ -36,9 +36,9 @@ export const GroupChannelListContextProvider: React.FC = ({ children }) => { return ( - + {children} diff --git a/packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsInfo.tsx b/packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsInfo.tsx index 9fb5151c3..0d649ea98 100644 --- a/packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsInfo.tsx +++ b/packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsInfo.tsx @@ -18,7 +18,7 @@ import type { GroupChannelSettingsProps } from '../types'; const GroupChannelSettingsInfo: React.FC = () => { const { channel } = useContext(GroupChannelSettingsContext.Fragment); const { currentUser } = useSendbirdChat(); - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); if (!currentUser) { Logger.warn('Cannot render GroupChannelSettingsInfo, User is not connected'); @@ -40,7 +40,7 @@ const GroupChannelSettingsInfo: React.FC = () ], )} - {getGroupChannelTitle(currentUser.userId, channel, LABEL.STRINGS.USER_NO_NAME)} + {getGroupChannelTitle(currentUser.userId, channel, STRINGS.LABELS.USER_NO_NAME)} diff --git a/packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.tsx b/packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.tsx index e27505ad7..7b4689fb8 100644 --- a/packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.tsx +++ b/packages/uikit-react-native-core/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.tsx @@ -14,7 +14,7 @@ const GroupChannelSettingsMenu: React.FC = ({ menuItemsCreator = (menu) => menu, }) => { const { channel } = useContext(GroupChannelSettingsContext.Fragment); - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { colors } = useUIKitTheme(); const toggleNotification = async () => { @@ -28,13 +28,13 @@ const GroupChannelSettingsMenu: React.FC = ({ const menuItems: MenuBarProps[] = menuItemsCreator([ { icon: 'notifications', - name: LABEL.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION, + name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION, onPress: toggleNotification, actionItem: , }, { icon: 'members', - name: LABEL.GROUP_CHANNEL_SETTINGS.MENU_MEMBERS, + name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_MEMBERS, onPress: () => onPressMenuMembers(), actionLabel: String(channel.memberCount), actionItem: , @@ -42,7 +42,7 @@ const GroupChannelSettingsMenu: React.FC = ({ { icon: 'leave', iconColor: colors.error, - name: LABEL.GROUP_CHANNEL_SETTINGS.MENU_LEAVE_CHANNEL, + name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_LEAVE_CHANNEL, onPress: () => { onLeaveChannel(); channel.leave(); diff --git a/packages/uikit-react-native-core/src/domain/groupChannelSettings/module/moduleContext.tsx b/packages/uikit-react-native-core/src/domain/groupChannelSettings/module/moduleContext.tsx index 264b12ef0..2fe868117 100644 --- a/packages/uikit-react-native-core/src/domain/groupChannelSettings/module/moduleContext.tsx +++ b/packages/uikit-react-native-core/src/domain/groupChannelSettings/module/moduleContext.tsx @@ -28,7 +28,7 @@ export const GroupChannelSettingsContextProvider: React.FC { prompt({ - 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, + title: STRINGS.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_TITLE, + submitLabel: STRINGS.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_OK, + placeholder: STRINGS.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_PLACEHOLDER, defaultValue: activeChannel.name, onSubmit: async (channelName) => { const params = new sdk.GroupChannelParams(); @@ -78,14 +78,14 @@ export const GroupChannelSettingsContextProvider: React.FC { openMenu({ - title: LABEL.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE_MENU_TITLE, + title: STRINGS.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE_MENU_TITLE, menuItems: [ { - title: LABEL.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE_MENU_CAMERA, + title: STRINGS.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE_MENU_CAMERA, onPress: async () => { const file = await fileService.openCamera(); if (!file) return; @@ -96,7 +96,7 @@ export const GroupChannelSettingsContextProvider: React.FC { const files = await fileService.openMediaLibrary({ selectionLimit: 1 }); if (!files || !files[0]) return; @@ -108,24 +108,24 @@ export const GroupChannelSettingsContextProvider: React.FC { openSheet({ sheetItems: [ - { title: LABEL.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME, onPress: changeChannelName }, - { title: LABEL.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE, onPress: changeChannelImage }, + { title: STRINGS.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME, onPress: changeChannelName }, + { title: STRINGS.GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE, onPress: changeChannelImage }, ], }); - }, [LABEL, changeChannelImage, changeChannelName]); + }, [STRINGS, changeChannelImage, changeChannelName]); return ( diff --git a/packages/uikit-react-native-core/src/index.tsx b/packages/uikit-react-native-core/src/index.tsx index f69f19dff..ff9b121e6 100644 --- a/packages/uikit-react-native-core/src/index.tsx +++ b/packages/uikit-react-native-core/src/index.tsx @@ -13,8 +13,8 @@ export { default as useConnection } from './hooks/useConnection'; export { default as usePushTokenRegistration } from './hooks/usePushTokenRegistration'; /** Localization **/ -export { default as LabelEn } from './localization/label.en'; -export type { LabelSet, LabelLocale } from './localization/label.type'; +export { default as StringSetEn } from './localization/StringSet.en'; +export type { StringSet, StringsLocale } from './localization/StringSet.type'; /** Platform API **/ export { default as createNativeFileService } from './platform/createFileService.native'; diff --git a/packages/uikit-react-native-core/src/localization/StringSet.en.ts b/packages/uikit-react-native-core/src/localization/StringSet.en.ts new file mode 100644 index 000000000..52479deb5 --- /dev/null +++ b/packages/uikit-react-native-core/src/localization/StringSet.en.ts @@ -0,0 +1,7 @@ +import dateLocale from 'date-fns/locale/en-US'; + +import { createBaseStringSet } from './StringSet.type'; + +const StringSetEn = createBaseStringSet({ dateLocale }); + +export default StringSetEn; diff --git a/packages/uikit-react-native-core/src/localization/label.type.ts b/packages/uikit-react-native-core/src/localization/StringSet.type.ts similarity index 90% rename from packages/uikit-react-native-core/src/localization/label.type.ts rename to packages/uikit-react-native-core/src/localization/StringSet.type.ts index 5d1b70272..f9441160c 100644 --- a/packages/uikit-react-native-core/src/localization/label.type.ts +++ b/packages/uikit-react-native-core/src/localization/StringSet.type.ts @@ -11,15 +11,15 @@ import { truncate, } from '@sendbird/uikit-utils'; -export interface LabelLocale { +export interface StringsLocale { locale: 'en'; } /** - * LabelSet interface + * StringSet interface * Do not configure over 3 depths (for overrides easy) * */ -export interface LabelSet { +export interface StringSet { GROUP_CHANNEL: { /** GroupChannel > Header */ HEADER_TITLE: (currentUserId: string, channel: Sendbird.GroupChannel) => string; @@ -126,7 +126,7 @@ export interface LabelSet { HEADER_RIGHT: (params: { selectedUsers: Array }) => string; }; // UI - STRINGS: { + LABELS: { USER_NO_NAME: string; TYPING_INDICATOR_TYPINGS: (users: Sendbird.User[]) => string | undefined; }; @@ -136,7 +136,7 @@ export interface LabelSet { NO_MESSAGES: string; NO_MUTED_MEMBERS: string; NO_RESULTS_FOUND: string; - ERROR_SOMETHING_IS_WRONG: { + ERROR: { MESSAGE: string; RETRY_LABEL: string; }; @@ -162,30 +162,30 @@ export interface LabelSet { }; } -type LabelCreateOptions = { +type StringSetCreateOptions = { dateLocale: Locale; - overrides?: PartialDeep; + overrides?: PartialDeep; }; /** - * Create label set - * You can create localized labels, you should provide locale for date and string as a parameters + * Create string set + * You can create localized String set, you should provide locale for date and string as a parameters * - * @param {LabelCreateOptions.dateLocale} dateLocale Date locale (from date-fns) - * @param {LabelCreateOptions.overrides} [overrides] Localized label strings + * @param {StringSetCreateOptions.dateLocale} dateLocale Date locale (from date-fns) + * @param {StringSetCreateOptions.overrides} [overrides] Localized strings * */ -export const createBaseLabel = ({ dateLocale, overrides }: LabelCreateOptions): LabelSet => { - const USER_NO_NAME = overrides?.STRINGS?.USER_NO_NAME ?? '(No name)'; +export const createBaseStringSet = ({ dateLocale, overrides }: StringSetCreateOptions): StringSet => { + const USER_NO_NAME = overrides?.LABELS?.USER_NO_NAME ?? '(No name)'; return { GROUP_CHANNEL: { HEADER_TITLE: (currentUserId, channel) => getGroupChannelTitle(currentUserId, channel, USER_NO_NAME), - LIST_BANNER_FROZEN: 'Channel frozen', + LIST_BANNER_FROZEN: 'Channel is frozen', LIST_DATE_SEPARATOR: (date, locale) => dateSeparator(date, locale ?? dateLocale), LIST_TOOLTIP_NEW_MSG: (newMessages) => `${newMessages.length} new messages`, MESSAGE_BUBBLE_TIME: (message, locale) => messageTime(new Date(message.createdAt), locale ?? dateLocale), MESSAGE_BUBBLE_FILE_TITLE: (message) => truncate(message.name, { mode: 'mid', maxLen: 20 }), - MESSAGE_BUBBLE_EDITED_POSTFIX: ' (Edited)', + MESSAGE_BUBBLE_EDITED_POSTFIX: ' (edited)', MESSAGE_BUBBLE_UNKNOWN_TITLE: () => '(Unknown message type)', MESSAGE_BUBBLE_UNKNOWN_DESC: () => 'Cannot read this message.', @@ -212,11 +212,11 @@ export const createBaseLabel = ({ dateLocale, overrides }: LabelCreateOptions): GROUP_CHANNEL_SETTINGS: { HEADER_TITLE: 'Channel information', HEADER_RIGHT: 'Edit', - MENU_NOTIFICATION: 'Notification', + MENU_NOTIFICATION: 'Notifications', MENU_MEMBERS: 'Members', MENU_LEAVE_CHANNEL: 'Leave channel', DIALOG_CHANGE_NAME: 'Change channel name', - DIALOG_CHANGE_NAME_PROMPT_TITLE: 'Change name', + DIALOG_CHANGE_NAME_PROMPT_TITLE: 'Change channel name', DIALOG_CHANGE_NAME_PROMPT_PLACEHOLDER: 'Enter name', DIALOG_CHANGE_NAME_PROMPT_OK: 'Save', DIALOG_CHANGE_NAME_PROMPT_CANCEL: 'Cancel', @@ -267,11 +267,11 @@ export const createBaseLabel = ({ dateLocale, overrides }: LabelCreateOptions): HEADER_RIGHT: ({ selectedUsers }) => { const len = selectedUsers.length; if (len === 0) return 'Invite'; - return `${len} Invite`; + return `${len} invites`; }, ...overrides?.GROUP_CHANNEL_INVITE, }, - STRINGS: { + LABELS: { USER_NO_NAME, TYPING_INDICATOR_TYPINGS: (users, NO_NAME = USER_NO_NAME) => { const userNames = users.map((u) => u.nickname || NO_NAME); @@ -280,19 +280,19 @@ export const createBaseLabel = ({ dateLocale, overrides }: LabelCreateOptions): if (users.length === 2) return `${userNames.join(' and ')} are typing...`; return 'Several people are typing...'; }, - ...overrides?.STRINGS, + ...overrides?.LABELS, }, PLACEHOLDER: { NO_BANNED_MEMBERS: 'No banned members', - NO_CHANNELS: 'There are no channels', - NO_MESSAGES: 'There are no messages', + NO_CHANNELS: 'No channels', + NO_MESSAGES: 'No messages', NO_MUTED_MEMBERS: 'No muted members', NO_RESULTS_FOUND: 'No results found', ...overrides?.PLACEHOLDER, - ERROR_SOMETHING_IS_WRONG: { - MESSAGE: 'Something is wrong', + ERROR: { + MESSAGE: 'Something went wrong', RETRY_LABEL: 'Retry', - ...overrides?.PLACEHOLDER?.ERROR_SOMETHING_IS_WRONG, + ...overrides?.PLACEHOLDER?.ERROR, }, }, DIALOG: { diff --git a/packages/uikit-react-native-core/src/localization/label.en.ts b/packages/uikit-react-native-core/src/localization/label.en.ts deleted file mode 100644 index 9959c6ecb..000000000 --- a/packages/uikit-react-native-core/src/localization/label.en.ts +++ /dev/null @@ -1,7 +0,0 @@ -import dateLocale from 'date-fns/locale/en-US'; - -import { createBaseLabel } from './label.type'; - -const LabelEn = createBaseLabel({ dateLocale }); - -export default LabelEn; diff --git a/packages/uikit-react-native-foundation/src/ui/ChannelFrozenBanner/index.tsx b/packages/uikit-react-native-foundation/src/ui/ChannelFrozenBanner/index.tsx index ead9e88fe..d63433260 100644 --- a/packages/uikit-react-native-foundation/src/ui/ChannelFrozenBanner/index.tsx +++ b/packages/uikit-react-native-foundation/src/ui/ChannelFrozenBanner/index.tsx @@ -12,7 +12,7 @@ type Props = { backgroundColor?: string; }; -const ChannelFrozenBanner: React.FC = ({ text = 'Channel frozen', backgroundColor, textColor, style }) => { +const ChannelFrozenBanner: React.FC = ({ text = 'Channel is frozen', backgroundColor, textColor, style }) => { const { palette } = useUIKitTheme(); return ( diff --git a/packages/uikit-react-native/src/SendbirdUIKitContainer.tsx b/packages/uikit-react-native/src/SendbirdUIKitContainer.tsx index 6674063f9..f9a1b0e3d 100644 --- a/packages/uikit-react-native/src/SendbirdUIKitContainer.tsx +++ b/packages/uikit-react-native/src/SendbirdUIKitContainer.tsx @@ -6,14 +6,14 @@ import Sendbird from 'sendbird'; import type { ClipboardServiceInterface, FileServiceInterface, - LabelSet, NotificationServiceInterface, + StringSet, } from '@sendbird/uikit-react-native-core'; import { - LabelEn, LocalizationProvider, PlatformServiceProvider, SendbirdChatProvider, + StringSetEn, useLocalization, } from '@sendbird/uikit-react-native-core'; import type { UIKitTheme } from '@sendbird/uikit-react-native-foundation'; @@ -36,8 +36,8 @@ export const SendbirdUIKit = Object.freeze({ PLATFORM: Platform.OS.toLowerCase(), }); -type LabelSets = Record; -type Props = { +type StringSets = Record; +type Props = { children?: React.ReactNode; appId: string; appVersion?: string; @@ -52,7 +52,7 @@ type Props = { clipboard: ClipboardServiceInterface; }; localization?: { - labelSet?: T; + stringSets?: T; defaultLocale?: keyof T; }; styles?: { @@ -64,7 +64,7 @@ type Props = { ErrorInfoComponent?: (props: ErrorBoundaryProps) => JSX.Element; }; -const SendbirdUIKitContainer = ({ +const SendbirdUIKitContainer = ({ children, appId, appVersion, @@ -122,7 +122,7 @@ const SendbirdUIKitContainer = ({ > ({ }; const LocalizedDialogProvider: React.FC = ({ children }) => { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); return ( diff --git a/packages/uikit-react-native/src/fragments/createGroupChannelCreateFragment.tsx b/packages/uikit-react-native/src/fragments/createGroupChannelCreateFragment.tsx index f51da5274..7efafe199 100644 --- a/packages/uikit-react-native/src/fragments/createGroupChannelCreateFragment.tsx +++ b/packages/uikit-react-native/src/fragments/createGroupChannelCreateFragment.tsx @@ -45,7 +45,7 @@ const createGroupChannelCreateFragment = ( children, }) => { const { sdk, currentUser } = useSendbirdChat(); - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { users, refreshing, refresh, next } = useUserList(sdk, { queryCreator, sortComparator, @@ -78,7 +78,7 @@ const createGroupChannelCreateFragment = ( > @@ -89,8 +89,8 @@ const createGroupChannelCreateFragment = ( ); return ( LABEL.GROUP_CHANNEL_CREATE.HEADER_RIGHT({ selectedUsers })} - headerTitle={LABEL.GROUP_CHANNEL_CREATE.HEADER_TITLE} + headerRight={(selectedUsers) => STRINGS.GROUP_CHANNEL_CREATE.HEADER_RIGHT({ selectedUsers })} + headerTitle={STRINGS.GROUP_CHANNEL_CREATE.HEADER_TITLE} > ( children, }) => { const { sdk } = useSendbirdChat(); - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { users, refreshing, refresh, next } = useUserList(sdk, { queryCreator, sortComparator, @@ -80,7 +80,7 @@ const createGroupChannelInviteFragment = ( > @@ -91,8 +91,8 @@ const createGroupChannelInviteFragment = ( ); return ( LABEL.GROUP_CHANNEL_INVITE.HEADER_RIGHT({ selectedUsers })} - headerTitle={LABEL.GROUP_CHANNEL_INVITE.HEADER_TITLE} + headerRight={(selectedUsers) => STRINGS.GROUP_CHANNEL_INVITE.HEADER_RIGHT({ selectedUsers })} + headerTitle={STRINGS.GROUP_CHANNEL_INVITE.HEADER_TITLE} > ( @@ -58,9 +58,9 @@ const createGroupChannelListFragment = (initModule?: Partial ), - [LABEL, onPressChannel, currentUser?.userId], + [STRINGS, onPressChannel, currentUser?.userId], ); if (!currentUser) { diff --git a/packages/uikit-react-native/src/fragments/createGroupChannelMembersFragment.tsx b/packages/uikit-react-native/src/fragments/createGroupChannelMembersFragment.tsx index 81ca86f0b..861138ee2 100644 --- a/packages/uikit-react-native/src/fragments/createGroupChannelMembersFragment.tsx +++ b/packages/uikit-react-native/src/fragments/createGroupChannelMembersFragment.tsx @@ -34,7 +34,7 @@ const createGroupChannelMembersFragment = ( return ({ Header, channel, onPressHeaderLeft, onPressHeaderRight, sortComparator, renderUser, children }) => { const queryCreator = useCallback(() => createMemberListQuery(channel), [channel]); const { sdk, currentUser } = useSendbirdChat(); - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { users, refreshing, refresh, next } = useUserList(sdk, { queryCreator, sortComparator, @@ -48,10 +48,10 @@ const createGroupChannelMembersFragment = ( + { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { colors } = useUIKitTheme(); const color = colors.ui.message[variant][pressed ? 'pressed' : 'enabled']; return ( @@ -25,7 +25,7 @@ const BaseFileMessage: React.FC - {LABEL.GROUP_CHANNEL.MESSAGE_BUBBLE_FILE_TITLE(message)} + {STRINGS.GROUP_CHANNEL.MESSAGE_BUBBLE_FILE_TITLE(message)} ); diff --git a/packages/uikit-react-native/src/ui/MessageRenderer/MessageDateSeparator.tsx b/packages/uikit-react-native/src/ui/MessageRenderer/MessageDateSeparator.tsx index f942aa96d..49a146154 100644 --- a/packages/uikit-react-native/src/ui/MessageRenderer/MessageDateSeparator.tsx +++ b/packages/uikit-react-native/src/ui/MessageRenderer/MessageDateSeparator.tsx @@ -12,7 +12,7 @@ type Props = { }; const MessageDateSeparator: React.FC = ({ message, prevMessage }) => { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { colors } = useUIKitTheme(); const sameDay = isSameDay(message.createdAt, prevMessage?.createdAt ?? 0); if (sameDay) return null; @@ -20,7 +20,7 @@ const MessageDateSeparator: React.FC = ({ message, prevMessage }) => { - {LABEL.GROUP_CHANNEL.LIST_DATE_SEPARATOR(new Date(message.createdAt))} + {STRINGS.GROUP_CHANNEL.LIST_DATE_SEPARATOR(new Date(message.createdAt))} diff --git a/packages/uikit-react-native/src/ui/MessageRenderer/MessageTime.tsx b/packages/uikit-react-native/src/ui/MessageRenderer/MessageTime.tsx index 22352f0ed..deccf98a3 100644 --- a/packages/uikit-react-native/src/ui/MessageRenderer/MessageTime.tsx +++ b/packages/uikit-react-native/src/ui/MessageRenderer/MessageTime.tsx @@ -7,14 +7,14 @@ import type { SendbirdMessage } from '@sendbird/uikit-utils'; type Props = { message: SendbirdMessage; grouping: boolean; style?: StyleProp }; const MessageTime: React.FC = ({ message, grouping, style }) => { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { colors } = useUIKitTheme(); if (grouping) return null; return ( - {LABEL.GROUP_CHANNEL.MESSAGE_BUBBLE_TIME(message)} + {STRINGS.GROUP_CHANNEL.MESSAGE_BUBBLE_TIME(message)} ); diff --git a/packages/uikit-react-native/src/ui/MessageRenderer/UnknownMessage/index.tsx b/packages/uikit-react-native/src/ui/MessageRenderer/UnknownMessage/index.tsx index b438fe49c..f0c183b93 100644 --- a/packages/uikit-react-native/src/ui/MessageRenderer/UnknownMessage/index.tsx +++ b/packages/uikit-react-native/src/ui/MessageRenderer/UnknownMessage/index.tsx @@ -8,16 +8,16 @@ import type { MessageRendererInterface } from '../index'; export type UnknownMessageProps = MessageRendererInterface; const UnknownMessage: React.FC = ({ message, variant, pressed }) => { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { colors } = useUIKitTheme(); const color = colors.ui.message[variant][pressed ? 'pressed' : 'enabled']; return ( - {LABEL.GROUP_CHANNEL.MESSAGE_BUBBLE_UNKNOWN_TITLE(message)} + {STRINGS.GROUP_CHANNEL.MESSAGE_BUBBLE_UNKNOWN_TITLE(message)} - {LABEL.GROUP_CHANNEL.MESSAGE_BUBBLE_UNKNOWN_DESC(message)} + {STRINGS.GROUP_CHANNEL.MESSAGE_BUBBLE_UNKNOWN_DESC(message)} ); diff --git a/packages/uikit-react-native/src/ui/MessageRenderer/UserMessage/BaseUserMessage.tsx b/packages/uikit-react-native/src/ui/MessageRenderer/UserMessage/BaseUserMessage.tsx index c38a33520..67f20b21f 100644 --- a/packages/uikit-react-native/src/ui/MessageRenderer/UserMessage/BaseUserMessage.tsx +++ b/packages/uikit-react-native/src/ui/MessageRenderer/UserMessage/BaseUserMessage.tsx @@ -9,14 +9,14 @@ import type { UserMessageProps } from './index'; const BaseUserMessage: React.FC = ({ message, variant, pressed }) => { const { colors } = useUIKitTheme(); const color = colors.ui.message[variant][pressed ? 'pressed' : 'enabled']; - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); return ( {message.message} {Boolean(message.updatedAt) && ( - {LABEL.GROUP_CHANNEL.MESSAGE_BUBBLE_EDITED_POSTFIX} + {STRINGS.GROUP_CHANNEL.MESSAGE_BUBBLE_EDITED_POSTFIX} )} diff --git a/packages/uikit-react-native/src/ui/MessageRenderer/UserMessage/OpenGraphUserMessage.tsx b/packages/uikit-react-native/src/ui/MessageRenderer/UserMessage/OpenGraphUserMessage.tsx index eb5e7be07..fb4586659 100644 --- a/packages/uikit-react-native/src/ui/MessageRenderer/UserMessage/OpenGraphUserMessage.tsx +++ b/packages/uikit-react-native/src/ui/MessageRenderer/UserMessage/OpenGraphUserMessage.tsx @@ -10,7 +10,7 @@ import type { UserMessageProps } from './index'; type Props = UserMessageProps & { ogMetaData: Sendbird.OGMetaData }; const OpenGraphUserMessage: React.FC = ({ message, variant, pressed, ogMetaData }) => { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { colors, select, palette } = useUIKitTheme(); const color = colors.ui.message[variant][pressed ? 'pressed' : 'enabled']; const [imageNotFound, setImageNotFound] = useState(false); @@ -21,7 +21,7 @@ const OpenGraphUserMessage: React.FC = ({ message, variant, pressed, ogMe {message.message} {Boolean(message.updatedAt) && ( - {LABEL.GROUP_CHANNEL.MESSAGE_BUBBLE_EDITED_POSTFIX} + {STRINGS.GROUP_CHANNEL.MESSAGE_BUBBLE_EDITED_POSTFIX} )} diff --git a/packages/uikit-react-native/src/ui/NewMessagesTooltip/index.tsx b/packages/uikit-react-native/src/ui/NewMessagesTooltip/index.tsx index 6c1ee4c21..46dc2576b 100644 --- a/packages/uikit-react-native/src/ui/NewMessagesTooltip/index.tsx +++ b/packages/uikit-react-native/src/ui/NewMessagesTooltip/index.tsx @@ -11,7 +11,7 @@ type Props = { onPress: () => void; }; const NewMessagesTooltip: React.FC = ({ newMessages, visible, onPress }) => { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); const { select, palette, colors } = useUIKitTheme(); if (newMessages.length === 0 || !visible) return null; return ( @@ -24,7 +24,7 @@ const NewMessagesTooltip: React.FC = ({ newMessages, visible, onPress }) ]} > - {LABEL.GROUP_CHANNEL.LIST_TOOLTIP_NEW_MSG(newMessages)} + {STRINGS.GROUP_CHANNEL.LIST_TOOLTIP_NEW_MSG(newMessages)} ); diff --git a/packages/uikit-react-native/src/ui/TypedPlaceholder/index.tsx b/packages/uikit-react-native/src/ui/TypedPlaceholder/index.tsx index 8a86362f9..f4da904dd 100644 --- a/packages/uikit-react-native/src/ui/TypedPlaceholder/index.tsx +++ b/packages/uikit-react-native/src/ui/TypedPlaceholder/index.tsx @@ -15,24 +15,24 @@ type Props = { onPressRetry?: () => void; }; const TypedPlaceholder: React.FC = ({ type, onPressRetry }) => { - const { LABEL } = useLocalization(); + const { STRINGS } = useLocalization(); switch (type) { case 'no-banned-members': - return ; + return ; case 'no-channels': - return ; + return ; case 'no-messages': - return ; + return ; case 'no-muted-members': - return ; + return ; case 'no-results-found': - return ; + return ; case 'error-wrong': return ( );