Skip to content

Commit 255bc3e

Browse files
committed
removed the mobx decorators
1 parent 5f0d3f9 commit 255bc3e

File tree

1 file changed

+22
-29
lines changed

1 file changed

+22
-29
lines changed

src/stores/ui.ts

+22-29
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { action, makeAutoObservable, observable } from 'mobx';
1+
import { action, makeAutoObservable } from 'mobx';
22
import { Keyboard, ViewStyle } from 'react-native';
33
import { AnimatedStyle, SharedValue } from 'react-native-reanimated';
44
import metrics from '../constants/metrics';
@@ -33,38 +33,32 @@ export interface UiStore {
3333
class UiClass {
3434
// ---------------- BottomSheet ----------------
3535
bottomSheetContentRenderer: UiStore['bottomSheetContentRenderer'];
36-
@observable bottomSheetDebouncedDelay = false;
37-
@observable bottomSheetBottomInset = 0;
38-
@observable isBottomSheetOpen: UiStore['isBottomSheetOpen'] = false;
36+
bottomSheetDebouncedDelay = false;
37+
bottomSheetBottomInset = 0;
38+
isBottomSheetOpen: UiStore['isBottomSheetOpen'] = false;
3939

40-
@observable bottomSheetSharedValue: UiStore['bottomSheetSharedValue'] =
41-
undefined;
40+
bottomSheetSharedValue: UiStore['bottomSheetSharedValue'] = undefined;
4241

43-
@observable bottomSheetSnapPoints: UiStore['bottomSheetSnapPoints'] =
42+
bottomSheetSnapPoints: UiStore['bottomSheetSnapPoints'] =
4443
DEFAULT_BOTTOM_SHEET_SNAP_POINTS;
45-
@observable containerStyle: UiStore['containerStyle'] = {};
46-
@observable bottomSheetGorhomProps: UiStore['bottomSheetGorhomProps'] = {};
47-
@observable bottomSheetStyle: OpenBottomSheetOps['bottomSheetStyle'] =
48-
undefined;
49-
50-
@action
51-
setBottomSheetSharedValue: UiStore['setBottomSheetSharedValue'] = (
52-
sharedValue,
53-
) => {
54-
this.bottomSheetSharedValue = sharedValue;
55-
};
56-
57-
@observable
44+
containerStyle: UiStore['containerStyle'] = {};
45+
bottomSheetGorhomProps: UiStore['bottomSheetGorhomProps'] = {};
46+
bottomSheetStyle: OpenBottomSheetOps['bottomSheetStyle'] = undefined;
47+
48+
setBottomSheetSharedValue: UiStore['setBottomSheetSharedValue'] = action(
49+
(sharedValue) => {
50+
this.bottomSheetSharedValue = sharedValue;
51+
},
52+
);
53+
5854
bottomSheetTargetSharedValue: UiStore['bottomSheetTargetSharedValue'] = 0;
5955

60-
@action
6156
setBottomSheetTargetSharedValue: UiStore['setBottomSheetTargetSharedValue'] =
62-
(targetSharedValue) => {
57+
action((targetSharedValue) => {
6358
this.bottomSheetTargetSharedValue = targetSharedValue;
64-
};
59+
});
6560

66-
@action
67-
openBottomSheet: UiStore['openBottomSheet'] = (options) => {
61+
openBottomSheet: UiStore['openBottomSheet'] = action((options) => {
6862
if (!this.isBottomSheetOpen && !this.bottomSheetDebouncedDelay) {
6963
Keyboard.dismiss();
7064
this.bottomSheetDebouncedDelay = true;
@@ -86,10 +80,9 @@ class UiClass {
8680

8781
this.isBottomSheetOpen = true;
8882
}
89-
};
83+
});
9084

91-
@action
92-
closeBottomSheet: UiStore['closeBottomSheet'] = () => {
85+
closeBottomSheet: UiStore['closeBottomSheet'] = action(() => {
9386
if (this.isBottomSheetOpen) {
9487
this.isBottomSheetOpen = false;
9588

@@ -106,7 +99,7 @@ class UiClass {
10699
this.bottomSheetBottomInset = 0;
107100
}, BOTTOM_SHEET_POPUP_ANIMATION_TIME + 350);
108101
}
109-
};
102+
});
110103

111104
// ---------------- ----------------
112105

0 commit comments

Comments
 (0)