New design for server roles editor.

This commit is contained in:
Paul
2021-07-03 22:17:53 +01:00
parent 91b74c39be
commit d0818bb165
9 changed files with 145 additions and 76 deletions

View File

@@ -68,7 +68,8 @@ export function InputModal({
}
type SpecialProps = { onClose: () => void } & (
{ type: "create_group" | "create_server" | "set_custom_status" | "add_friend" }
{ type: "create_group" | "create_server" | "set_custom_status" | "add_friend" } |
{ type: "create_role", server: string, callback: (id: string) => void }
)
export function SpecialInputModal(props: SpecialProps) {
@@ -112,6 +113,17 @@ export function SpecialInputModal(props: SpecialProps) {
}}
/>;
}
case "create_role": {
return <InputModal
onClose={onClose}
question={<Text id="app.settings.permissions.create_role" />}
field={<Text id="app.settings.permissions.role_name" />}
callback={async name => {
const role = await client.servers.createRole(props.server, name);
props.callback(role.id);
}}
/>;
}
case "set_custom_status": {
return <InputModal
onClose={onClose}