feat(mobile): improve dialog confirmation and remove unused spring preset
- Remove unused bouncySpringPreset from spring constants - Add handleConfirm method in dialog to support onConfirm callback - Update AddFeedDialog to handle empty URL input more gracefully Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
parent
ea32df6b9b
commit
4e2cdbee2d
|
|
@ -6,12 +6,6 @@ export const gentleSpringPreset: SpringConfig = {
|
|||
mass: 1,
|
||||
}
|
||||
|
||||
export const bouncySpringPreset: SpringConfig = {
|
||||
damping: 8,
|
||||
stiffness: 150,
|
||||
mass: 1,
|
||||
}
|
||||
|
||||
export const softSpringPreset: SpringConfig = {
|
||||
damping: 20,
|
||||
stiffness: 80,
|
||||
|
|
|
|||
|
|
@ -142,6 +142,11 @@ class DialogStatic {
|
|||
}, 16)
|
||||
}
|
||||
|
||||
const handleConfirm = () => {
|
||||
props.onConfirm?.(mergeCtx(ctx))
|
||||
handleClose()
|
||||
}
|
||||
|
||||
const Header = props.HeaderComponent ? (
|
||||
createElement(props.HeaderComponent, {
|
||||
title: props.title ?? "",
|
||||
|
|
@ -175,7 +180,7 @@ class DialogStatic {
|
|||
/>
|
||||
|
||||
<DialogDynamicButtonAction
|
||||
fallbackCaller={handleClose}
|
||||
fallbackCaller={handleConfirm}
|
||||
text={props.confirmText ?? "Confirm"}
|
||||
type="confirm"
|
||||
className={props.variant === "destructive" ? "bg-red" : "bg-accent"}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ AddFeedDialog.cancelText = "Cancel"
|
|||
|
||||
AddFeedDialog.onConfirm = (ctx) => {
|
||||
const value = ctx.url
|
||||
|
||||
if (!value) return
|
||||
ctx.dismiss()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue