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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View file

@ -104,6 +104,11 @@ const ModalContent = styled.div<
}
}
.description {
color: var(--tertiary-foreground);
font-size: 90%;
}
${(props) =>
!props.noBackground &&
css`
@ -174,6 +179,7 @@ export default function Modal(props: Props) {
border={props.border}
padding={props.padding ?? !props.dontModal}>
{props.title && <h3>{props.title}</h3>}
{props.description && <h5>{props.description}</h5>}
{props.children}
</ModalContent>

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,