feat: port input modals to new system

This commit is contained in:
Paul Makles
2022-07-05 17:53:41 +01:00
parent 56955a5934
commit 32474a5c6f
19 changed files with 275 additions and 127 deletions

View File

@@ -347,9 +347,8 @@ export default observer(() => {
<a
className="status"
onClick={() =>
openScreen({
id: "special_input",
type: "set_custom_status",
modalController.push({
type: "custom_status",
})
}>
Change your status...

View File

@@ -16,10 +16,9 @@ import {
Category,
} from "@revoltchat/ui";
import { useIntermediate } from "../../../context/intermediate/Intermediate";
import { PermissionList } from "../../../components/settings/roles/PermissionList";
import { RoleOrDefault } from "../../../components/settings/roles/RoleSelection";
import { modalController } from "../../../controllers/modals/ModalController";
interface Props {
server: Server;
@@ -54,18 +53,14 @@ export const Roles = observer(({ server }: Props) => {
// Consolidate all permissions that we can change right now.
const currentRoles = useRoles(server);
// Pull in modal context.
const { openScreen } = useIntermediate();
return (
<PermissionsLayout
server={server}
rank={server.member?.ranking ?? Infinity}
onCreateRole={(callback) =>
openScreen({
id: "special_input",
modalController.push({
type: "create_role",
server: server as any,
server,
callback,
})
}