forked from abner/for-legacy-web
feat: switch to revolt.js@6.0.0 + new revolt-api
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { ArrowBack } from "@styled-icons/boxicons-regular";
|
||||
import { autorun } from "mobx";
|
||||
import { Redirect, useHistory, useParams } from "react-router-dom";
|
||||
import { RetrievedInvite } from "revolt-api/types/Invites";
|
||||
import { API } from "revolt.js";
|
||||
|
||||
import styles from "./Invite.module.scss";
|
||||
import { Text } from "preact-i18n";
|
||||
@@ -36,7 +36,7 @@ export default function Invite() {
|
||||
const { code } = useParams<{ code: string }>();
|
||||
const [processing, setProcessing] = useState(false);
|
||||
const [error, setError] = useState<string | undefined>(undefined);
|
||||
const [invite, setInvite] = useState<RetrievedInvite | undefined>(
|
||||
const [invite, setInvite] = useState<API.InviteResponse | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
@@ -92,6 +92,8 @@ export default function Invite() {
|
||||
);
|
||||
}
|
||||
|
||||
if (invite.type === "Group") return <h1>unimplemented</h1>;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={styles.invite}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useParams } from "react-router-dom";
|
||||
import { Permission } from "revolt.js";
|
||||
import { Route } from "revolt.js/dist/api/routes";
|
||||
import { API, Permission } from "revolt.js";
|
||||
import styled from "styled-components/macro";
|
||||
|
||||
import { useEffect, useState } from "preact/hooks";
|
||||
@@ -37,8 +36,7 @@ const Option = styled.div`
|
||||
export default function InviteBot() {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const client = useClient();
|
||||
const [data, setData] =
|
||||
useState<Route<"GET", "/bots/id/invite">["response"]>();
|
||||
const [data, setData] = useState<API.PublicBot>();
|
||||
|
||||
useEffect(() => {
|
||||
client.bots.fetchPublic(id).then(setData);
|
||||
|
||||
Reference in New Issue
Block a user