mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
New design for server roles editor.
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user