Add "add bot" button

This commit is contained in:
Snazzah 2021-08-31 02:33:36 +00:00 committed by GitHub
parent 430714e816
commit a76d992db1

View file

@ -2,6 +2,7 @@ import { Key, Clipboard, Globe } from "@styled-icons/boxicons-regular";
import { LockAlt } from "@styled-icons/boxicons-solid"; import { LockAlt } from "@styled-icons/boxicons-solid";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import { Bot } from "revolt-api/types/Bots"; import { Bot } from "revolt-api/types/Bots";
import { User } from "revolt.js/dist/maps/Users";
import styled from "styled-components"; import styled from "styled-components";
import styles from "./Panes.module.scss"; import styles from "./Panes.module.scss";
@ -9,6 +10,7 @@ import { Text } from "preact-i18n";
import { useEffect, useState } from "preact/hooks"; import { useEffect, useState } from "preact/hooks";
import { stopPropagation } from "../../../lib/stopPropagation"; import { stopPropagation } from "../../../lib/stopPropagation";
import { internalEmit } from "../../../lib/eventEmitter";
import { useIntermediate } from "../../../context/intermediate/Intermediate"; import { useIntermediate } from "../../../context/intermediate/Intermediate";
import { FileUploader } from "../../../context/revoltjs/FileUploads"; import { FileUploader } from "../../../context/revoltjs/FileUploads";
@ -22,7 +24,6 @@ import InputBox from "../../../components/ui/InputBox";
import Overline from "../../../components/ui/Overline"; import Overline from "../../../components/ui/Overline";
import Tip from "../../../components/ui/Tip"; import Tip from "../../../components/ui/Tip";
import CategoryButton from "../../../components/ui/fluent/CategoryButton"; import CategoryButton from "../../../components/ui/fluent/CategoryButton";
import { User } from "revolt.js/dist/maps/Users";
interface Data { interface Data {
_id: string; _id: string;
@ -297,12 +298,27 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
</> </>
)} )}
{!editMode && ( {!editMode && (
<>
<Button <Button
onClick={() => onClick={() =>
writeClipboard(`${window.origin}/bot/${bot._id}`) writeClipboard(
`${window.origin}/bot/${bot._id}`,
)
}> }>
Copy Invite Link Copy Invite Link
</Button> </Button>
<Button
accent
onClick={() =>
internalEmit(
"Intermediate",
"navigate",
`/bot/${bot._id}`,
)
}>
Add Bot
</Button>
</>
)} )}
</div> </div>
</div> </div>