mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
Re-write types for modal actions.
This commit is contained in:
@@ -17,7 +17,7 @@ export function ClipboardModal({ onClose, text }: Props) {
|
||||
{
|
||||
onClick: onClose,
|
||||
confirmation: true,
|
||||
text: <Text id="app.special.modals.actions.close" />,
|
||||
children: <Text id="app.special.modals.actions.close" />,
|
||||
},
|
||||
]}>
|
||||
{location.protocol !== "https:" && (
|
||||
|
||||
@@ -17,11 +17,11 @@ export function ErrorModal({ onClose, error }: Props) {
|
||||
{
|
||||
onClick: onClose,
|
||||
confirmation: true,
|
||||
text: <Text id="app.special.modals.actions.ok" />,
|
||||
children: <Text id="app.special.modals.actions.ok" />,
|
||||
},
|
||||
{
|
||||
onClick: () => location.reload(),
|
||||
text: <Text id="app.special.modals.actions.reload" />,
|
||||
children: <Text id="app.special.modals.actions.reload" />,
|
||||
},
|
||||
]}>
|
||||
<Text id={`error.${error}`}>{error}</Text>
|
||||
|
||||
@@ -39,7 +39,7 @@ export function InputModal({
|
||||
actions={[
|
||||
{
|
||||
confirmation: true,
|
||||
text: <Text id="app.special.modals.actions.ok" />,
|
||||
children: <Text id="app.special.modals.actions.ok" />,
|
||||
onClick: () => {
|
||||
setProcessing(true);
|
||||
callback(value)
|
||||
@@ -51,7 +51,7 @@ export function InputModal({
|
||||
},
|
||||
},
|
||||
{
|
||||
text: <Text id="app.special.modals.actions.cancel" />,
|
||||
children: <Text id="app.special.modals.actions.cancel" />,
|
||||
onClick: onClose,
|
||||
},
|
||||
]}
|
||||
@@ -155,7 +155,7 @@ export function SpecialInputModal(props: SpecialProps) {
|
||||
status: {
|
||||
...client.user?.status,
|
||||
text: text.trim().length > 0 ? text : undefined,
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -122,7 +122,7 @@ export function SpecialPromptModal(props: SpecialProps) {
|
||||
confirmation: true,
|
||||
contrast: true,
|
||||
error: true,
|
||||
text: (
|
||||
children: (
|
||||
<Text
|
||||
id={`app.special.modals.actions.${event[1]}`}
|
||||
/>
|
||||
@@ -165,7 +165,7 @@ export function SpecialPromptModal(props: SpecialProps) {
|
||||
},
|
||||
},
|
||||
{
|
||||
text: (
|
||||
children: (
|
||||
<Text id="app.special.modals.actions.cancel" />
|
||||
),
|
||||
onClick: onClose,
|
||||
@@ -192,7 +192,7 @@ export function SpecialPromptModal(props: SpecialProps) {
|
||||
confirmation: true,
|
||||
contrast: true,
|
||||
error: true,
|
||||
text: (
|
||||
children: (
|
||||
<Text id="app.special.modals.actions.delete" />
|
||||
),
|
||||
onClick: async () => {
|
||||
@@ -212,10 +212,11 @@ export function SpecialPromptModal(props: SpecialProps) {
|
||||
},
|
||||
},
|
||||
{
|
||||
text: (
|
||||
children: (
|
||||
<Text id="app.special.modals.actions.cancel" />
|
||||
),
|
||||
onClick: onClose,
|
||||
plain: true,
|
||||
},
|
||||
]}
|
||||
content={
|
||||
@@ -255,12 +256,12 @@ export function SpecialPromptModal(props: SpecialProps) {
|
||||
question={<Text id={`app.context_menu.create_invite`} />}
|
||||
actions={[
|
||||
{
|
||||
text: <Text id="app.special.modals.actions.ok" />,
|
||||
children: <Text id="app.special.modals.actions.ok" />,
|
||||
confirmation: true,
|
||||
onClick: onClose,
|
||||
},
|
||||
{
|
||||
text: <Text id="app.context_menu.copy_link" />,
|
||||
children: <Text id="app.context_menu.copy_link" />,
|
||||
onClick: () =>
|
||||
writeClipboard(
|
||||
`${window.location.protocol}//${window.location.host}/invite/${code}`,
|
||||
@@ -291,7 +292,7 @@ export function SpecialPromptModal(props: SpecialProps) {
|
||||
question={<Text id={`app.context_menu.kick_member`} />}
|
||||
actions={[
|
||||
{
|
||||
text: <Text id="app.special.modals.actions.kick" />,
|
||||
children: <Text id="app.special.modals.actions.kick" />,
|
||||
contrast: true,
|
||||
error: true,
|
||||
confirmation: true,
|
||||
@@ -311,7 +312,7 @@ export function SpecialPromptModal(props: SpecialProps) {
|
||||
},
|
||||
},
|
||||
{
|
||||
text: (
|
||||
children: (
|
||||
<Text id="app.special.modals.actions.cancel" />
|
||||
),
|
||||
onClick: onClose,
|
||||
@@ -341,7 +342,7 @@ export function SpecialPromptModal(props: SpecialProps) {
|
||||
question={<Text id={`app.context_menu.ban_member`} />}
|
||||
actions={[
|
||||
{
|
||||
text: <Text id="app.special.modals.actions.ban" />,
|
||||
children: <Text id="app.special.modals.actions.ban" />,
|
||||
contrast: true,
|
||||
error: true,
|
||||
confirmation: true,
|
||||
@@ -362,7 +363,7 @@ export function SpecialPromptModal(props: SpecialProps) {
|
||||
},
|
||||
},
|
||||
{
|
||||
text: (
|
||||
children: (
|
||||
<Text id="app.special.modals.actions.cancel" />
|
||||
),
|
||||
onClick: onClose,
|
||||
@@ -404,7 +405,7 @@ export function SpecialPromptModal(props: SpecialProps) {
|
||||
{
|
||||
confirmation: true,
|
||||
contrast: true,
|
||||
text: (
|
||||
children: (
|
||||
<Text id="app.special.modals.actions.create" />
|
||||
),
|
||||
onClick: async () => {
|
||||
@@ -432,7 +433,7 @@ export function SpecialPromptModal(props: SpecialProps) {
|
||||
},
|
||||
},
|
||||
{
|
||||
text: (
|
||||
children: (
|
||||
<Text id="app.special.modals.actions.cancel" />
|
||||
),
|
||||
onClick: onClose,
|
||||
|
||||
@@ -16,7 +16,7 @@ export function SignedOutModal({ onClose }: Props) {
|
||||
{
|
||||
onClick: onClose,
|
||||
confirmation: true,
|
||||
text: <Text id="app.special.modals.actions.ok" />,
|
||||
children: <Text id="app.special.modals.actions.ok" />,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -71,7 +71,7 @@ export function ModifyAccountModal({ onClose, field }: Props) {
|
||||
{
|
||||
confirmation: true,
|
||||
onClick: handleSubmit(onSubmit),
|
||||
text:
|
||||
children:
|
||||
field === "email" ? (
|
||||
<Text id="app.special.modals.actions.send_email" />
|
||||
) : (
|
||||
@@ -80,7 +80,7 @@ export function ModifyAccountModal({ onClose, field }: Props) {
|
||||
},
|
||||
{
|
||||
onClick: onClose,
|
||||
text: <Text id="app.special.modals.actions.close" />,
|
||||
children: <Text id="app.special.modals.actions.close" />,
|
||||
},
|
||||
]}>
|
||||
{/* Preact / React typing incompatabilities */}
|
||||
|
||||
@@ -28,7 +28,7 @@ export function UserPicker(props: Props) {
|
||||
onClose={props.onClose}
|
||||
actions={[
|
||||
{
|
||||
text: <Text id="app.special.modals.actions.ok" />,
|
||||
children: <Text id="app.special.modals.actions.ok" />,
|
||||
onClick: () => props.callback(selected).then(props.onClose),
|
||||
},
|
||||
]}>
|
||||
|
||||
Reference in New Issue
Block a user