Add one tooltip.

This commit is contained in:
Yang Luo
2021-06-25 00:13:43 +08:00
parent 8b8eeea73d
commit 234a9b9060
4 changed files with 16 additions and 2 deletions

View File

@ -101,7 +101,7 @@ class ApplicationEditPage extends React.Component {
} style={{marginLeft: '5px'}} type="inner"> } style={{marginLeft: '5px'}} type="inner">
<Row style={{marginTop: '10px'}} > <Row style={{marginTop: '10px'}} >
<Col style={{marginTop: '5px'}} span={2}> <Col style={{marginTop: '5px'}} span={2}>
{i18next.t("general:Name")}: {Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} :
</Col> </Col>
<Col span={22} > <Col span={22} >
<Input value={this.state.application.name} onChange={e => { <Input value={this.state.application.name} onChange={e => {

View File

@ -12,7 +12,8 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import {message} from "antd"; import {message, Tooltip} from "antd";
import {QuestionCircleTwoTone} from "@ant-design/icons";
import React from "react"; import React from "react";
import {isMobile as isMobileDevice} from "react-device-detect"; import {isMobile as isMobileDevice} from "react-device-detect";
import "./i18n"; import "./i18n";
@ -408,3 +409,14 @@ export function renderHelmet(application) {
</Helmet> </Helmet>
) )
} }
export function getLabel(text, tooltip) {
return (
<React.Fragment>
<span style={{ marginRight: 4 }}>{text}</span>
<Tooltip placement="top" title={tooltip}>
<QuestionCircleTwoTone twoToneColor="rgb(45,120,213)" />
</Tooltip>
</React.Fragment>
);
}

View File

@ -18,6 +18,7 @@
"Organization": "Organization", "Organization": "Organization",
"Created time": "Created time", "Created time": "Created time",
"Name": "Name", "Name": "Name",
"Name - Tooltip": "Unique string-style identifier",
"Display name": "Display name", "Display name": "Display name",
"Personal name": "Personal name", "Personal name": "Personal name",
"Avatar": "Avatar", "Avatar": "Avatar",

View File

@ -18,6 +18,7 @@
"Organization": "组织", "Organization": "组织",
"Created time": "创建时间", "Created time": "创建时间",
"Name": "名称", "Name": "名称",
"Name - Tooltip": "唯一的、字符串式的ID",
"Display name": "显示名称", "Display name": "显示名称",
"Personal name": "姓名", "Personal name": "姓名",
"Avatar": "头像", "Avatar": "头像",