feat: add auto-update and out-of-date indicator

This commit is contained in:
Paul Makles
2022-06-12 21:16:42 +01:00
parent 7680931f5f
commit a404ff7fe0
10 changed files with 145 additions and 28 deletions

View File

@@ -0,0 +1,47 @@
import { Text } from "preact-i18n";
import { Modal } from "@revoltchat/ui";
import { noop, noopTrue } from "../../../lib/js";
import { APP_VERSION } from "../../../version";
import { ModalProps } from "../types";
export default function OutOfDate({
onClose,
version,
}: ModalProps<"out_of_date">) {
return (
<Modal
title={<Text id="app.special.modals.out_of_date.title" />}
description={
<>
<Text id="app.special.modals.out_of_date.description" />
<br />
<Text
id="app.special.modals.out_of_date.version"
fields={{ client: APP_VERSION, server: version }}
/>
</>
}
actions={[
{
palette: "plain",
onClick: noop,
children: (
<Text id="app.special.modals.out_of_date.attempting" />
),
},
{
palette: "plain-secondary",
onClick: noopTrue,
children: (
<Text id="app.special.modals.out_of_date.ignore" />
),
},
]}
onClose={onClose}
nonDismissable
/>
);
}