feat: notify user of aup when creating server (#495)

This commit is contained in:
Ed L
2022-04-05 23:38:59 +01:00
committed by GitHub
parent 5d4ef8b178
commit 3f9e6fc2e2
2 changed files with 20 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ interface Props {
onClose: () => void;
question: Children;
field?: Children;
description?: Children;
defaultValue?: string;
callback: (value: string) => Promise<void>;
}
@@ -25,6 +26,7 @@ export function InputModal({
onClose,
question,
field,
description,
defaultValue,
callback,
}: Props) {
@@ -36,6 +38,7 @@ export function InputModal({
<Modal
visible={true}
title={question}
description={description}
disabled={processing}
actions={[
{
@@ -113,6 +116,17 @@ export function SpecialInputModal(props: SpecialProps) {
onClose={onClose}
question={<Text id="app.main.servers.create" />}
field={<Text id="app.main.servers.name" />}
description={
<div>
By creating this server, you agree to the{" "}
<a
href="https://revolt.chat/aup"
target="_blank"
rel="noreferrer">
Acceptable Use Policy.
</a>
</div>
}
callback={async (name) => {
const server = await client.servers.createServer({
name,