Skip to content

Commit

Permalink
update screen selector text
Browse files Browse the repository at this point in the history
  • Loading branch information
ylduang committed Jun 13, 2022
1 parent 02ae5da commit f80749b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agora-mixstream",
"version": "0.0.1-alpha.10",
"version": "0.0.1-alpha.12",
"private": true,
"description": "混合流",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/mixstream-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mixstream-ui",
"version": "0.0.1-alpha.10",
"version": "0.0.1-alpha.12",
"private": true,
"main": "build/electron/main.js",
"description": "mix stream app",
Expand Down
23 changes: 17 additions & 6 deletions packages/mixstream-ui/src/components/ScreenSelector/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Modal } from 'antd';
import cls from 'classnames';
import { FC, useState } from 'react';
import { FC, useMemo, useState } from 'react';
import { AiFillInfoCircle } from 'react-icons/ai';
import { useIntl } from 'react-intl';
import { DisplayInfo, ShareScreenType, WindowInfo } from '../../engine';
import { isMacOS } from '../../utils';
import './index.css';

export interface ScreenSelectorHandler {
Expand Down Expand Up @@ -71,21 +72,31 @@ export const ScreenSelector: FC<ScreenSelectorProps> = (props) => {
}
};

const Tip = useMemo(() => {
return isMacOS() ? (
<div className="tip">
<AiFillInfoCircle className="icon" />
{intl.formatMessage({ id: `modal.screen.selector.tip` })}
</div>
) : (
''
);
}, [intl]);

return (
<Modal
wrapClassName="screen-selector"
title={intl.formatMessage({ id: `modal.screen.selector.title` })}
title={intl.formatMessage({
id: isMacOS() ? `modal.screen.selector.title.mac` : `modal.screen.selector.title.win`,
})}
okText={intl.formatMessage({ id: `modal.screen.selector.ok` })}
visible={visible}
onOk={handleOk}
okButtonProps={{ disabled: !selectedInfo }}
width={833}
onCancel={onCancel}
>
<div className="tip">
<AiFillInfoCircle className="icon" />
{intl.formatMessage({ id: `modal.screen.selector.tip` })}
</div>
{Tip}
<div className="list">
{displays.map((item, index) => {
const { id } = item.displayId;
Expand Down
3 changes: 2 additions & 1 deletion packages/mixstream-ui/src/i18n/enUS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const message = {
'modal.screen.selector.tip':
'Tip: Minimize window can be shared. Please add again after amplification minimize window screen sharing.',
'modal.screen.selector.resolution': 'Resolution',
'modal.screen.selector.title': 'Please select screen or window which you want to share.',
'modal.screen.selector.title.win': 'Please select screen which you want to share.',
'modal.screen.selector.title.mac': 'Please select screen or window which you want to share.',
'modal.screen.selector.ok': 'Share',
'modal.screen.selector.tab.display': 'Desktop',
'modal.screen.selector.tab.window': 'Windows',
Expand Down
3 changes: 2 additions & 1 deletion packages/mixstream-ui/src/i18n/zhCN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const message = {
'landing.validate.name.min': '昵称长度必须大于3个字符',
'landing.validate.role.required': '请选择角色',
'modal.screen.selector.tip': '温馨提示:最小化的窗口无法被共享,请放大最小化的窗口后,重新进行添加屏幕共享',
'modal.screen.selector.title': '请选择你想要共享的屏幕或窗口',
'modal.screen.selector.title.win': '请选择你想要共享的屏幕',
'modal.screen.selector.title.mac': '请选择你想要共享的屏幕或窗口',
'modal.screen.selector.resolution': '分辨率',
'modal.screen.selector.ok': '确认共享',
'modal.screen.selector.tab.display': '桌面',
Expand Down

0 comments on commit f80749b

Please sign in to comment.