mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 01:15:28 +00:00
chore: i18n
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { QRCodeSVG } from "qrcode.react";
|
||||
import styled from "styled-components";
|
||||
|
||||
import { Text } from "preact-i18n";
|
||||
import { useState } from "preact/hooks";
|
||||
|
||||
import { Category, Centred, Column, InputBox, Modal } from "@revoltchat/ui";
|
||||
@@ -25,14 +26,12 @@ export default function MFAEnableTOTP({
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="Enable authenticator app"
|
||||
description={
|
||||
"Please scan or use the token below in your authentication app."
|
||||
}
|
||||
title={<Text id="app.special.modals.mfa.enable_totp" />}
|
||||
description={<Text id="app.special.modals.mfa.prompt_totp" />}
|
||||
actions={[
|
||||
{
|
||||
palette: "primary",
|
||||
children: "Continue",
|
||||
children: <Text id="app.special.modals.actions.continue" />,
|
||||
onClick: () => {
|
||||
callback(value.trim().replace(/\s/g, ""));
|
||||
return true;
|
||||
@@ -41,7 +40,7 @@ export default function MFAEnableTOTP({
|
||||
},
|
||||
{
|
||||
palette: "plain",
|
||||
children: "Cancel",
|
||||
children: <Text id="app.special.modals.actions.cancel" />,
|
||||
onClick: () => {
|
||||
callback();
|
||||
return true;
|
||||
@@ -65,7 +64,9 @@ export default function MFAEnableTOTP({
|
||||
</Centred>
|
||||
</Column>
|
||||
|
||||
<Category compact>Enter Code</Category>
|
||||
<Category compact>
|
||||
<Text id="app.special.modals.mfa.enter_code" />
|
||||
</Category>
|
||||
|
||||
<InputBox
|
||||
value={value}
|
||||
|
||||
@@ -126,39 +126,51 @@ export default function MFAFlow({ onClose, ...props }: ModalProps<"mfa_flow">) {
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="Confirm action."
|
||||
title={<Text id="app.special.modals.confirm" />}
|
||||
description={
|
||||
selectedMethod
|
||||
? "Please confirm using selected method."
|
||||
: "Please select a method to authenticate your request."
|
||||
<Text
|
||||
id={`app.special.modals.mfa.${
|
||||
selectedMethod ? "confirm" : "select_method"
|
||||
}`}
|
||||
/>
|
||||
}
|
||||
actions={
|
||||
selectedMethod
|
||||
? [
|
||||
{
|
||||
palette: "primary",
|
||||
children: "Confirm",
|
||||
children: (
|
||||
<Text id="app.special.modals.actions.confirm" />
|
||||
),
|
||||
onClick: generateTicket,
|
||||
confirmation: true,
|
||||
},
|
||||
{
|
||||
palette: "plain",
|
||||
children:
|
||||
methods!.length === 1 ? "Cancel" : "Back",
|
||||
children: (
|
||||
<Text
|
||||
id={`app.special.modals.actions.${
|
||||
methods!.length === 1
|
||||
? "cancel"
|
||||
: "back"
|
||||
}`}
|
||||
/>
|
||||
),
|
||||
onClick: () => {
|
||||
if (methods!.length === 1) {
|
||||
props.callback();
|
||||
return true;
|
||||
}
|
||||
setSelected(undefined);
|
||||
|
||||
}
|
||||
setSelected(undefined);
|
||||
},
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
palette: "plain",
|
||||
children: "Cancel",
|
||||
children: (
|
||||
<Text id="app.special.modals.actions.cancel" />
|
||||
),
|
||||
onClick: () => {
|
||||
props.callback();
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import styled from "styled-components";
|
||||
|
||||
import { Text } from "preact-i18n";
|
||||
import { useCallback, useState } from "preact/hooks";
|
||||
|
||||
import { Modal } from "@revoltchat/ui";
|
||||
@@ -49,29 +50,29 @@ export default function MFARecovery({
|
||||
}
|
||||
|
||||
return false;
|
||||
}, []);
|
||||
}, [client]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title="Your recovery codes"
|
||||
description={"Please save these to a safe location."}
|
||||
title={<Text id="app.special.modals.mfa.recovery_codes" />}
|
||||
description={<Text id="app.special.modals.mfa.save_codes" />}
|
||||
actions={[
|
||||
{
|
||||
palette: "primary",
|
||||
children: "Done",
|
||||
children: <Text id="app.special.modals.actions.done" />,
|
||||
onClick: noopTrue,
|
||||
confirmation: true,
|
||||
},
|
||||
{
|
||||
palette: "plain",
|
||||
children: "Reset",
|
||||
children: <Text id="app.special.modals.actions.reset" />,
|
||||
onClick: reset,
|
||||
},
|
||||
]}
|
||||
onClose={onClose}>
|
||||
<List>
|
||||
{known.map((code) => (
|
||||
<span>{code}</span>
|
||||
<span key={code}>{code}</span>
|
||||
))}
|
||||
</List>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user