mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-08 01:45:28 +00:00
feat: port DeleteMessage and Confirmation
This commit is contained in:
@@ -20,6 +20,7 @@ import { useIntermediate } from "../../context/intermediate/Intermediate";
|
||||
import ButtonItem from "../../components/navigation/items/ButtonItem";
|
||||
import { useClient } from "../../controllers/client/ClientController";
|
||||
import RequiresOnline from "../../controllers/client/jsx/RequiresOnline";
|
||||
import { modalController } from "../../controllers/modals/ModalController";
|
||||
import { GenericSettings } from "./GenericSettings";
|
||||
import { Bans } from "./server/Bans";
|
||||
import { Categories } from "./server/Categories";
|
||||
@@ -132,8 +133,7 @@ export default observer(() => {
|
||||
<LineDivider />
|
||||
<ButtonItem
|
||||
onClick={() =>
|
||||
openScreen({
|
||||
id: "special_prompt",
|
||||
modalController.push({
|
||||
type: "delete_server",
|
||||
target: server,
|
||||
})
|
||||
|
||||
@@ -218,8 +218,8 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
|
||||
target={user}
|
||||
size={42}
|
||||
onClick={() =>
|
||||
openScreen({
|
||||
id: "profile",
|
||||
modalController.push({
|
||||
type: "user_profile",
|
||||
user_id: user._id,
|
||||
})
|
||||
}
|
||||
@@ -460,8 +460,7 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
|
||||
palette="error"
|
||||
onClick={async () => {
|
||||
setSaving(true);
|
||||
openScreen({
|
||||
id: "special_prompt",
|
||||
modalController.push({
|
||||
type: "delete_bot",
|
||||
target: bot._id,
|
||||
name: user.username,
|
||||
@@ -508,16 +507,14 @@ export const MyBots = observer(() => {
|
||||
// eslint-disable-next-line
|
||||
}, []);
|
||||
|
||||
const { openScreen } = useIntermediate();
|
||||
|
||||
return (
|
||||
<div className={styles.myBots}>
|
||||
<CategoryButton
|
||||
account
|
||||
icon={<Plus size={24} />}
|
||||
onClick={() =>
|
||||
openScreen({
|
||||
id: "create_bot",
|
||||
modalController.push({
|
||||
type: "create_bot",
|
||||
onCreate: (bot) => setBots([...(bots ?? []), bot]),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import { noop } from "../../../lib/js";
|
||||
import { useIntermediate } from "../../../context/intermediate/Intermediate";
|
||||
|
||||
import ChannelIcon from "../../../components/common/ChannelIcon";
|
||||
import { modalController } from "../../../controllers/modals/ModalController";
|
||||
|
||||
const KanbanEntry = styled.div`
|
||||
padding: 2px 4px;
|
||||
@@ -449,8 +450,7 @@ function ListElement({
|
||||
</Droppable>
|
||||
<KanbanListHeader
|
||||
onClick={() =>
|
||||
openScreen({
|
||||
id: "special_prompt",
|
||||
modalController.push({
|
||||
type: "create_channel",
|
||||
target: server,
|
||||
cb: addChannel,
|
||||
|
||||
Reference in New Issue
Block a user