about summary refs log tree commit diff
path: root/src/state/models/shell-ui.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-01-27 15:51:24 -0600
committerPaul Frazee <pfrazee@gmail.com>2023-01-27 15:51:24 -0600
commit7916b26aadb7e003728d9dc653ab8b8deabf4076 (patch)
tree507d24512fd71c67d4fe49af4ae5f8746444cceb /src/state/models/shell-ui.ts
parent0673129b2018c9db0f7c3fc3e2c3214150efcfb8 (diff)
downloadvoidsky-7916b26aadb7e003728d9dc653ab8b8deabf4076.tar.zst
Break out the web/native image picking code and make some progress on the web version
Diffstat (limited to 'src/state/models/shell-ui.ts')
-rw-r--r--src/state/models/shell-ui.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/state/models/shell-ui.ts b/src/state/models/shell-ui.ts
index b84d6ece9..09ffd265a 100644
--- a/src/state/models/shell-ui.ts
+++ b/src/state/models/shell-ui.ts
@@ -1,6 +1,7 @@
 import {makeAutoObservable} from 'mobx'
 import {ProfileViewModel} from './profile-view'
 import {isObj, hasProp} from '../lib/type-guards'
+import {PickedMedia} from '../../view/com/util/images/image-crop-picker/types'
 
 export class ConfirmModal {
   name = 'confirm'
@@ -52,6 +53,17 @@ export class ReportAccountModal {
   }
 }
 
+export class CropImageModal {
+  name = 'crop-image'
+
+  constructor(
+    public uri: string,
+    public onSelect: (img?: PickedMedia) => void,
+  ) {
+    makeAutoObservable(this)
+  }
+}
+
 interface LightboxModel {}
 
 export class ProfileImageLightbox implements LightboxModel {
@@ -98,6 +110,7 @@ export class ShellUiModel {
     | ServerInputModal
     | ReportPostModal
     | ReportAccountModal
+    | CropImageModal
     | undefined
   isLightboxActive = false
   activeLightbox: ProfileImageLightbox | ImagesLightbox | undefined
@@ -140,7 +153,8 @@ export class ShellUiModel {
       | EditProfileModal
       | ServerInputModal
       | ReportPostModal
-      | ReportAccountModal,
+      | ReportAccountModal
+      | CropImageModal,
   ) {
     this.isModalActive = true
     this.activeModal = modal