I finished the remaining polish so the admin app now feels fully “app‑like” across the core screens.
This commit is contained in:
24
resources/js/admin/mobile/lib/photoModerationSwipe.ts
Normal file
24
resources/js/admin/mobile/lib/photoModerationSwipe.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { TenantPhoto } from '../../api';
|
||||
import type { PhotoModerationAction } from './photoModerationQueue';
|
||||
|
||||
export type SwipeDirection = 'left' | 'right';
|
||||
|
||||
export type SwipeModerationAction = PhotoModerationAction['action'] | null;
|
||||
|
||||
export function resolvePhotoSwipeAction(photo: TenantPhoto, direction: SwipeDirection): SwipeModerationAction {
|
||||
if (direction === 'right') {
|
||||
if (photo.status === 'pending') {
|
||||
return 'approve';
|
||||
}
|
||||
if (photo.status === 'hidden') {
|
||||
return 'show';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
if (photo.status !== 'hidden') {
|
||||
return 'hide';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user