updated notifications
This commit is contained in:
parent
54347e61d3
commit
beff6e75ba
@ -52,7 +52,6 @@ const ToastContext = React.createContext<ToastContextValue | null>(null)
|
|||||||
const TOAST_LEAVE_MS = 220
|
const TOAST_LEAVE_MS = 220
|
||||||
const TOAST_SWIPE_DISMISS_PX = 96
|
const TOAST_SWIPE_DISMISS_PX = 96
|
||||||
const TOAST_SWIPE_LOCK_PX = 10
|
const TOAST_SWIPE_LOCK_PX = 10
|
||||||
const TOAST_SWIPE_MAX_ROTATION_DEG = 3
|
|
||||||
|
|
||||||
function iconFor(type: ToastType) {
|
function iconFor(type: ToastType) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -533,15 +532,8 @@ export function ToastProvider({
|
|||||||
? Math.max(0.985, 1 - absDx / 1600)
|
? Math.max(0.985, 1 - absDx / 1600)
|
||||||
: 1
|
: 1
|
||||||
|
|
||||||
const dragRotate = swipe.dragging
|
|
||||||
? Math.max(
|
|
||||||
-TOAST_SWIPE_MAX_ROTATION_DEG,
|
|
||||||
Math.min(TOAST_SWIPE_MAX_ROTATION_DEG, swipe.dx / 40)
|
|
||||||
)
|
|
||||||
: 0
|
|
||||||
|
|
||||||
const swipeStyle: React.CSSProperties = {
|
const swipeStyle: React.CSSProperties = {
|
||||||
transform: `translateX(${swipe.dx}px) scale(${dragScale}) rotate(${dragRotate}deg)`,
|
transform: `translateX(${swipe.dx}px) scale(${dragScale})`,
|
||||||
opacity: dragOpacity,
|
opacity: dragOpacity,
|
||||||
transition: swipe.dragging
|
transition: swipe.dragging
|
||||||
? 'none'
|
? 'none'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user