Skip to content

Commit fa5971b

Browse files
committed
Merge branch 'develop' of https://github.com/mezonai/mezon into fix-channel-list
2 parents 03b0ebe + cf9f334 commit fa5971b

99 files changed

Lines changed: 1601 additions & 779 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
## The Live, Work, and Play Platform the best Discord Alternative
3030

31-
Mezon is great for playing games and chilling with friends, or even building a worldwide community. Customize your own space to talk, play, and hang out., Mezon delivers enterprise-grade performance with sub-millisecond response times and support for millions of concurrent connections.
31+
Mezon is a Live, Work, and Play platform. It’s perfect for gaming and chilling with friends, or even building a global community. Customize your own space to talk, play, and hang out. Mezon also delivers enterprise-grade performance with sub-millisecond response times and support for millions of concurrent connections.
3232

3333
<div align="center">
3434
<img src="docs/mezon_header_bot_battle.png" alt="Mezon Platform Overview" width="100%">

apps/chat/src/app/app.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ import { preloadedState } from './mock/state';
4646
import { Routes } from './routes';
4747

4848
import { ThemeManager } from '@mezon/themes';
49+
import { LogLevel, setLogLevel } from 'livekit-client';
50+
51+
setLogLevel(LogLevel.silent);
4952

5053
ThemeManager.initializeTheme();
5154

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

Lines changed: 363 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const ChannelMainContentText = ({ channelId, canSendMessage }: ChannelMainConten
163163
? ChannelStreamMode.STREAM_MODE_CHANNEL
164164
: ChannelStreamMode.STREAM_MODE_THREAD;
165165

166-
const [canSendMessageDelayed, setCanSendMessageDelayed] = useState<boolean | null>(null);
166+
const [canSendMessageDelayed, setCanSendMessageDelayed] = useState<boolean>(false);
167167
const isAppChannel = currentChannel?.type === ChannelType.CHANNEL_TYPE_APP;
168168

169169
const currentClanId = useSelector(selectCurrentClanId);
@@ -205,14 +205,6 @@ const ChannelMainContentText = ({ channelId, canSendMessage }: ChannelMainConten
205205
return selectUserProcessing?.onboarding_step !== DONE_ONBOARDING_STATUS && currentClanIsOnboarding;
206206
}, [selectUserProcessing?.onboarding_step, currentClanIsOnboarding, previewMode, currentClanId]);
207207
const isBanned = useAppSelector((state) => selectBanMeInChannel(state, currentChannel.id));
208-
if (canSendMessageDelayed === null) {
209-
return (
210-
<div
211-
className="h-11 opacity-80 bg-theme-input text-theme-primary ml-4 mb-4 py-2 pl-2 w-widthInputViewChannelPermission rounded one-line"
212-
data-e2e={generateE2eId('chat.message_box.input.no_permission')}
213-
></div>
214-
);
215-
}
216208
if (!canSendMessageDelayed) {
217209
return (
218210
<div

apps/chat/src/app/pages/homepage/mezonpage/footer/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ const Footer = ({ downloadUrl, universalUrl }: FooterProps) => {
107107
<h3 className="font-semibold text-xs md:text-md uppercase tracking-wider mb-4 md:mb-5 text-white">Company</h3>
108108
<div className="space-y-2 md:space-y-3">
109109
<a
110-
href="https://mezon.ai/blogs/mediakit"
110+
href="brand-center"
111111
target="_blank"
112112
rel="noreferrer"
113113
className="text-white/90 hover:text-white transition-colors text-xs md:text-sm leading-relaxed block"
114114
>
115-
Media Kit
115+
Brand Center
116116
</a>
117117
<a
118118
href="/contact-us"

apps/chat/src/app/pages/homepage/mezonpage/sections/AiAgentSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const AiAgentSection = () => {
4646
className={`absolute inset-0 bg-gradient-to-br from-[#8661df] to-[#7979ed] rounded-2xl transition-opacity duration-300 ${imageLoaded ? 'opacity-0' : 'opacity-100'}`}
4747
/>
4848
<img
49-
src="https://cdn.mezon.ai/landing-page-mezon/ai-agentnew.webp"
49+
src="https://cdn.mezon.ai/landing-page-mezon/section-aiagent.webp"
5050
alt="Engage"
5151
className="max-w-[68vw] lg:max-w-[35vw] object-contain drop-shadow-2xl rounded-2xl relative z-10"
5252
loading="lazy"

apps/chat/src/app/pages/login/FormLoginOTP.tsx

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,21 @@ const FormLoginOTP = ({ handleChangeMethod, onStepChange }: { handleChangeMethod
4848
setOtp(e);
4949
};
5050

51-
const handleEmailChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
52-
const value = e.target.value;
53-
setEmail(value);
54-
setOtp(Array(6).fill(''));
55-
setErrors((prev) => ({
56-
...prev,
57-
email: validateEmail(value)
58-
}));
59-
}, []);
51+
const handleEmailChange = useCallback(
52+
(e: React.ChangeEvent<HTMLInputElement>) => {
53+
if (step) {
54+
return;
55+
}
56+
const value = e.target.value;
57+
setEmail(value);
58+
setOtp(Array(6).fill(''));
59+
setErrors((prev) => ({
60+
...prev,
61+
email: validateEmail(value)
62+
}));
63+
},
64+
[step]
65+
);
6066

6167
useEffect(() => {
6268
if (!reqId) return;
@@ -105,7 +111,7 @@ const FormLoginOTP = ({ handleChangeMethod, onStepChange }: { handleChangeMethod
105111
</div>
106112
)}
107113

108-
<div className="flex overflow-hidden items-center gap-2">
114+
<div className="flex overflow-hidden items-center gap-3">
109115
<div className={`flex flex-col w-full shrink-0 ${step === null ? '' : step ? 'animate-login_otp' : 'animate-login_email'}`}>
110116
<div className="flex flex-col gap-2">
111117
<label htmlFor="email" className="block text-sm font-medium text-black dark:text-gray-300 leading-10 ml-2 ">
@@ -125,17 +131,17 @@ const FormLoginOTP = ({ handleChangeMethod, onStepChange }: { handleChangeMethod
125131
{errors.email && <FormError message={errors.email} />}
126132
</div>
127133
<div className={`flex flex-col w-full shrink-0 ${step === null ? 'hidden' : step ? 'animate-login_otp' : 'animate-login_email'}`}>
128-
<p className="text-sm text-gray-700 dark:text-gray-300 text-center mb-4">
134+
<p className="text-sm text-gray-700 dark:text-gray-300 text-center mb-6">
129135
{t('login.otpSentMessage', {
130136
email: email.replace(/^(.{3})(.*)(@.*)$/, (_, p1, p2, p3) => `${p1}${'*'.repeat(p2.length)}${p3}`)
131137
})}
132138
</p>
133139
<div className={`flex flex-col gap-2`}>
134-
<OtpConfirm otp={otp} handleSetOTP={handleSetOTP} />
140+
<OtpConfirm otp={otp} handleSetOTP={handleSetOTP} className="pr-[5px]" />
135141
</div>
136142
</div>
137143
</div>
138-
<div className="p-1 mt-2">
144+
<div className="p-1 mt-3">
139145
<ButtonLoading
140146
className="w-full h-10 btn-primary btn-primary-hover"
141147
disabled={!step ? !!errors.email || (step === null && errors.email === undefined) || disabled : disabled || count > 0}

apps/chat/src/app/routes/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const InvitePage = lazy(() => import(/* webpackChunkName: "invite-pages" */ '../
5454
const TextChannelPage = lazy(() => import(/* webpackChunkName: "textchannel-page" */ '../pages/textchannel'));
5555
const TermOfServivePage = lazy(() => import(/* webpackChunkName: "termofservice-page" */ '../pages/termofservices'));
5656
const PrivacyMezonPage = lazy(() => import(/* webpackChunkName: "privacymetzon-page" */ '../pages/privacymezon'));
57+
const BrandCenterPage = lazy(() => import(/* webpackChunkName: "brandcenter-page" */ '../pages/brandcenter'));
5758
const ContactUsPage = lazy(() => import(/* webpackChunkName: "contactus-page" */ '../pages/contactus'));
5859
const MezonDongPage = lazy(() => import(/* webpackChunkName: "textchannel-page" */ '../pages/mezondong'));
5960
const IntegrationsPage = lazy(() => import(/* webpackChunkName: "integrations-page" */ '../pages/integrations'));
@@ -245,6 +246,14 @@ export const Routes = memo(() => {
245246
</Suspense>
246247
)
247248
},
249+
{
250+
path: '/brand-center',
251+
element: (
252+
<Suspense fallback={<SuspenseFallback />}>
253+
<BrandCenterPage />
254+
</Suspense>
255+
)
256+
},
248257
{
249258
path: '/mezondong',
250259
element: (

apps/desktop/src/app/utils/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ export function sanitizeUrl(url: string): string {
8080
if (parsed.protocol === 'data:' && !encodedUrl.startsWith('data:image/')) {
8181
return '';
8282
}
83-
return encodedUrl;
83+
84+
return encodedUrl.replace(/"/g, '&quot;').replace(/'/g, '&#039;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
8485
} catch (e) {
8586
return '';
8687
}

apps/desktop/src/assets/image-window/image-window-css.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,69 @@ width : 0 !important;
389389
opacity: 1;
390390
}
391391
392+
.skeleton {
393+
animation: skeleton-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
394+
border-radius: 6px;
395+
}
396+
397+
@keyframes skeleton-pulse {
398+
0%, 100% {
399+
opacity: 1;
400+
}
401+
50% {
402+
opacity: 0.5;
403+
}
404+
}
405+
406+
.skeleton-main {
407+
position: absolute;
408+
z-index: 1;
409+
display: none;
410+
opacity: 0;
411+
transition: opacity 0.3s ease-in-out;
412+
background-color: #2e2e2e;
413+
border-radius: 10px;
414+
align-items: center;
415+
justify-content: center;
416+
}
417+
418+
.skeleton-main.visible {
419+
display: flex;
420+
opacity: 1;
421+
}
422+
423+
.skeleton-icon {
424+
width: 64px;
425+
height: 64px;
426+
color: #4a4a4a;
427+
}
428+
429+
.skeleton-thumbnail {
430+
width: 88px;
431+
height: 88px;
432+
position: absolute;
433+
top: 0;
434+
left: 0;
435+
display: flex;
436+
align-items: center;
437+
justify-content: center;
438+
background-color: #2e2e2e;
439+
}
440+
441+
.skeleton-thumbnail .skeleton-icon {
442+
width: 32px;
443+
height: 32px;
444+
}
445+
446+
.image-loading {
447+
opacity: 0;
448+
transition: opacity 0.3s ease-in-out;
449+
}
450+
451+
.image-loaded {
452+
opacity: 1;
453+
}
454+
392455
393456
`;
394457
export default image_window_css;

0 commit comments

Comments
 (0)