forked from abner/for-legacy-web
feat: port DeleteMessage and Confirmation
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
} from "../../../../context/intermediate/Intermediate";
|
||||
|
||||
import { useClient } from "../../../../controllers/client/ClientController";
|
||||
import { modalController } from "../../../../controllers/modals/ModalController";
|
||||
import Tooltip from "../../../common/Tooltip";
|
||||
|
||||
interface Props {
|
||||
@@ -136,11 +137,10 @@ export const MessageOverlayBar = observer(({ message, queued }: Props) => {
|
||||
onClick={(e) =>
|
||||
e.shiftKey
|
||||
? message.delete()
|
||||
: openScreen({
|
||||
id: "special_prompt",
|
||||
: modalController.push({
|
||||
type: "delete_message",
|
||||
target: message,
|
||||
} as unknown as Screen)
|
||||
})
|
||||
}>
|
||||
<Trash size={18} color={"var(--error)"} />
|
||||
</Entry>
|
||||
|
||||
@@ -15,6 +15,7 @@ import { stopPropagation } from "../../../lib/stopPropagation";
|
||||
|
||||
import { useIntermediate } from "../../../context/intermediate/Intermediate";
|
||||
|
||||
import { modalController } from "../../../controllers/modals/ModalController";
|
||||
import ChannelIcon from "../../common/ChannelIcon";
|
||||
import Tooltip from "../../common/Tooltip";
|
||||
import UserIcon from "../../common/user/UserIcon";
|
||||
@@ -111,8 +112,7 @@ export const UserButton = observer((props: UserProps) => {
|
||||
className={styles.icon}
|
||||
onClick={(e) =>
|
||||
stopPropagation(e) &&
|
||||
openScreen({
|
||||
id: "special_prompt",
|
||||
modalController.push({
|
||||
type: "close_dm",
|
||||
target: channel,
|
||||
})
|
||||
@@ -195,8 +195,7 @@ export const ChannelButton = observer((props: ChannelProps) => {
|
||||
<IconButton
|
||||
className={styles.icon}
|
||||
onClick={() =>
|
||||
openScreen({
|
||||
id: "special_prompt",
|
||||
modalController.push({
|
||||
type: "leave_group",
|
||||
target: channel,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user