mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-10 01:03:36 -05:00
Fix and prettier incoming changes from PR #119.
Cherry pick PR #130: don't show add friend button on banned / deleted accounts. Also account for this in context menu.
This commit is contained in:
parent
a08ad7aa0b
commit
a1cb72046c
3 changed files with 34 additions and 14 deletions
|
@ -196,6 +196,8 @@ export const UserProfile = observer(
|
|||
</IconButton>
|
||||
)}
|
||||
{!user.bot &&
|
||||
flags != 2 &&
|
||||
flags != 4 &&
|
||||
(user.relationship ===
|
||||
RelationshipStatus.Incoming ||
|
||||
user.relationship ===
|
||||
|
@ -315,9 +317,13 @@ export const UserProfile = observer(
|
|||
content={
|
||||
<Text id="app.special.popovers.user_profile.badges.translator" />
|
||||
}>
|
||||
<img src="/assets/badges/translator.svg"
|
||||
<img
|
||||
src="/assets/badges/translator.svg"
|
||||
onClick={() => {
|
||||
window.open("https://weblate.insrt.uk/projects/revolt/web-app/", "_blank")
|
||||
window.open(
|
||||
"https://weblate.insrt.uk/projects/revolt/web-app/",
|
||||
"_blank",
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</Tooltip>
|
||||
|
@ -343,7 +349,10 @@ export const UserProfile = observer(
|
|||
size={32}
|
||||
color="#efab44"
|
||||
onClick={() => {
|
||||
window.open("https://insrt.uk/donate", "_blank")
|
||||
window.open(
|
||||
"https://insrt.uk/donate",
|
||||
"_blank",
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</Tooltip>
|
||||
|
|
|
@ -619,8 +619,15 @@ function ContextMenus(props: Props) {
|
|||
break;
|
||||
case RelationshipStatus.None:
|
||||
default:
|
||||
if (
|
||||
(user.flags && 2) ||
|
||||
(user.flags && 4)
|
||||
) {
|
||||
actions = ["block_user"];
|
||||
} else {
|
||||
actions = ["add_friend", "block_user"];
|
||||
}
|
||||
}
|
||||
|
||||
if (userPermissions & UserPermission.ViewProfile) {
|
||||
generateAction({
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
import { Form } from "./Form";
|
||||
import { detect } from "detect-browser";
|
||||
import { useHistory } from "react-router-dom";
|
||||
|
||||
import { useContext } from "preact/hooks";
|
||||
|
||||
import { OperationsContext } from "../../../context/revoltjs/RevoltClient";
|
||||
|
||||
import { Form } from "./Form";
|
||||
|
||||
export function FormLogin() {
|
||||
const { login } = useContext(OperationsContext);
|
||||
const history = useHistory();
|
||||
|
@ -10,7 +14,7 @@ export function FormLogin() {
|
|||
return (
|
||||
<Form
|
||||
page="login"
|
||||
callback={async data => {
|
||||
callback={async (data) => {
|
||||
const browser = detect();
|
||||
let device_name;
|
||||
if (browser) {
|
||||
|
|
Loading…
Reference in a new issue