Skip to content

Commit 6a07692

Browse files
committed
chore: apply review.
1 parent 1b59c86 commit 6a07692

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/uikit-react-native/src/localization/StringSet.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export interface StringSet {
144144
MESSAGE_BUBBLE_UNKNOWN_DESC: (message: SendbirdMessage) => string;
145145

146146
PARENT_MESSAGE_TIME: (message: SendbirdMessage, locale?: Locale) => string;
147-
REPLY_COUNT: (replyCount: number, minRepliesForPlusFormat?: number) => string;
147+
REPLY_COUNT: (replyCount: number, maxReplyCount?: number) => string;
148148

149149
/** GroupChannelThread > Suggested mention list */
150150
MENTION_LIMITED: (mentionLimit: number) => string;

packages/uikit-react-native/src/localization/createBaseStringSet.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ export const createBaseStringSet = ({ dateLocale, overrides }: StringSetCreateOp
142142

143143
PARENT_MESSAGE_TIME: (message: SendbirdMessage, locale?: Locale) =>
144144
getThreadParentMessageTimeFormat(new Date(message.createdAt), locale ?? dateLocale),
145-
REPLY_COUNT: (replyCount: number, minRepliesForPlusFormat?: number) =>
146-
getReplyCountFormat(replyCount, minRepliesForPlusFormat),
145+
REPLY_COUNT: (replyCount: number, maxReplyCount?: number) => getReplyCountFormat(replyCount, maxReplyCount),
147146

148147
MENTION_LIMITED: (mentionLimit) => `You can have up to ${mentionLimit} mentions per message.`,
149148
...overrides?.GROUP_CHANNEL_THREAD,

packages/uikit-utils/src/ui-format/common.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,11 @@ export const millsToMSS = (mills: number) => {
157157
* Message reply count format
158158
* If reply count is 1: 1 'reply'
159159
* If the reply count is greater than 1 : '{count} replies'
160+
* If the reply count is greater than {maxReplyCount} : '{maxReplyCount}+ replies'
160161
* */
161-
export const getReplyCountFormat = (replyCount: number, minRepliesForPlusFormat?: number) => {
162-
if (minRepliesForPlusFormat && replyCount > minRepliesForPlusFormat) {
163-
return `${minRepliesForPlusFormat}+ replies`;
162+
export const getReplyCountFormat = (replyCount: number, maxReplyCount?: number) => {
163+
if (maxReplyCount && replyCount > maxReplyCount) {
164+
return `${maxReplyCount}+ replies`;
164165
} else if (replyCount === 1) {
165166
return `${replyCount} reply`;
166167
} else if (replyCount > 1) {

0 commit comments

Comments
 (0)