improvement(plugins-page): Use i18n Text

Note that, since the translation PR has not been made yet, this patch
was used to test the changes: https://public.alyxia.dev/revolt/lang.diff
This commit is contained in:
Alyxia Sother 2022-03-29 13:32:59 +02:00 committed by Paul Makles
parent 07439bd5f6
commit 0d6720e3b1
3 changed files with 16 additions and 4 deletions

View file

@ -166,8 +166,7 @@ export default observer(() => {
{
id: "plugins",
icon: <Plug size={20} />,
// TODO(lexisother): Replace this with the actual i18n <Text />
title: <p>Plugins</p>,
title: <Text id="app.settings.pages.plugins.title" />,
hidden: !experiments.isEnabled("plugins"),
},
{

View file

@ -532,6 +532,13 @@
h1 {
margin-bottom: 20px !important;
}
.empty {
display: flex;
justify-content: center;
align-items: center;
margin-top: 1rem;
}
}
.myBots {

View file

@ -1,6 +1,7 @@
import { observer } from "mobx-react-lite";
import styles from "./Panes.module.scss";
import { Text } from "preact-i18n";
import { useApplicationState } from "../../../mobx/State";
@ -11,12 +12,11 @@ export const PluginsPage = observer(() => {
const plugins = useApplicationState().plugins;
return (
<div className={styles.plugins}>
{/* TODO(lexisother): Wrap in <h3><Text /></h3> */}
<h1>Plugins</h1>
<Tip error hideSeparator>
Warning: This feature is still in development.
</Tip>
{plugins.list().map((plugin) => {
// TODO(lexisother): Stop using Checkbox, write a custom component
return (
<Checkbox
key={plugin.id}
@ -31,6 +31,12 @@ export const PluginsPage = observer(() => {
</Checkbox>
);
})}
{plugins.list().length === 0 && (
<div className={styles.empty}>
<Text id="app.settings.pages.plugins.no_plugins" />
</div>
)}
</div>
);
});