diff --git a/src/context/intermediate/popovers/ServerIdentityModal.module.scss b/src/context/intermediate/popovers/ServerIdentityModal.module.scss new file mode 100644 index 00000000..f88aed03 --- /dev/null +++ b/src/context/intermediate/popovers/ServerIdentityModal.module.scss @@ -0,0 +1,17 @@ +.identityMain { + display: flex; + flex-direction: row; + gap: 10px; + + > div { + display: flex; + flex-direction: column; + gap: 10px; + } + + .buttons { + display: flex; + flex-direction: row; + gap: 10px; + } +} diff --git a/src/context/intermediate/popovers/ServerIdentityModal.tsx b/src/context/intermediate/popovers/ServerIdentityModal.tsx index 3ef55266..c252697e 100644 --- a/src/context/intermediate/popovers/ServerIdentityModal.tsx +++ b/src/context/intermediate/popovers/ServerIdentityModal.tsx @@ -1,13 +1,14 @@ import { observer } from "mobx-react-lite"; import { Server } from "revolt.js/dist/maps/Servers"; +import styles from "./ServerIdentityModal.module.scss"; +import { Text } from "preact-i18n"; import { useEffect, useState } from "preact/hooks"; import Button from "../../../components/ui/Button"; import InputBox from "../../../components/ui/InputBox"; import Modal from "../../../components/ui/Modal"; import Overline from "../../../components/ui/Overline"; -import Tip from "../../../components/ui/Tip"; import { FileUploader } from "../../revoltjs/FileUploads"; import { useClient } from "../../revoltjs/RevoltClient"; @@ -27,49 +28,75 @@ export const ServerIdentityModal = observer(({ server, onClose }: Props) => { if (!member) return null; const [nickname, setNickname] = useState(""); - useEffect(() => setNickname(member.nickname ?? ""), [member.nickname]); + const [currentNickname, setCurrentNickname] = useState(""); + useEffect(() => { + setNickname(member.nickname ?? ""); + setCurrentNickname(member.nickname ?? ""); + }, [member.nickname]); return ( - - - This section is under construction. - - Nickname -

- setNickname(e.currentTarget.value)} + -

-

- -

-

- -

- Avatar - member.edit({ avatar })} - remove={() => member.edit({ remove: "Avatar" })} - defaultPreview={client.generateFileURL( - member.avatar ?? undefined, - { max_side: 256 }, - true, - )} - previewURL={client.generateFileURL( - member.avatar ?? undefined, - { max_side: 256 }, - true, - )} - /> + } + onClose={onClose}> +
+
+ + + + member.edit({ avatar })} + remove={() => member.edit({ remove: "Avatar" })} + defaultPreview={client.generateFileURL( + member.avatar ?? undefined, + { max_side: 256 }, + true, + )} + previewURL={client.generateFileURL( + member.avatar ?? undefined, + { max_side: 256 }, + true, + )} + /> +
+
+ + + + setNickname(e.currentTarget.value)} + /> +
+ + {currentNickname !== "" && ( + + )} +
+
+
); });