Format code for MyBots.tsx, fix i18n and make buttons less aggressive.

This commit is contained in:
Paul 2021-09-03 11:07:58 +01:00
parent 8ad1130a00
commit 71ffad9adf

View file

@ -1,5 +1,6 @@
import { Key, Clipboard, Globe, Plus } from "@styled-icons/boxicons-regular"; import { Key, Clipboard, Globe, Plus } from "@styled-icons/boxicons-regular";
import { LockAlt } from "@styled-icons/boxicons-solid"; import { LockAlt } from "@styled-icons/boxicons-solid";
import type { AxiosError } from "axios";
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 { User } from "revolt.js/dist/maps/Users";
@ -23,7 +24,6 @@ import Checkbox from "../../../components/ui/Checkbox";
import InputBox from "../../../components/ui/InputBox"; import InputBox from "../../../components/ui/InputBox";
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 type { AxiosError } from "axios";
interface Data { interface Data {
_id: string; _id: string;
@ -203,7 +203,12 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
{!editMode && ( {!editMode && (
<Tooltip <Tooltip
content={<Text id={`app.settings.pages.bots.${bot.public ? 'public' : 'private'}_bot_tip`} /> content={
<Text
id={`app.settings.pages.bots.${
bot.public ? "public" : "private"
}_bot_tip`}
/>
}> }>
{bot.public ? ( {bot.public ? (
<Globe size={24} /> <Globe size={24} />
@ -229,7 +234,11 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
} else setEditMode(true); } else setEditMode(true);
}} }}
contrast> contrast>
<Text id={`app.special.modals.actions.${editMode ? 'cancel' : 'edit'}`} /> <Text
id={`app.special.modals.actions.${
editMode ? "cancel" : "edit"
}`}
/>
</Button> </Button>
</div> </div>
{!editMode && ( {!editMode && (
@ -265,12 +274,18 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
checked={data.public} checked={data.public}
disabled={saving} disabled={saving}
contrast contrast
description={<Text id="app.settings.pages.bots.public_bot_desc" />} description={
<Text id="app.settings.pages.bots.public_bot_desc" />
}
onChange={(v) => setData({ ...data, public: v })}> onChange={(v) => setData({ ...data, public: v })}>
<Text id="app.settings.pages.bots.public_bot" /> <Text id="app.settings.pages.bots.public_bot" />
</Checkbox> </Checkbox>
<h3><Text id="app.settings.pages.bots.interactions_url" /></h3> <h3>
<h5><Text id="app.settings.pages.bots.reserved" /></h5> <Text id="app.settings.pages.bots.interactions_url" />
</h3>
<h5>
<Text id="app.settings.pages.bots.reserved" />
</h5>
<InputBox <InputBox
ref={setInteractionsRef} ref={setInteractionsRef}
value={data.interactions_url} value={data.interactions_url}
@ -321,7 +336,6 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
<Text id="app.settings.pages.bots.copy_invite" /> <Text id="app.settings.pages.bots.copy_invite" />
</Button> </Button>
<Button <Button
accent
onClick={() => onClick={() =>
internalEmit( internalEmit(
"Intermediate", "Intermediate",
@ -329,7 +343,7 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
`/bot/${bot._id}`, `/bot/${bot._id}`,
) )
}> }>
<Text id="app.settings.pages.bots.add_bot" /> <Text id="app.settings.pages.bots.add" />
</Button> </Button>
</> </>
)} )}