Skip to content

Commit 086e578

Browse files
committed
Merge branch 'develop' of github.com:nccasia/mezon-fe into fix-typo
2 parents a0c72b7 + 0374f01 commit 086e578

File tree

48 files changed

+496
-473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+496
-473
lines changed

apps/admin/src/app/pages/installation/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useParams } from 'react-router-dom';
33

44
const Installation = () => {
55
const { applicationId } = useParams();
6-
const linkInstall = window.location.origin + '/install/' + applicationId;
6+
const linkInstall = window.location.origin + '/developers/install/' + applicationId;
77
const handleCopyToClipboard = () => {
88
copy(linkInstall);
99
};

apps/admin/tailwind.config.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ module.exports = {
6868
"9/10": "90%",
6969
},
7070
height: {
71-
heightMessageViewChat: `calc(100vh - ${topBarHeight} - ${chatBoxHeight})`,
72-
heightMessageViewChatMobile: `calc(100vh - ${chatBoxHeight})`,
73-
heightMessageViewChatDM: `calc(100vh - ${topBarHeight})`,
74-
heightMessageViewChatThread: `calc(100vh - ${topBarHeight} - ${chatBoxHeightThread})`,
75-
heightWithoutTopBar: `calc(100vh - ${topBarHeight})`,
76-
heightWithoutTopBarMobile: `calc(100vh)`,
71+
heightMessageViewChat: `calc(100dvh - ${topBarHeight} - ${chatBoxHeight})`,
72+
heightMessageViewChatMobile: `calc(100dvh - ${chatBoxHeight})`,
73+
heightMessageViewChatDM: `calc(100dvh - ${topBarHeight})`,
74+
heightMessageViewChatThread: `calc(100dvh - ${topBarHeight} - ${chatBoxHeightThread})`,
75+
heightWithoutTopBar: `calc(100dvh - ${topBarHeight})`,
76+
heightWithoutTopBarMobile: `calc(100dvh)`,
7777
heightTopBar: topBarHeight,
7878
heightChatBox: chatBoxHeight,
7979
heightModalSearch: heightModalSearch,
@@ -92,9 +92,9 @@ module.exports = {
9292
maxHeight: {
9393
'4/5': '80%',
9494
'9/10': "90%",
95-
heightInBox: `calc(100vh - 168px)`,
96-
messageViewChatDM: `calc(100vh - 60px)`,
97-
listMemberRole: `calc(100vh - 225px)`,
95+
heightInBox: `calc(100dvh - 168px)`,
96+
messageViewChatDM: `calc(100dvh - 60px)`,
97+
listMemberRole: `calc(100dvh - 225px)`,
9898
},
9999

100100
minHeight: {

apps/chat/.env.prod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ NX_CHAT_APP_API_TENOR_URL_SEARCH=https://tenor.googleapis.com/v2/search?q=
33
NX_CHAT_APP_API_TENOR_URL_FEATURED=https://tenor.googleapis.com/v2/featured?key=
44

55
NX_MAX_LENGTH_NAME_ALLOWED=64
6-
NX_LOGO_MEZON=https://cdn.mezon.vn/images/mezon_logo.png
7-
NX_BASE_IMG_URL=https://cdn.mezon.vn/
6+
NX_LOGO_MEZON=https://cdn.mezon.ai/images/mezon_logo.png
7+
NX_BASE_IMG_URL=https://cdn.mezon.ai/

apps/chat/src/app/layouts/ClanLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const ClanLayout = () => {
115115
return (
116116
<>
117117
<div
118-
className={`select-none flex-col flex max-w-[272px] dark:bg-bgSecondary bg-bgLightSecondary relative overflow-hidden min-w-widthMenuMobile sbm:min-w-[272px] ${isWindowsDesktop || isLinuxDesktop ? 'max-h-heightTitleBar h-heightTitleBar' : ''} ${closeMenu ? (statusMenu ? 'flex' : 'hidden') : ''}`}
118+
className={`select-none h-dvh flex-col flex max-w-[272px] dark:bg-bgSecondary bg-bgLightSecondary relative overflow-hidden min-w-widthMenuMobile sbm:min-w-[272px] ${isWindowsDesktop || isLinuxDesktop ? 'max-h-heightTitleBar h-heightTitleBar' : ''} ${closeMenu ? (statusMenu ? 'flex' : 'hidden') : ''}`}
119119
>
120120
<ClanHeader name={currentClan?.clan_name} type="CHANNEL" bannerImage={currentClan?.banner} />
121121
<ChannelList />

apps/chat/src/app/pages/directMessage/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const Direct = () => {
3838
return (
3939
<>
4040
<div
41-
className={`flex-col flex w-[272px] dark:bg-bgSecondary bg-bgLightMode relative min-w-widthMenuMobile ${isWindowsDesktop || isLinuxDesktop ? 'max-h-heightTitleBar h-heightTitleBar' : ''} sbm:min-w-[272px] ${closeMenu ? (statusMenu ? 'flex' : 'hidden') : ''}`}
41+
className={`flex-col flex w-[272px] dark:bg-bgSecondary bg-bgLightMode relative min-w-widthMenuMobile ${isWindowsDesktop || isLinuxDesktop ? 'max-h-heightTitleBar h-heightTitleBar' : ''} sbm:min-w-[272px] ${closeMenu ? (statusMenu ? 'flex' : 'max-sm:hidden') : ''}`}
4242
>
4343
<div className="contain-content">
4444
<ClanHeader type={'direct'} />

apps/chat/src/app/pages/main/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ const SidebarMenu = memo(
421421
}, [listUnreadDM]);
422422
return (
423423
<div
424-
className={`contain-strict h-dvh fixed z-10 left-0 top-0 w-[72px] dark:bg-bgTertiary bg-bgLightTertiary duration-100 ${isWindowsDesktop || isLinuxDesktop ? 'mt-[21px]' : ''} ${isMacDesktop ? 'pt-[18px]' : ''} ${closeMenu ? (statusMenu ? '' : 'hidden') : ''}`}
424+
className={`contain-strict h-dvh fixed z-10 left-0 top-0 w-[72px] dark:bg-bgTertiary bg-bgLightTertiary duration-100 ${isWindowsDesktop || isLinuxDesktop ? 'mt-[21px]' : ''} ${isMacDesktop ? 'pt-[18px]' : ''} ${closeMenu ? (statusMenu ? '' : 'max-sm:hidden') : ''}`}
425425
onClick={() => handleMenu}
426426
id="menu"
427427
>

apps/chat/tailwind.config.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ const heightModalSearch = '300px';
1515
const dmProfileWidth = '340px'
1616
const iconWidth = '160px';
1717
const titleBarHeight = '21px';
18-
const heightMessageViewChat = `calc(100vh - 10px - ${topBarHeight} - ${chatBoxHeight})`;
19-
const heightMessageViewChatMobile = `calc(100vh - 10px - ${chatBoxHeight})`;
20-
const heightMessageViewChatDM = `calc(100vh - 60px - ${topBarHeight})`;
21-
const heightMessageViewChatThread = `calc(100vh - 10px - ${topBarHeight} - ${chatBoxHeightThread})`;
22-
const heightWithoutTopBar = `calc(100vh - ${topBarHeight})`;
23-
const heightWithoutTopBarMobile = `calc(100vh)`;
18+
const heightMessageViewChat = `calc(100dvh - 10px - ${topBarHeight} - ${chatBoxHeight})`;
19+
const heightMessageViewChatMobile = `calc(100dvh - 10px - ${chatBoxHeight})`;
20+
const heightMessageViewChatDM = `calc(100dvh - 60px - ${topBarHeight})`;
21+
const heightMessageViewChatThread = `calc(100dvh - 10px - ${topBarHeight} - ${chatBoxHeightThread})`;
22+
const heightWithoutTopBar = `calc(100dvh - ${topBarHeight})`;
23+
const heightWithoutTopBarMobile = `calc(100dvh)`;
2424
const heightCallDm = `calc(100% - 240px)`;
25-
const messageViewChatDM = `calc(100vh - 60px)`;
25+
const messageViewChatDM = `calc(100dvh - 60px)`;
2626

2727
const plugin = require('tailwindcss/plugin');
2828

@@ -97,7 +97,7 @@ module.exports = {
9797
heightModalSearch: heightModalSearch,
9898
heightHeader: "60px",
9999
"9/10": "90%",
100-
heightTitleBar: `calc(100vh - ${titleBarHeight})`,
100+
heightTitleBar: `calc(100dvh - ${titleBarHeight})`,
101101
heightTitleBarMessageViewChat: `calc(${heightMessageViewChat} - ${titleBarHeight})`,
102102
heightTitleBarMessageViewChatMobile: `calc(${heightMessageViewChatMobile} - ${titleBarHeight})`,
103103
heightTitleBarMessageViewChatDM: `calc(${heightMessageViewChatDM} - ${titleBarHeight})`,
@@ -117,10 +117,10 @@ module.exports = {
117117
maxHeight: {
118118
'4/5': '80%',
119119
'9/10': "90%",
120-
heightInBox: `calc(100vh - 168px)`,
120+
heightInBox: `calc(100dvh - 168px)`,
121121
messageViewChatDM: messageViewChatDM,
122122
titleBarMessageViewChatDM: `calc(${messageViewChatDM} - ${titleBarHeight})`,
123-
listMemberRole: `calc(100vh - 225px)`,
123+
listMemberRole: `calc(100dvh - 225px)`,
124124
"50vh": "50vh"
125125
},
126126

apps/desktop/src/app/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ export default class App {
6767
}
6868

6969
autoUpdater.checkForUpdates();
70-
const sixHoursInMilliseconds = 6 * 60 * 60 * 1000;
70+
const updateCheckTimeInMilliseconds = 60 * 60 * 1000;
7171
setInterval(() => {
7272
autoUpdater.checkForUpdates();
73-
}, sixHoursInMilliseconds);
73+
}, updateCheckTimeInMilliseconds);
7474
}
7575

7676
private static onActivate() {

apps/mobile/src/app/components/BottomSheetRootListener/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { BottomSheetScrollView, BottomSheetModal as OriginalBottomSheet } from '
22
import { ActionEmitEvent } from '@mezon/mobile-components';
33
import { useTheme } from '@mezon/mobile-ui';
44
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
5-
import { DeviceEventEmitter, Text, View } from 'react-native';
5+
import { DeviceEventEmitter, Keyboard, Text, View } from 'react-native';
66
import Backdrop from '../../componentUI/MezonBottomSheet/backdrop';
77
import { style } from '../../componentUI/MezonBottomSheet/styles';
88
import useTabletLandscape from '../../hooks/useTabletLandscape';
@@ -87,6 +87,7 @@ const BottomSheetRootListener = () => {
8787
if (isDismiss) {
8888
onCloseBottomSheet();
8989
} else {
90+
Keyboard.dismiss();
9091
onTriggerBottomSheet(data);
9192
}
9293
});

apps/mobile/src/app/components/ImageListModal/ImageListModal.tsx

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { ActionEmitEvent } from '@mezon/mobile-components';
12
import { Colors, size, Text } from '@mezon/mobile-ui';
23
import { AttachmentEntity, selectAllListAttachmentByChannel } from '@mezon/store-mobile';
34
import { Snowflake } from '@theinternetfolks/snowflake';
45
import { ApiMessageAttachment } from 'mezon-js/api.gen';
56
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
67
import { useTranslation } from 'react-i18next';
7-
import { Modal, View } from 'react-native';
8+
import { DeviceEventEmitter, View } from 'react-native';
89
import Gallery, { GalleryRef, RenderItemInfo } from 'react-native-awesome-gallery';
910
import { useSelector } from 'react-redux';
1011
import { useThrottledCallback } from 'use-debounce';
@@ -14,8 +15,6 @@ import { RenderFooterModal } from './RenderFooterModal';
1415
import { RenderHeaderModal } from './RenderHeaderModal';
1516

1617
interface IImageListModalProps {
17-
visible?: boolean;
18-
onClose?: () => void;
1918
imageSelected?: AttachmentEntity;
2019
channelId: string;
2120
}
@@ -29,14 +28,14 @@ const TIME_TO_HIDE_THUMBNAIL = 5000;
2928
const TIME_TO_SHOW_SAVE_IMAGE_SUCCESS = 3000;
3029

3130
export const ImageListModal = React.memo((props: IImageListModalProps) => {
32-
const { visible, onClose, imageSelected } = props;
31+
const { imageSelected, channelId } = props;
3332
const { t } = useTranslation('common');
3433
const [currentImage, setCurrentImage] = useState<AttachmentEntity | null>(null);
3534
const [visibleToolbarConfig, setVisibleToolbarConfig] = useState<IVisibleToolbarConfig>({ showHeader: true, showFooter: false });
3635
const [currentScale, setCurrentScale] = useState(1);
3736
const [showSavedImage, setShowSavedImage] = useState(false);
3837
const [isLoadingSaveImage, setIsLoadingSaveImage] = useState(false);
39-
const attachments = useSelector((state) => selectAllListAttachmentByChannel(state, props.channelId));
38+
const attachments = useSelector((state) => selectAllListAttachmentByChannel(state, channelId));
4039
const ref = useRef<GalleryRef>(null);
4140
const footerTimeoutRef = useRef<NodeJS.Timeout>(null);
4241
const imageSavedTimeoutRef = useRef<NodeJS.Timeout>(null);
@@ -63,6 +62,10 @@ export const ImageListModal = React.memo((props: IImageListModalProps) => {
6362
: [];
6463
}, [attachments, imageSelected]);
6564

65+
const onClose = () => {
66+
DeviceEventEmitter.emit(ActionEmitEvent.ON_TRIGGER_MODAL, { isDismiss: true });
67+
};
68+
6669
const updateToolbarConfig = useCallback(
6770
(newValue: Partial<IVisibleToolbarConfig>) => {
6871
setVisibleToolbarConfig({ ...visibleToolbarConfig, ...newValue });
@@ -168,39 +171,37 @@ export const ImageListModal = React.memo((props: IImageListModalProps) => {
168171
const setScaleDebounced = useThrottledCallback(setCurrentScale, 300);
169172

170173
return (
171-
<Modal visible={visible}>
172-
<View style={{ flex: 1 }}>
173-
{visibleToolbarConfig.showHeader && (
174-
<RenderHeaderModal onClose={onClose} imageSelected={currentImage} onImageSaved={onImageSaved} onLoading={onLoading} />
175-
)}
176-
<Gallery
177-
ref={ref}
178-
initialIndex={initialIndex === -1 ? 0 : initialIndex}
179-
data={formattedImageList}
180-
keyExtractor={(item, index) => `${item?.filename}_${index}`}
181-
onSwipeToClose={onClose}
182-
onIndexChange={onIndexChange}
183-
renderItem={renderItem}
184-
onDoubleTap={onDoubleTap}
185-
onTap={onTap}
186-
onPanStart={onPanStart}
187-
onScaleChange={setScaleDebounced}
188-
/>
189-
<RenderFooterModal
190-
allImageList={formattedImageList}
191-
visible={visibleToolbarConfig.showFooter}
192-
imageSelected={currentImage}
193-
onImageThumbnailChange={onImageThumbnailChange}
194-
/>
195-
{showSavedImage && (
196-
<View style={{ position: 'absolute', top: '50%', width: '100%', alignItems: 'center' }}>
197-
<View style={{ backgroundColor: Colors.bgDarkSlate, padding: size.s_10, borderRadius: size.s_10 }}>
198-
<Text style={{ color: Colors.white }}>{t('savedSuccessfully')}</Text>
199-
</View>
174+
<View style={{ flex: 1 }}>
175+
{visibleToolbarConfig.showHeader && (
176+
<RenderHeaderModal onClose={onClose} imageSelected={currentImage} onImageSaved={onImageSaved} onLoading={onLoading} />
177+
)}
178+
<Gallery
179+
ref={ref}
180+
initialIndex={initialIndex === -1 ? 0 : initialIndex}
181+
data={formattedImageList}
182+
keyExtractor={(item, index) => `${item?.filename}_${index}`}
183+
onSwipeToClose={onClose}
184+
onIndexChange={onIndexChange}
185+
renderItem={renderItem}
186+
onDoubleTap={onDoubleTap}
187+
onTap={onTap}
188+
onPanStart={onPanStart}
189+
onScaleChange={setScaleDebounced}
190+
/>
191+
<RenderFooterModal
192+
allImageList={formattedImageList}
193+
visible={visibleToolbarConfig.showFooter}
194+
imageSelected={currentImage}
195+
onImageThumbnailChange={onImageThumbnailChange}
196+
/>
197+
{showSavedImage && (
198+
<View style={{ position: 'absolute', top: '50%', width: '100%', alignItems: 'center' }}>
199+
<View style={{ backgroundColor: Colors.bgDarkSlate, padding: size.s_10, borderRadius: size.s_10 }}>
200+
<Text style={{ color: Colors.white }}>{t('savedSuccessfully')}</Text>
200201
</View>
201-
)}
202-
</View>
202+
</View>
203+
)}
203204
<LoadingModal isVisible={isLoadingSaveImage} />
204-
</Modal>
205+
</View>
205206
);
206207
});

0 commit comments

Comments
 (0)