perf: optimize the display of global notifications and increase system notification prompts

and export `parseUrlStr`
feat/excalidraw
moonrailgun 2 years ago
parent a224ac602e
commit 7419df1775

@ -18,8 +18,8 @@ export const GlobalAnnouncementBar: React.FC = React.memo(() => {
} }
return ( return (
<div className="text-center bg-indigo-400 text-white relative"> <div className="text-center bg-indigo-400 text-white relative px-6">
{announcementInfo.text} <span className="select-text">{announcementInfo.text}</span>
{announcementInfo.link && ( {announcementInfo.link && (
<Button <Button

@ -70,6 +70,7 @@ export {
useConverseMessageContext, useConverseMessageContext,
loginWithToken, loginWithToken,
useWatch, useWatch,
parseUrlStr,
} from 'tailchat-shared'; } from 'tailchat-shared';
export { navigate } from '@/components/AppRouterApi'; export { navigate } from '@/components/AppRouterApi';

@ -82,6 +82,7 @@ export const i18n: TushanContextProps['i18n'] = {
}, },
'system-notify': { 'system-notify': {
create: 'Create System Notify', create: 'Create System Notify',
tip: 'The system notification will be sent to the corresponding user in the form of inbox',
title: 'Title', title: 'Title',
content: 'Content', content: 'Content',
scope: 'Notify Scope', scope: 'Notify Scope',
@ -259,6 +260,7 @@ export const i18n: TushanContextProps['i18n'] = {
}, },
'system-notify': { 'system-notify': {
create: '创建系统通知', create: '创建系统通知',
tip: '系统通知将会以收件箱的形式发送给对应的用户',
title: '标题', title: '标题',
content: '内容', content: '内容',
scope: '通知范围', scope: '通知范围',

@ -215,7 +215,7 @@ export const SystemConfig: React.FC = React.memo(() => {
<SwitchFormInput /> <SwitchFormInput />
</Form.Item> </Form.Item>
<Form.Item label={t('custom.config.announcementText')} field="text"> <Form.Item label={t('custom.config.announcementText')} field="text">
<Input maxLength={120} /> <Input maxLength={240} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={t('custom.config.announcementLink')} label={t('custom.config.announcementLink')}

@ -44,6 +44,12 @@ export const SystemNotify: React.FC = React.memo(() => {
<Typography.Title heading={3} style={{ textAlign: 'center' }}> <Typography.Title heading={3} style={{ textAlign: 'center' }}>
{t('custom.system-notify.create')} {t('custom.system-notify.create')}
</Typography.Title> </Typography.Title>
<Typography.Title
heading={6}
style={{ textAlign: 'center', color: '#666' }}
>
{t('custom.system-notify.tip')}
</Typography.Title>
<Form form={form} onSubmit={handleSubmit}> <Form form={form} onSubmit={handleSubmit}>
<Form.Item label={t('custom.system-notify.title')} field="title"> <Form.Item label={t('custom.system-notify.title')} field="title">

Loading…
Cancel
Save