mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-26 07:22:10 -05:00
Add translate strings to server identity
This commit is contained in:
parent
11f8d081ba
commit
b0407490a8
1 changed files with 15 additions and 5 deletions
|
@ -2,6 +2,7 @@ import { observer } from "mobx-react-lite";
|
||||||
import { Server } from "revolt.js/dist/maps/Servers";
|
import { Server } from "revolt.js/dist/maps/Servers";
|
||||||
|
|
||||||
import styles from "./ServerIdentityModal.module.scss";
|
import styles from "./ServerIdentityModal.module.scss";
|
||||||
|
import { Text } from "preact-i18n";
|
||||||
import { useEffect, useState } from "preact/hooks";
|
import { useEffect, useState } from "preact/hooks";
|
||||||
|
|
||||||
import Button from "../../../components/ui/Button";
|
import Button from "../../../components/ui/Button";
|
||||||
|
@ -36,11 +37,18 @@ export const ServerIdentityModal = observer(({ server, onClose }: Props) => {
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
visible={true}
|
visible={true}
|
||||||
title={`Change Identity on ${server.name}`}
|
title={
|
||||||
|
<Text
|
||||||
|
id={"app.special.popovers.server_identity.title"}
|
||||||
|
fields={{ server: server.name }}
|
||||||
|
/>
|
||||||
|
}
|
||||||
onClose={onClose}>
|
onClose={onClose}>
|
||||||
<div className={styles.identityMain}>
|
<div className={styles.identityMain}>
|
||||||
<div>
|
<div>
|
||||||
<Overline type="subtle">Avatar</Overline>
|
<Overline type="subtle">
|
||||||
|
<Text id="app.special.popovers.server_identity.avatar" />
|
||||||
|
</Overline>
|
||||||
<FileUploader
|
<FileUploader
|
||||||
width={80}
|
width={80}
|
||||||
height={80}
|
height={80}
|
||||||
|
@ -63,7 +71,9 @@ export const ServerIdentityModal = observer(({ server, onClose }: Props) => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<Overline type="subtle">Nickname</Overline>
|
<Overline type="subtle">
|
||||||
|
<Text id="app.special.popovers.server_identity.nickname" />
|
||||||
|
</Overline>
|
||||||
<InputBox
|
<InputBox
|
||||||
value={nickname}
|
value={nickname}
|
||||||
placeholder={client.user!.username}
|
placeholder={client.user!.username}
|
||||||
|
@ -73,7 +83,7 @@ export const ServerIdentityModal = observer(({ server, onClose }: Props) => {
|
||||||
<Button
|
<Button
|
||||||
disabled={nickname === currentNickname}
|
disabled={nickname === currentNickname}
|
||||||
onClick={() => member.edit({ nickname })}>
|
onClick={() => member.edit({ nickname })}>
|
||||||
Save
|
<Text id="app.special.modals.actions.save" />
|
||||||
</Button>
|
</Button>
|
||||||
{currentNickname !== "" && (
|
{currentNickname !== "" && (
|
||||||
<Button
|
<Button
|
||||||
|
@ -81,7 +91,7 @@ export const ServerIdentityModal = observer(({ server, onClose }: Props) => {
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
member.edit({ remove: "Nickname" })
|
member.edit({ remove: "Nickname" })
|
||||||
}>
|
}>
|
||||||
Remove
|
<Text id="app.special.modals.actions.remove" />
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue