mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-05 05:50:19 +08:00
fix: the link button with disabled style but can click (#1390)
This commit is contained in:
@ -14,7 +14,7 @@
|
||||
|
||||
import React from "react";
|
||||
import * as Setting from "./Setting";
|
||||
import {Dropdown, Menu} from "antd";
|
||||
import {Dropdown} from "antd";
|
||||
import "./App.less";
|
||||
|
||||
function flagIcon(country, alt) {
|
||||
@ -53,15 +53,12 @@ class SelectLanguageBox extends React.Component {
|
||||
|
||||
render() {
|
||||
const languageItems = this.getOrganizationLanguages(this.state.languages);
|
||||
const menu = (
|
||||
<Menu items={languageItems} onClick={(e) => {
|
||||
Setting.setLanguage(e.key);
|
||||
}}>
|
||||
</Menu>
|
||||
);
|
||||
const onClick = (e) => {
|
||||
Setting.setLanguage(e.key);
|
||||
};
|
||||
|
||||
return (
|
||||
<Dropdown overlay={menu} >
|
||||
<Dropdown menu={{items: languageItems, onClick}} >
|
||||
<div className="language-box" style={{display: languageItems.length === 0 ? "none" : null, ...this.props.style}} />
|
||||
</Dropdown>
|
||||
);
|
||||
|
@ -164,7 +164,7 @@ class OAuthWidget extends React.Component {
|
||||
</span>
|
||||
{
|
||||
linkedValue === "" ? (
|
||||
<a key={provider.displayName} href={Provider.getAuthUrl(application, provider, "link")}>
|
||||
<a key={provider.displayName} href={user.id !== account.id ? null : Provider.getAuthUrl(application, provider, "link")}>
|
||||
<Button style={{marginLeft: "20px", width: "80px"}} type="primary" disabled={user.id !== account.id}>{i18next.t("user:Link")}</Button>
|
||||
</a>
|
||||
) : (
|
||||
|
Reference in New Issue
Block a user