mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
feat(sessions): Add confirmation prompt (#575)
Reopening of issue #572 Fixes issue #42 Translations added on PR 31 of revolt/translations Co-authored-by: Paul Makles <paulmakles@gmail.com>
This commit is contained in:
38
src/context/intermediate/modals/SessionsPrompt.tsx
Normal file
38
src/context/intermediate/modals/SessionsPrompt.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import { Text } from "preact-i18n";
|
||||
|
||||
import Modal from "../../../components/ui/Modal";
|
||||
|
||||
interface Props {
|
||||
onClose: () => void;
|
||||
confirm: () => void;
|
||||
}
|
||||
|
||||
export function SessionsModal({ onClose, confirm}: Props) {
|
||||
return (
|
||||
<Modal
|
||||
visible={true}
|
||||
onClose={onClose}
|
||||
title={<Text id={"app.special.modals.sessions.title"} />}
|
||||
actions={[
|
||||
{
|
||||
onClick: () => {
|
||||
onClose()
|
||||
},
|
||||
confirmation: true,
|
||||
contrast: true,
|
||||
accent: true,
|
||||
children: <Text id="app.special.modals.actions.back"/>
|
||||
},
|
||||
{
|
||||
onClick: () => {
|
||||
confirm()
|
||||
onClose()
|
||||
},
|
||||
confirmation: true,
|
||||
children: <Text id="app.special.modals.sessions.accept"/>
|
||||
}
|
||||
]}>
|
||||
<Text id="app.special.modals.sessions.short" /> <br />
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user